如何使用ARM单片机蓝牙模块控制东芝TC35661蓝牙模块

We use cookies to ensure that we give you the best experience on our website. If you continue to browse without changing your settings, we&ll assume that you&re happy to receive all the cookies on this Toshiba website. You can also click the &Continue& button to accept our policy in your browser so this message does not appear in the future. You can, of course, change your cookie preferences at any time via your browser settings.
Details of our cookies and cookie policy are accessible under the link &Find out more&.
TC35661 Dual Mode (LE & Classic)
Weibo QR Description
Popup QR Description
WeChat QR Description
Popup QR Description
A new window will open
Bluetooth(R) Single-Chip Controller for BT Classic (3.0+EDR) and Bluetooth Low Energy (4.0, 4.2)
The TC35661 series are highly integrated RFCMOS Bluetooth devices which support Bluetooth Classic (3.0+EDR) and Bluetooth Low Energy (LE) 4.0 and 4.2 standards. TC35661 supports the standard Bluetooth HCI interface and offers integration of stack and selected BT profiles on-chip.& Through its WIFI coexistence interface it supports the BT3.0-HS function.& The devices realise an easy way to integrate Bluetooth for various industrial, medical and automotive applications.& Toshiba has tested the Bluetooth interoperability extensively.& All Toshiba Bluetooth devices and software are Bluetooth Qualification Expert (BQE) qualified.
(pdf 4.9MB)
Bluetooth Module with TC35661 Bluetooth LSI available
The Toshiba Bluetooth(R) LSI TC35661SBG has been embedded - including it's SPP & BLE-GATT profile - into the Panasonic (PIDEU) module PAN1026. It is FCC/IC/CE certified.& The embedded stack and profile were Bluetooth(TM)& SIG approved through extensive BQB (Bluetooth(TM) Qualification Body) tests.& The module is ideal for for wireless serial applications and all kind of BLE connectivity.& System developers can make use of the Serial Port Profile and hook on their selected BLE profile onto BLE-GATT through the comfortable Toshiba API interface over UART.&
TC35661 (FBGA64) Block Diagram
Key Benefits
Dual Mode core for classic and Bluetooth 4.0 and 4.2 standards
BQE qualified hardware and software for easy Bluetooth EPL
Flexible system architectures through:
Embedded profile model
Stand alone model
Embedded on-chip Bluetooth stack and selected profiles for easy Bluetooth system design
Stand alone operation for small applications is feasible without a host MCU
Ultra low bill of materials due to very few external components
Multiple programmable IO options
On-chip voltage controller and low power modes
Consumer and automotive qualification& (AEC-Q100)
TC35661 Line-up
System Configuration
Product ID(*)
BT 4.0 HCI standard incl. WideBandSpeech
BT 4.0 Embedded Profile
BT 4.2 Embedded Profile
SPP (with EDR)
TC (4.2 group)
SPP+BLE GATT
TC (4.0 group)
SPP+BLE GATT
RC (4.2 group)
HID+BLE GATT
TC (4.0 group)
SPP+BLE GATT with Secure connection
TC (4.2 group)
BT 4.0 Stand Alone With Embedded Profile
SPP Stand Alone
HID Stand Alone
Bluetooth(R) Core Spec 3.0, 4.0 and 4.2, EDR and LE support
TC35661–0XX: HCI type
TC35661–XXX: embedded profile type
BT Class 2 support
RX Sensitivity –91dBm (typ.)
Baseband with ARM(R) CPU - 13 to 52 MHz
On–chip ROM, RAM, including Patch–RAM
On–chip balun, antenna switch, LNA, LDO
Interfaces: UART, SPI, USB2.0(FS), I2C, I2S/PCM, GPIO
IEEE802.15.2. 2/3/4 coexistence interface
Data transfer up to 2 Mbps (DH5 packets) net
Package: 64ball BGA (ROM version), 0.5/0.8mm pitch, 1.2/1.4mm height
Operational voltage: 1.8V& or 3.3V (typ.)
Low power sleep mode 30uA (max)
Operation mode well below 30mA (depends on packet-type and selected operational mode)
AEC-Q100 automotive qualification on selected devices (0.8mm pitch)
TC35661 HCI System Concept
The Bluetooth(R) HCI (host controller interface) model: the low layer stack (RF, LC, LM) runs on the TC35661SBG device (ROM or external flash memory).& Through a UART or USB it is connected& to an external host processor, which executes the upper Blueooth(R) stack (L2CAP, RFCOMM) and profiles.
Beyond the upper stack the host processor runs the application software.& This application processor may also run additional tasks such as middleware and multimedia functions.& This concept is suitable for voice and data.
TC35661 Embedded Profile System Concept
The Embedded Profile model integrates both the lower and upper stack as well as some selected profiles in the TC35661SBG (ROM or external flash memory).& The UART interface carries the data of a higher layer API.& The& whole Bluetooth(R) functionaly is managed by the Bluetooth(R) LSI.& The host processor only handles the application data.& Depending on the complexity of the application the host CPU performance requirement can be very minor.& This concept is for data only.& The Embedded Profile models for BT4.0 features Smart Ready (dual mode) or Smart (BLE single mode) Bluetooth(R) marking.
TC35661 Stand Alone System Concept
TC35661 can be run without an additional host MCU for small applications.& The application code gets stored into the attached EEPROM.& After RESET the code is bootloaded into the embedded SRAM of TC35661-7xx/1xx and executed by the Bluetooth processor itself.& This feature is available together with devices containing the Bluetooth stack with embedded SPP profile (-7xx) or HID profile (-1xx) in ROM.& Toshiba uses commercial debugger software to allow evaluation of the application code.
Toshiba Embedded Profile Software Models
TC35661-2XX
Profile API
LC/LMP (v4.0)
with Serial Port Profile (SPP)
for wireless cable replacement
TC35661-5XX
Attribute Profile
LC/LMP (v4.0)
with GATT and SPP profile for BT 4.0
dual mode enabled accessory products
TC35661 Datasheets
·Before creating and producing designs and using, customers must also refer to and comply with the latest versions of all relevant TOSHIBA information and the instructions for the application that Product will be used with or for.
WeChat QR Description
Popup QR Description东芝蓝牙4.0TC (SPP+GATT)设置流程_中华文本库
第1页/共18页
HCI resetM2 message(HCI p.32)M2 message (HCI p.46)Write BD_Addr(HCI p.23)M2 set Deep sleep(HCI p.36)HCI-&Complete(HCI p.24)Init SPP mode(MNG p.6)Setup SPP
(MNG p.33)
Mobile (remote device) call SPP device (local device) (MNG p.26)
(MNG p.24)
第1页/共18页
寻找更多 ""东芝单片机代理商
您当前的位置:
> 东芝单片机代理商
东芝单片机代理商
发货地址:江苏无锡
信息编号:
产品价格:面议
商家相关产品:
商家产品分类
“东芝单片机代理商”详细信息
产品规格:
TMPM330FWFG
产品数量:
22500.00 只
包装说明:
贴片防静电盘装
价格说明:
查看人数:
本页链接:
http://info.b2b168.com/s168-.html
东芝单片机ARM?内核32位微控制器TX00,TX03和TX09系列MCU代理商
全球市场的ARM?内核微控制器与ARM?内核正在成为不仅为手机应用的同时也为通用型的应用越来越普及。除了其TX03系列的ARMCortex?-M3内核,东芝现在提供新产品阵容-TX00的系列,其中结合了的ARMCortex?-M0内核和TX04系列,其中结合了的ARMCortex?-M4F核心。基于由ARM公司制造的CPU核心,该产品组是结合充分利用模拟技术的独特东芝周边功能模块的广谱混合信号控制器。
该TX03系列微控制器嵌入了一个ARM?Cortex?-M3内核,它提供高代码密度和所需的实时应用程序的快速中断响应时间。该TX03系列还采用了东芝独有的NANO FLASH?存储具有高容量和低功耗。TMPM382FSFG 东芝
TMPM372FWUG 东芝
TMPM373FWDUG 东芝
TMPM374FWUG 东芝
TMPM332FWUG 东芝
TMPM333FWFG 东芝
TMPM390FWFG 东芝
TMPM395FWAXBG 东芝
TMPM380FWDFG 东芝
TMPM380FWFG 东芝
TMPM382FWFG 东芝
TMPM366FWFG 东芝
TMPM366FWXBG 东芝
TMPM367FWFG 东芝
TMPM367FWXBG 东芝
TMPM368FWFG 东芝
TMPM368FWXBG 东芝
TMPM370FYDFG 东芝
TMPM370FYFG 东芝
TMPM330FDFG 东芝
TMPM330FYWFG 东芝
TMPM333FYFG 东芝
TMPM377FYDFG 东芝
TMPM377FYFG 东芝
TMPM380FYDFG 东芝
TMPM380FYFG 东芝
TMPM341FYXBG 东芝
TMPM366FYFG 东芝
TMPM366FYXBG 东芝
TMPM367FYFG 东芝
TMPM367FYXBG 东芝
TMPM368FYFG 东芝
TMPM368FYXBG 东芝
TMPM369FYFG 东芝
TMPM369FYXBG 东芝
TMPM333FDFG 东芝
TMPM376FDFG 东芝
TMPM361F10FG 东芝
TMPM363F10FG 东芝
TMPM320C1DFG 东芝
欢迎来到无锡海明威电子科技有限公司网站,我公司位于有布码头、钱码头、窑码头、丝都、米市之称的无锡市。 具体地址是宜兴环保科技园岳阳苑27幢85号502-602室,老板是汤先生。
联系电话是6,联系手机是,,主要经营东芝MCU单片机代理、安华高光耦、村田Murata、罗姆、TDK光耦: TLP2168,TLP627-4,TLP185, TLP127,TLP701,TLP352,TLP108,TLP105,TLP620,MOS管:2SK62,2SK8-O,2SK209-Y,TK6A80E,TK13A60U单片机:TMPM330FWFG(C,TMPM369FDFG现货。
单位注册资金单位注册资金人民币 100 万元以下。
“东芝单片机代理商”相关的客户留言
东芝一级代理商我对贵司产品很感兴趣,请尽快联系我!
<font color="#17-04-12
企业回复:已联系
尼吉康nichicon代理商深圳市麦德信科技有限公司
地址:深圳市南山区软件产业园4栋D座425室
地址:重庆市渝北区龙湖紫都星座A座1318室
联系人:谭先生
传真:010-
<font color="#17-04-25
企业回复:已联系
我要给“东芝单片机代理商”留言
“东芝单片机代理商”联系方式
无锡海明威电子科技有限公司
(销售工程师)
地址:宜兴环保科技园岳阳苑27幢85号502-602室
邮编:214200
网址:http://haiminy.cn.b2b168.com/
“东芝单片机代理商”相关产品,你也可查看该供应商更多
粤ICP备号 - Copyright (C) 2004 - .com All Rights ReservedSTM32驱动TC35661蓝牙作业.作业..|我爱单片机 - 数码之家
查看完整版本: [--
赞助商链接
此方法的大概思路是:将原POS抓到的包整理后,按661返回的数据进行发送,以达到初始化和数据处理的功能.注:思路来至的看到的贴就开始动手完成各项功能.因为手头除了POS机和串口下载器.没有其它工具了.对STM32也是因为POS的购买才开始学的.之前只有C语言,delphi的基础.STM32的串口中断还一点都不了解,又无法调试.就先用delphi写了个用于电脑驱动661的.[attachment=7919328]收到蓝牙04 0E 04 04 00 00 00 ,按&手动发送初始化命令&就可以完成蓝牙的初始化,蓝牙名称:TY右上角可以与手机交换数据(手机发送的中文是UTF-8,常见的串口接收到的都是GB类的.会显示乱码.这个是在delphi里进行转换后才正常显示的)[attachment=7919329]=============接下来是在STM32上实现.硬件部分:蓝牙与串口3连接,因此蓝牙无复位引脚,就将电源接PA14上加以控制串口也显示乱码,则需要按更改以用于12M的晶振[attachment=7919371]主要接口为那一排插针,红黑黄线为用来调试时读取蓝牙和单片机发出来的数据是否达到预定目标. STM32部分:主要的精力花在串口中断处理上.目前功能:初始化蓝牙,配对完成后,可以接收到手机发送的数据. 下图为串口1收到的调试信息[attachment=7919456]未完成功能或有BUG的情部分串口1或单片机发送数据到手机蓝牙会是不是发送类似于11 00 00 e1 47 0a 00 00 5a 08 23 5f a4 f8 06 20 03 的命令到手机.如果此时手机发送数据.则无法正常显示数据.只能重新发送代码比较乱. ========直接上代码 //* Includes ------------------------------------------------------------------*/#include &stm32f10x.h&#include &string.h&#include &stdio.h&#include &stdlib.h&#ifdef __GNUC__&&/* With GCC/RAISONANCE, small printf (option LD Linker-&Libraries-&Small printf&&&& set to &#39;Yes&#39;) calls __io_putchar() */&&#define PUTCHAR_PROTOTYPE int __io_putchar(int ch)#else&&#define PUTCHAR_PROTOTYPE int fputc(int ch, FILE *f)#endif /* __GNUC__ */#define CMDLEN&&51
#define USART_REC_LEN&&&& 255&& //定义最大接收字节数 255#define USART_REC_LEN1&&&& 255&& //定义最大接收字节数 255//#define EN_USART1_RX&&&&1&&//使能(1)/禁止(0)串口1接收//#define CMD_BUFFER_LEN&&&& 200u8&&USART_RX_BUF[USART_REC_LEN]; //接收缓冲,最大USART_REC_LEN个字节.末字节为换行符 u16 USART_RX_STA;&&&&&&&&&& //接收状态标记 u8 iscmd=0;//u16 BTPcmdLen=0 ;//蓝牙串口命令参数长度 u16 BTcmdLen =0;//蓝牙串口命令长度u16 Usart3pos =0;u8 tmp[255];u16 tmpi=0;u8&&USART1_RX_BUF[USART_REC_LEN1]; //接收缓冲,最大USART_REC_LEN个字节.末字节为换行符 u16 USART1_RX_STA;&&&&&&&&&& //接收状态标记 u8 iscmd1=0; u32 testu3, const char cmd[][300]={&01030C00&, &ADFF00&, &1E4132B8&, &0C&, &081F&, &08FC8E00AFF30B5F94DB1CC0A69DBDAE3FE4CFBD136F07EFCCEFBF936F07BFC041CE348EB1C038BC28A0&, &08FC8E00AFF55FE03B030BC08BCD64CD997E291EDCF6FDA868D14BC00E9ACCF013FBF8BC08BCCF82F5E7CA&, &08FC8E00AFF046A245EF77B54B37F004F9B44BC8182DCDD6C90E36F05BFA041C011CC4FDA74BC00E9AA3F0C3FAB1E729F099FDAEE770B501&, &08FC8E00AFF994DA15D0AFD62A3FDEC02336F0DBFEECCFE70BC08BCC00ECF067FCA018AC1E22C1&, &08FC8E00AFFB2FEDCD2D8E729F049FDD5E7F0B983B2A73DFFF7E1FEC27E002A13DAF0D1FD03B0F0BC08BCA885D4E002A51D001&, &08FC8E00AFFD21A654BA6B2D90E1C0F232EF042FD36F0C7F036F0EDFCBAC906C90E3B1C8B0D00FF031CCAF001&, &08FC8E00AFF7BFDCCE087E057EC1C00232EF0FDFC36F082F036F0A8FCAAC906C90E3B1C8B0D00FF83AF03DFD686801&, &08FC8E00AFFA042FBD136F0D9FACEF836F0D6FA041CCBC28A0FC49EE70A00DB001&, &08FC8E00AFF0400ACEEBB07ACCEE1AE729F03CFC17E710B51C4CC07AFFF7DAFD10BC08BC4E041CD0FFD051C391C201CF0F784FEAABC01&, &08FC8E00AFFCF1CF0F770FEAAEDB007FFEE000001&, &08FC2F00AFFDB007FF0001&, &08FC0B00AFFFCFC&, &08FCA0001&, &08FC1C00AFF0C0001&, &08FC1C00AFFB0A&, &08FC&, &33380D&, &40E&, &01C0CE&, &01E0C&, &12&, &&, &07&, &F0100010A&, &020A180D&, &A1A&, &A000D&, &A19&, &0D&, &A19&, &6C4E6F0001000D&, &A19&, &12&, &&, &AF9FA98FE54A7DFEB&, &B7234BEECD4A8F3491F&, &B7234BEECD4A8F00D&, &FF11&, &FFD&, &FF11&, &FFB&, &BAD94B4D1EF&, &47C62361BAD94B4D1E&, &&, &00356&, &2B20AC& &&&&&& }; char cmdBT[][300]={&&,&&, &1F005A07E951B7D53213&,//5A0为手机地址 &C002BFA4F8010003&,//5A0为手机地址 &DA0&};char BTaddress[16]={&&};char buffer[3];&&&&&& /* Private function prototypes -----------------------------------------------*/void GPIO_Configuration(void);void USART_Configuration(void);void UART_PutStr(USART_TypeDef* USARTx, uint8_t *str);void sendHCLcmd(void);void uart3_init(u32 bound);void Delay(u32 count) {&&u32 i=0;&&for(;i&i++); } u8 hexstrtochar(char *strin){ u8 i,k,k1; //取得高低两位字符,如&FE& k=48; k1=48; if (strin[0]&=&#39;A&#39; && strin[0] &= &#39;F&#39;)&&k=55; if (strin[1]&=&#39;A&#39; && strin[1] &= &#39;F&#39;)&&k1=55; i = ((strin[0]-k)&&4)+(strin[1]-k1);}char * inttohex(int aa) {
&&&&if (aa / 16 & 10)&& //计算十位,并转换成字符&&&&&&&&&&buffer[0] = aa / 16 + &#39;0&#39;; &&&&else &&&&&&&&buffer[0] = aa / 16 - 10 + &#39;A&#39;; &&&&if (aa % 16 & 10)&& //计算个位,并转换成字符 &&&&&&&&buffer[1] = aa % 16 + &#39;0&#39;; &&&&else &&&&&&&&buffer[1] = aa % 16 - 10 + &#39;A&#39;; &&&&buffer[2] = &#39;\0&#39;;&& //字符串结束标志 &&&&return (buffer); } int sendstrcmd(const char *strin){ u32 n,i; char *stmp=NULL; char *p; //const char *p1; char sa[2]; //1.取得字符串中 十六进制的个数( 十六进制之前用空格隔开
n = strlen(strin); //2.动态分配数组用于存放 stmp = (char*)calloc(n/2,sizeof(char)); //进行转换 p = for(i=0;i&n;i+=2) {&&//取得一组&&sa[0]=strin;&&sa[1]=strin[i+1];&&*p=hexstrtochar(sa);&&p++; }//发送命令 p= USART_ClearFlag(USART3,USART_FLAG_TC); for(i=0;i&(n/2);i++) {&&USART_SendData(USART3, (uint8_t) *p);&&p++;&&while (USART_GetFlagStatus(USART3, USART_FLAG_TC) == RESET)&&{}
} /*&& p= USART_ClearFlag(USART1,USART_FLAG_TC); for(i=0;i&(n/2);i++) {&&USART_SendData(USART1, (uint8_t) *p);&&p++;&&while (USART_GetFlagStatus(USART1, USART_FLAG_TC) == RESET)&&{}
}*/// printf(&\r\n{%s}-------[%d]\r\n&,strin,n/2); free(stmp); stmp=NULL; return n/2; }void getData(){ sendHCLcmd(); }void sendHCLcmd(void){ for(i=0;i&CMDLEN;i++) {&&sendstrcmd(cmd);&&Delay(1000000);
} }void USART1con(){&&&&if(iscmd1==1)&&&&{&&&& printf(&BT is OFF\r\n&);&&&& GPIO_ResetBits(GPIOA,GPIO_Pin_14);&&&& Delay(500000);&&&& printf(&BT is ON\r\n&);&&&& GPIO_SetBits(GPIOA,GPIO_Pin_14);&&&& iscmd1 = 0;&&&& USART1_RX_STA=0;&&&&} &&&&if(iscmd1==2)&&&&{&&&& sendHCLcmd();&&&& iscmd1 = 0;&&&& USART1_RX_STA=0;&&&&}&&&& if(iscmd1==3)&&&&{&&&& Delay(800000);&&&& sendstrcmd(cmdBT[2]);&&&& Delay(800000);&&&& sendstrcmd(cmdBT[3]);&&&& Delay(800000);&&&& sendstrcmd(cmdBT[4]);&&&& iscmd1 = 0;&&&& USART1_RX_STA=0;&&&&} &&&&if( testu3&0)&&&&{&&&& printf(&串口%d进入中断,返回0x[%02x]\r\n&,testu3,testu);&&&& if( testu3==1)&&&&&&printf(&串口1返回%02x %02x %02x %02x \r\n&,USART1_RX_BUF[0],USART1_RX_BUF[1],USART1_RX_BUF[2],USART1_RX_BUF[3]);&&&& if(testu3==3)&&&&&&printf(&串口3返回%02x %02x %02x %02x \r\n&,USART_RX_BUF[0],USART_RX_BUF[1],USART_RX_BUF[2],USART_RX_BUF[3]); &&&& testu3=0;&&&& USART_RX_STA =0;&&&& USART1_RX_STA=0;&&&&} }void BTcon(){ int i,n; char *&&&& if(iscmd==1) {&&sendHCLcmd();&&printf(&初始化蓝牙成功\r\n&);&&iscmd =0;&&USART_RX_STA=0; }//if(iscmd==1) /* if(iscmd==2)//取得返回数据中的手机地址[命令的第16个字符开始 {&&n=16; &&for(i=0;i&6;i++)//修改蓝牙地址&&{&& strp = inttohex(USART_RX_BUF[USART_RX_STA-6+i]);&& cmdBT[2][n] = strp[0]; && cmdBT[2][n+1] = strp[1];&& n++;n++;&&}&&for(i=0;i&13;i++)&&{&& BTaddress= cmdBT[2][16+i];&&}&&Delay(100000);&&sendstrcmd(cmdBT[2]);&&for(i=0;i&13;i++)&&{&& cmdBT[3][18+i] =BTaddress; &&} &&Delay();&&sendstrcmd(cmdBT[3]);&&for(i=0;i&13;i++)&&{&& cmdBT[4][19+i] =BTaddress; &&}&&Delay();&&sendstrcmd(cmdBT[4]);&&iscmd =0;&&USART_RX_STA=0; }//if(iscmd==2)
if(iscmd==3) {&&printf(&\r\n进入iscmd==3\r\n&);&&for(i=0;i&13;i++)&&{&& cmdBT[3][19+i] =BTaddress; &&}&&Delay(100000);&&sendstrcmd(cmdBT[3]);&&Delay(1000000);&&sendstrcmd(cmdBT[4]); &&iscmd =0;&&USART_RX_STA=0;
if(iscmd==5) {&& cmdBT[3][14+i] =BTaddress;&& printf(&%s\r\n&,cmdBT[3]);&&printf(&%d\r\n&,iscmd);//&&printf(&0000%s\r\n&,USART_RX_BUF);&&if(USART_RX_BUF[USART_RX_STA]==0x00)&& printf(&%s\r\n&,&配对成功,0x00&);&&if(USART_RX_BUF[USART_RX_STA]==0x01)&& printf(&%s\r\n&,&配对成功,0x01&);&&if(USART_RX_BUF[USART_RX_STA]==0x02)&& printf(&%s\r\n&,&配对失败,0x02&); &&iscmd =0;&&USART_RX_STA=0; }//if(iscmd==5) */ if(iscmd==88) {&&printf(&接收到命令:&);&&for(i=0;i&BTcmdLi++)&&{&& printf(&%02x &,tmp);&&}&&printf(&\r\n&); &&//有配对请求&&if(tmp[3]==0xE1 &&tmp[4]==0x55)&&{&& //取得配对手机的MAC地址&& n=16;&& for(i=0;i&6;i++)//修改蓝牙地址&& {&&&&strp = inttohex(tmp[i+7]);&&&&cmdBT[2][n] = strp[0];&&&&cmdBT[2][n+1] = strp[1];&&&&n++;n++;&& }&& for(i=0;i&13;i++)//取得的手机MAC地址单独保存&& {&&&&BTaddress= cmdBT[2][16+i];&& }&&&& Delay(100000);&& sendstrcmd(cmdBT[2]);//配对应答&& printf(&发送应答:%s\r\n&,cmdBT[2]);&&}&&//&&if(tmp[3]==0xE1 &&tmp[4]==0x7D &&tmp[5]==0x08)&&{&&&&for(i=0;i&12;i++) cmdBT[3][18+i] =BTaddress; //修改MAC地址
&&&&Delay(100000);&&&&sendstrcmd(cmdBT[3]);&& printf(&握手:%s\r\n&,cmdBT[3]); &&&&for(i=0;i&12;i++) cmdBT[4][20+i] =BTaddress; //修改MAC地址 &&&&Delay();&&&&sendstrcmd(cmdBT[4]);&& printf(&握手2:%s\r\n&,cmdBT[4]);&&} &&if(tmp[0]==0x0F && tmp[3]==0xE1 &&tmp[4]==0x47 &&tmp[15]==0x02)&&{&& printf(&配对成功\r\n&);&&} &&//接收数据&&if(tmp[3]==0xE5 &&tmp[4]==0x48)&&{&& for(i=9;i&BTcmdLi++)&& {&&&&printf(&%c&,tmp);&& }&& printf(&\r\n&);&&}
&&BTcmdLen=0;&&iscmd =0;&&USART_RX_STA=0; }}int main(void){&&GPIO_Configuration(); USART_Configuration(); uart3_init(115200); GPIO_SetBits(GPIOA,GPIO_Pin_14);//蓝牙供电,蓝牙电源接在PA14脚上. GPIO_SetBits(GPIOA,GPIO_Pin_0);//发送指示灯,未使用 printf(&*****************************************\r\n&); printf(&**&&&&&&&&&&发送0x3F 0x0a SendHCICMD&& **\r\n&); printf(&**&&&&&&&&&& 661SBGBT test&&&&&&&&&&&& **\r\n&); printf(&**&&&&&&&&&&发送0x3D 0x0a RestBT&&&&&& **\r\n&); printf(&**&&&&&&&&&&发送0x30 0x0a&&&& 连接&&&& **\r\n&); printf(&*****************************************\r\n&); while (1)&& { //&& USART1con();//与串口1的命令与数据处理&& BTcon();//与蓝牙(串口3)命令与数据的处理&& }}void USART1_IRQHandler() {
u8&&&& if(USART_GetITStatus(USART1,USART_IT_RXNE) != RESET) //中断产生 &&&& { &&&&&& res = USART_ReceiveData(USART1);&&&&testu =&&&&USART1_RX_BUF[USART1_RX_STA]=&&&&if (USART1_RX_STA&2) &&&&{&&&&testu3=1; &&&&}&&&&if(USART1_RX_BUF[USART1_RX_STA-1]==0x3D&&USART1_RX_BUF[USART1_RX_STA]==0x0A)&&&&{ &&&& iscmd1=1;//缓存如发现命令即读取..&&&&// printf(&iscmd1&);&&&&}&&&&if(USART1_RX_BUF[USART1_RX_STA-1]==0x3F&&USART1_RX_BUF[USART1_RX_STA]==0x0A)&&&&{ &&&& iscmd1=2;//缓存如发现命令即读取..&&&&// printf(&iscmd1&);&&&&}&&&&if(USART1_RX_BUF[USART1_RX_STA-1]==0x30&&USART1_RX_BUF[USART1_RX_STA]==0x0A)&&&&{ &&&& iscmd1=3;//缓存如发现命令即读取..&&&&// printf(&iscmd1&);&&&&} &&&&USART1_RX_STA++; &&&&&&&&USART1_RX_STA &= 0x3F; //判断是否计数到最大
&&&&&&} &&&& if(USART_GetFlagStatus(USART1,USART_FLAG_ORE) == SET) //溢出 &&&&&&{ &&&&&&&&&&USART_ClearFlag(USART1,USART_FLAG_ORE); //读SR &&&&&&&&&&USART_ReceiveData(USART1); //读DR &&&&&& }
}void USART3_IRQHandler() {
u8 int i,j;&&&& if(USART_GetITStatus(USART3,USART_IT_RXNE) != RESET) //中断产生 &&&& { &&&&&&&&res = USART_ReceiveData(USART3);&&&&testu =&&&&USART_RX_BUF[USART_RX_STA]=//将收到的字符都存入 &&&&if(USART_RX_BUF[USART_RX_STA-6]==0x04&&USART_RX_BUF[USART_RX_STA-5]==0x0E&&USART_RX_BUF[USART_RX_STA-4]==0x04)&&&&{&&&& iscmd=1;//缓存如发现命令即读取..&&&&}&&&&&&&&//如果发现有命令数据,则交由主程序处理&&&& 这里开始&&&&//命令1:总长+00+00+E1+参数类型+参数总长+00+数据&&&&if(USART_RX_BUF[USART_RX_STA-5]==0x00 && USART_RX_BUF[USART_RX_STA-4]==0x00 && &&&& (USART_RX_BUF[USART_RX_STA-3]==0xE1 ||USART_RX_BUF[USART_RX_STA-3]==0xE5))&&&&{&&&& //此时还未收到数据.需等由到数据后交由主程序处理&&&& //取得命令的长度&&&& BTcmdLen=USART_RX_BUF[USART_RX_STA-6];&&&&Usart3pos = BTcmdLen+ USART_RX_STA-7;&&&&}&&&&if(USART_RX_STA==Usart3pos)//等待数据接收完成&&&&{&&&& j=USART_RX_STA-BTcmdL&&&& for(i=0;i&BTcmdLi++)&&&& tmp=USART_RX_BUF[j+i+1];&&&&iscmd=88;&&&& USART_RX_STA = 0;&&&&}&&&&&&&&USART_RX_STA++; &&&&//计数器达到最大后的处理&&&&&& // USART_RX_STA &= 0x3F; //判断是否计数到最大
&&&&&&} &&&& if(USART_GetFlagStatus(USART3,USART_FLAG_ORE) == SET) //溢出 &&&&&&{ &&&&&&&&&&USART_ClearFlag(USART3,USART_FLAG_ORE); //读SR &&&&&&&&&&USART_ReceiveData(USART3); //读DR &&&&&& }
}/******************************************************************************** Function Name&&: GPIO_Configuration* Description&&&&: Configure GPIO Pin* Input&&&&&&&&&&: None* Output&&&&&&&& : None* Return&&&&&&&& : None* Attention&& : None*******************************************************************************/void GPIO_Configuration(void){&&GPIO_InitTypeDef GPIO_InitS
RCC_APB2PeriphClockCmd(RCC_APB2Periph_AFIO,ENABLE);//打开复用时钟&&RCC_APB2PeriphClockCmd( RCC_APB2Periph_GPIOA|RCC_APB2Periph_GPIOB|RCC_APB2Periph_GPIOC , ENABLE);&& GPIO_PinRemapConfig(GPIO_Remap_SWJ_Disable,ENABLE);//关闭重映射JTAG. /** *&&LED1 -& PF6 , LED2 -& PF7 , LED3 -& PF8 , LED4 -& PF9 */&&&&&&&&GPIO_InitStructure.GPIO_Pin =&&GPIO_Pin_4;&&GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;&&GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP; &&GPIO_Init(GPIOB, &GPIO_InitStructure); &&GPIO_InitStructure.GPIO_Pin =&&GPIO_Pin_0;&&GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;&&GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP; &&GPIO_Init(GPIOA, &GPIO_InitStructure); &&GPIO_InitStructure.GPIO_Pin =&&GPIO_Pin_14;&&GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;&&GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP; &&GPIO_Init(GPIOA, &GPIO_InitStructure);
}void uart3_init(u32 bound){&&&&//GPIO端口设置&&&&GPIO_InitTypeDef GPIO_InitS USART_InitTypeDef USART_InitS NVIC_InitTypeDef NVIC_InitS
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB, ENABLE); //使能GPIOB时钟 RCC_APB1PeriphClockCmd(RCC_APB1Periph_USART3, ENABLE); //使能USART3时钟&&RCC_APB2PeriphClockCmd(RCC_APB2Periph_AFIO,ENABLE);//打开复用时钟&&GPIO_PinRemapConfig(GPIO_Remap_SWJ_Disable,ENABLE);//关闭重映射JTAG.&&&& //USART3_TX&& PB10&&&&GPIO_InitStructure.GPIO_Pin = GPIO_Pin_10; //PB10&&&&GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;&&&&GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP; //复用推挽输出&&&&GPIO_Init(GPIOB, &GPIO_InitStructure); &&&&//USART3_RX&& PB11&&&&GPIO_InitStructure.GPIO_Pin = GPIO_Pin_11;&&&&GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING;//浮空输入&&&&GPIO_Init(GPIOB, &GPIO_InitStructure);&&&& //Usart3 NVIC 配置&&&&NVIC_InitStructure.NVIC_IRQChannel = USART3_IRQn; NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority=3 ;//抢占优先级3 NVIC_InitStructure.NVIC_IRQChannelSubPriority = 3;&&//子优先级3 NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;&& //IRQ通道使能 NVIC_Init(&NVIC_InitStructure); //根据指定的参数初始化VIC寄存器 && //USART 初始化设置 USART_InitStructure.USART_BaudRate =//一般设置为9600; USART_InitStructure.USART_WordLength = USART_WordLength_8b;//字长为8位数据格式 USART_InitStructure.USART_StopBits = USART_StopBits_1;//一个停止位 USART_InitStructure.USART_Parity = USART_Parity_No;//无奇偶校验位 USART_InitStructure.USART_HardwareFlowControl = USART_HardwareFlowControl_N//无硬件数据流控制 USART_InitStructure.USART_Mode = USART_Mode_Rx | USART_Mode_Tx; //收发模式&&&&USART_Init(USART3, &USART_InitStructure); //初始化串口&&&&USART_ITConfig(USART3, USART_IT_RXNE, ENABLE);//开启中断&&&&USART_Cmd(USART3, ENABLE);&&&&&&&&&&&&&&&&&&&&//使能串口 }/******************************************************************************** Function Name&&: USART_Configuration* Description&&&&: Configure USART1 * Input&&&&&&&&&&: None* Output&&&&&&&& : None* Return&&&&&&&& : None* Attention&& : None*******************************************************************************/void USART_Configuration(void){ &&GPIO_InitTypeDef GPIO_InitS&&USART_InitTypeDef USART_InitS
NVIC_InitTypeDef NVIC_InitS &&RCC_APB2PeriphClockCmd( RCC_APB2Periph_GPIOA | RCC_APB2Periph_USART1,ENABLE);&&/*&&*&&USART1_TX -& PA9 , USART1_RX -& PA10&&*/&&&&&&GPIO_InitStructure.GPIO_Pin = GPIO_Pin_9;&&&&&&&&&&&&GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP;&&&&GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;&&GPIO_Init(GPIOA, &GPIO_InitStructure);&&&&&& GPIO_InitStructure.GPIO_Pin = GPIO_Pin_10;&&&&&&&& &&GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING;&&&&GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; &&GPIO_Init(GPIOA, &GPIO_InitStructure);&&&&//Usart1 NVIC 配置&&&&NVIC_InitStructure.NVIC_IRQChannel = USART1_IRQn; NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority=3 ;//抢占优先级3 NVIC_InitStructure.NVIC_IRQChannelSubPriority = 3;&&//子优先级3 NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;&& //IRQ通道使能 NVIC_Init(&NVIC_InitStructure); //根据指定的参数初始化VIC寄存器
&&USART_InitStructure.USART_BaudRate = 115200;&&USART_InitStructure.USART_WordLength = USART_WordLength_8b;&&USART_InitStructure.USART_StopBits = USART_StopBits_1;&&USART_InitStructure.USART_Parity = USART_Parity_No;&&USART_InitStructure.USART_HardwareFlowControl = USART_HardwareFlowControl_N&&USART_InitStructure.USART_Mode = USART_Mode_Rx | USART_Mode_Tx;&&USART_Init(USART1, &USART_InitStructure); &&USART_ITConfig(USART1, USART_IT_RXNE, ENABLE);&&//USART_ITConfig(USART1, USART_IT_TXE, ENABLE);&&USART_Cmd(USART1, ENABLE);}/**&&* &&&&Retargets the C library printf function to the USART.&&* @param&&None&&* @retval None&&*/PUTCHAR_PROTOTYPE{&&/* Place your implementation of fputc here */&&/* e.g. write a character to the USART */&&USART_SendData(USART1, (uint8_t) ch);&&/* Loop until the end of transmission */&&while (USART_GetFlagStatus(USART1, USART_FLAG_TC) == RESET)&&{}&&}#ifdef&&USE_FULL_ASSERT/**&&* &&&&Reports the name of the source file and the source line number&&*&& where the assert_param error has occurred.&&* @param&&file: pointer to the source file name&&* @param&&line: assert_param error line source number&&* @retval None&&*/void assert_failed(uint8_t* file, uint32_t line){ &&/* User can add his own implementation to report the file name and line number,&&&& ex: printf(&Wrong parameters value: file %s on line %d\r\n&, file, line) */&&/* Infinite loop */&&while (1)&&{&&}}#endif/*********************************************************************************************************&&&&&&END FILE*********************************************************************************************************/
赞助商链接
非常谢谢,正需要
赞助商链接
抢个二楼玩玩。
方法不错,支持了
支持下 这下有玩头了
程序有一个地方需要优化,就是那一堆初始化指令。用软把初始化数据都编程0xzz ,同时建立一个数组,记录每组命令的长度,比如“12 33 44 55 66 ab cd ef 第二组数据.............”变成command{0x12,0x33,0x44,0x55,0x66,0xab,0xcd,0xef,第二组数据.......};command_lengt{0x08,第二组长度..............}发送的时候,用一个函数 发送(数组起始地址,长度);发送的时候,第一组:&command[0] ,,长度8个,第二组就是: &command[8],第二组长度程序flash大小可以变成现在的1/3
:程序有一个地方需要优化,就是那一堆初始化指令。用软把初始化数据都编程0xzz ,同时建立一个数组,记录每组命令的长度,比如“12 33 44 55 66 ab cd ef 第二组数据.............”变成.......&( 19:36)&嗯,最先的思路是这样,但要人工处理60多条,总感觉好麻烦,就直接这样了。不过以0x存放,在之后的各项处理会轻松很多,不用转来转去。
拜大神。。。。。。。。。。。。。。。。。。。。。。字数泥煤
:嗯,最先的思路是这样,但要人工处理60多条,总感觉好麻烦,就直接这样了。不过以0x存放,在之后的各项处理会轻松很多,不用转来转去。
uint8_t command_Cont[]={&&&&0x01, 0x03, 0x0C, 0x00,//OpCode=0c03==&OGF(0x0c&&2)03,, 0xOCF:03, 0xReset, 0xCommand&&&&0x01, 0x08, 0xFC, 0x09, 0x00, 0xA1, 0x00, 0x00, 0x00, 0x14, 0x0C, 0xFF, 0x00,//M2Message_Get, 0xcommand&&&&0x01, 0x13, 0x10, 0x06, 0x24, 0x5F, 0x22, 0xB8, 0x64, 0xDC,//[OpCode=0x1013]==&ogf=(0x10&&2)=0x04,ocf=0x13, 0x, 0xHCI_WRITE_BD_ADDR&&&&//0x01, 0x08, 0xFC, 0x03, 0x00, 0x93, 0xFF,//HCI_UART_RTSCTS_Control&&&&//0x01, 0x08, 0xFC, 0x2F, 0x00, 0xA0, 0x00, 0x00, 0x00, 0x14, 0x55, 0xFF, 0x10, 0x25, 0x00, 0x38, 0xF8, 0x0C, 0x00, 0x05, 0x32, 0x87, 0xF7, 0xE1, 0xFC, 0x00, 0x28, 0x79, 0xD0, 0x13, 0x28, 0x1A, 0xD0, 0x08, 0x4C, 0x2F, 0x25, 0x61, 0x68, 0x6D, 0x01, 0x49, 0x19, 0x89, 0x7D, 0x00, 0x29, 0x6F, 0xD1, 0x02, 0x1C,//M2_BTL_PATCH_SWAP_BASE, 0xcommand, 0x&&&&//0x01, 0x08, 0xFC, 0xFA, 0x00, 0xA0, 0x00, 0x00, 0x00, 0x14, 0x56, 0xFF, 0x10, 0xF0, 0x00, 0x72, 0x05, 0x00, 0xFF, 0xB5, 0x91, 0xB0, 0x00, 0x20, 0x01, 0x23, 0x0F, 0x90, 0x11, 0x1C, 0x05, 0x93, 0x1C, 0x9A, 0x00, 0x23, 0x0D, 0x90, 0x03, 0x93, 0x00, 0x93, 0x07, 0x90, 0x06, 0x90, 0x10, 0x70, 0x99, 0x4A, 0x2F, 0x23, 0x12, 0x68, 0x5B, 0x01, 0xD2, 0x18, 0x90, 0x75, 0x11, 0xA8, 0x05, 0xC8, 0x00, 0x27, 0x00, 0x26, 0x00, 0x25, 0x90, 0x42, 0x02, 0xD8, 0x11, 0x98, 0x00, 0x28, 0x07, 0xD1, 0x11, 0x98, 0x1B, 0x9A, 0x10, 0x80, 0x01, 0x20, 0x15, 0xB0, 0xF0, 0xBC, 0x08, 0xBC, 0x18, 0x47, 0x14, 0x98, 0x02, 0x28, 0x05, 0xD1, 0x48, 0x78, 0x09, 0x78, 0x00, 0x02, 0x08, 0x43, 0x06, 0x1C, 0x06, 0xE0, 0x14, 0x98, 0x10, 0x28, 0x0D, 0xD1, 0x10, 0x22, 0x08, 0xA8, 0xF1, 0xF7, 0xE1, 0xFF, 0x0F, 0x21, 0x07, 0x20, 0x0E, 0x90, 0x10, 0x91, 0x77, 0xF0, 0x88, 0xFF, 0xFF, 0x28, 0x03, 0xD1, 0x0E, 0x20, 0xE1, 0xE7, 0x04, 0x20, 0xDF, 0xE7, 0x6E, 0xF0, 0xCC, 0xFA, 0x02, 0x90, 0x0F, 0x99, 0xCA, 0xE0, 0x0D, 0x98, 0x44, 0x23, 0x7C, 0x49, 0x58, 0x43, 0x40, 0x18, 0x0C, 0x99, 0xC9, 0x00, 0x44, 0x58, 0x40, 0x18, 0x04, 0x90, 0xB8, 0xE0, 0x14, 0x98, 0xA2, 0x7C, 0x10, 0x28, 0x08, 0xD1, 0x10, 0x2A, 0x11, 0xD1, 0xA1, 0x1C, 0x08, 0xA8, 0xF1, 0xF7, 0x8F, 0xFF, 0x00, 0x06, 0x00, 0x0E, 0x09, 0xE0, 0x14, 0x98, 0x02, 0x28, 0x07, 0xD1, 0x02, 0x2A, 0x05, 0xD1, 0x61, 0x88, 0x01, 0x20, 0xB1, 0x42, 0x00, 0xD1, 0x00, 0x20, 0x05, 0x90, 0x05, 0x98, 0x00, 0x28, 0x71, 0xD1, 0x20, 0x88, 0x11, 0x99, 0x88, 0x42, 0x6D, 0xD3, 0x12, 0x99, 0x88, 0x42, 0x6A, 0xD8, 0x06, 0x90,//M2_BTL_PATCH_SWAP_PROG_WRITE, 0xcommand&&&&//0x01, 0x08, 0xFC, 0xFA, 0x00, 0xA0, 0x00, 0x00, 0x00, 0x14, 0x56, 0xFF, 0x10, 0xF0, 0xEC, 0x72, 0x05, 0x00, 0xE0, 0x8A, 0x07, 0x99, 0x02, 0x30, 0x00, 0x06, 0x00, 0x0E, 0x00, 0x29, 0x05, 0xD1, 0x62, 0x49, 0x2F, 0x22, 0x09, 0x68, 0x52, 0x01, 0x89, 0x18, 0x08, 0x76, 0x61, 0x48, 0x86, 0x42, 0x08, 0xD0, 0x01, 0x30, 0x86, 0x42, 0x05, 0xD0, 0x02, 0x38, 0x86, 0x42, 0x02, 0xD0, 0x01, 0x38, 0x86, 0x42, 0x22, 0xD1, 0x14, 0x98, 0x02, 0x28, 0x1F, 0xD1, 0x01, 0x20, 0x00, 0x2F, 0x00, 0x90, 0x04, 0xD1, 0xE0, 0x8A, 0x01, 0x27, 0x01, 0x06, 0x09, 0x0E, 0x03, 0x91, 0xE0, 0x8A, 0x03, 0x99, 0x88, 0x42, 0x09, 0xD1, 0x51, 0x48, 0x01, 0x68, 0x2F, 0x20, 0x40, 0x01, 0x08, 0x18, 0x82, 0x7D, 0x02, 0x32, 0x40, 0x2A, 0x6C, 0xD8, 0x4B, 0xE0, 0x4C, 0x48, 0x2F, 0x22, 0x00, 0x68, 0x52, 0x01, 0x80, 0x18, 0x80, 0x7D, 0x00, 0x28, 0x63, 0xD1, 0x83, 0xE0, 0x02, 0x99, 0x20, 0x1C, 0x77, 0xF0, 0xC3, 0xFE, 0x01, 0x90, 0x77, 0xF0, 0xAE, 0xFE, 0x01, 0x99, 0x23, 0x29, 0x06, 0xD0, 0x07, 0x99, 0x00, 0x29, 0x7E, 0xD1, 0x21, 0x88, 0x1B, 0x9A, 0x11, 0x80, 0x5F, 0xE7, 0x6B, 0x46, 0x18, 0x8B, 0x21, 0x88, 0x00, 0x09, 0x00, 0x01, 0x08, 0x1A, 0x01, 0x28, 0x06, 0xDD, 0xA0, 0x8A, 0xC0, 0x07, 0x12, 0xD1, 0x07, 0x98, 0x00, 0x28, 0x6C, 0xD1, 0x08, 0xE0, 0x04, 0x98, 0x00, 0x68, 0x80, 0x69, 0x00, 0x78, 0x80, 0x07, 0x08, 0xD4, 0x07, 0x98, 0x00, 0x28, 0x62, 0xD1, 0x20, 0x88, 0x1B, 0x9A, 0x10, 0x80, 0x02, 0x20, 0x42, 0xE7, 0x27, 0xE0, 0x00, 0x2F, 0x04, 0xD1, 0xE0, 0x8A, 0x01, 0x27, 0x01, 0x06, 0x09, 0x0E, 0x03, 0x91, 0xE0, 0x8A, 0x03, 0x99, 0x88, 0x42, 0x2A, 0xD1,//M2_BTL_PATCH_SWAP_PROG_WRITE, 0xcommand&&&&//0x01, 0x08, 0xFC, 0xC6, 0x00, 0xA0, 0x00, 0x00, 0x00, 0x14, 0x56, 0xFF, 0x10, 0xBC, 0xD8, 0x73, 0x05, 0x00, 0x2A, 0x48, 0x01, 0x68, 0x2F, 0x20, 0x40, 0x01, 0x08, 0x18, 0x82, 0x7D, 0x02, 0x32, 0x40, 0x2A, 0x48, 0xD8, 0x49, 0x19, 0x0B, 0x22, 0xD2, 0x01, 0x89, 0x18, 0x6B, 0x46, 0x1A, 0x7E, 0x0B, 0x1C, 0x20, 0x33, 0x9A, 0x75, 0x6B, 0x46, 0x5A, 0x7E, 0x0B, 0x1C, 0x20, 0x33, 0xDA, 0x75, 0x81, 0x7D, 0x02, 0x35, 0x2D, 0x06, 0x2D, 0x0E, 0x02, 0x31, 0x81, 0x75, 0x01, 0x20, 0x05, 0x90, 0xE4, 0x69, 0x00, 0x2C, 0x00, 0xD0, 0x43, 0xE7, 0x0C, 0x99, 0x01, 0x31, 0x09, 0x06, 0x09, 0x0E, 0x0C, 0x91, 0x0A, 0xE0, 0x29, 0xE0, 0x26, 0xE0, 0x15, 0x48, 0x2F, 0x22, 0x00, 0x68, 0x52, 0x01, 0x80, 0x18, 0x80, 0x7D, 0x00, 0x28, 0x1E, 0xD1, 0x15, 0xE0, 0x0E, 0x98, 0x0C, 0x99, 0x81, 0x42, 0x00, 0xD8, 0x22, 0xE7, 0x0D, 0x98, 0x10, 0x99, 0x01, 0x30, 0x00, 0x06, 0x00, 0x0E, 0x88, 0x42, 0x0D, 0x90, 0x00, 0xD8, 0x17, 0xE7, 0x09, 0x48, 0x2F, 0x22, 0x00, 0x68, 0x52, 0x01, 0x80, 0x18, 0x80, 0x7D, 0x00, 0x28, 0x04, 0xD1, 0x11, 0x98, 0x1B, 0x9A, 0x10, 0x80, 0x0A, 0x20, 0xE7, 0xE6, 0x00, 0x98, 0x00, 0x28, 0x01, 0xD1, 0x00, 0x20, 0xE2, 0xE6, 0x13, 0x20, 0xE0, 0xE6, 0xBC, 0x5C, 0x04, 0x00, 0x00, 0x63, 0x04, 0x00, 0x02, 0x28, 0x00, 0x00,//, 0xMM2_BTL_PATCH_SWAP_PROG_WRITE, 0x, 0xcommand, 0x&&&&//0x01, 0x08, 0xFC, 0x0B, 0x00, 0xA0, 0x00, 0x00, 0x00, 0x14, 0x57, 0xFF, 0x02, 0x00, 0x01,//M2_BTL_PATCH_CONTROL, 0xcommand, 0x&&&&//0x01, 0x08, 0xFC, 0x2F, 0x00, 0xA0, 0x00, 0x00, 0x00, 0x14, 0x55, 0xFF, 0x10, 0x25, 0x01, 0x34, 0x6E, 0x0D, 0x00, 0x0F, 0x20, 0x06, 0x90, 0xF8, 0xF7, 0xA7, 0xF9, 0xFF, 0x28, 0x01, 0xD1, 0x0E, 0x20, 0xE5, 0xE7, 0xEE, 0xF7, 0xED, 0xFC, 0x44, 0x20, 0x9D, 0x4A, 0x78, 0x43, 0x10, 0x58, 0x00, 0x28, 0x01, 0xD1,//M2_BTL_PATCH_SWAP_BASE, 0xcommand, 0x&&&&//0x01, 0x08, 0xFC, 0x0B, 0x00, 0xA0, 0x00, 0x00, 0x00, 0x14, 0x57, 0xFF, 0x02, 0x01, 0x01,//M2_BTL_PATCH_CONTROL, 0xcommand, 0x&&&&//0x01, 0x08, 0xFC, 0x2F, 0x00, 0xA0, 0x00, 0x00, 0x00, 0x14, 0x55, 0xFF, 0x10, 0x25, 0x02, 0x94, 0x71, 0x0D, 0x00, 0x08, 0x9A, 0x10, 0x2A, 0x01, 0xD3, 0x0F, 0x22, 0x08, 0x92, 0x07, 0x22, 0x06, 0x92, 0x64, 0xE0, 0x07, 0x9A, 0x5A, 0xE0, 0x0A, 0x99, 0x44, 0x23, 0xC9, 0x4A, 0x59, 0x43, 0x89, 0x18, 0x09, 0x9A,//M2_BTL_PATCH_SWAP_BASE, 0xcommand, 0x&&&&//0x01, 0x08, 0xFC, 0x0B, 0x00, 0xA0, 0x00, 0x00, 0x00, 0x14, 0x57, 0xFF, 0x02, 0x02, 0x01,//M2_BTL_PATCH_CONTROL, 0xcommand, 0x&&&&0x01, 0x08, 0xFC, 0x03, 0x00, 0x99, 0x01,//HCI_UART_RTSCTS_Control, 0x&&&&0x14, 0x00, 0x00, 0xE1, 0x01, 0x0D, 0x00, 0x04, 0x02, 0x0A, 0x42, 0x41, 0x38, 0x30, 0x30, 0x37, 0x32, 0x33, 0x32, 0x33,//04-SPP,02-Used, 0xSniffSubrating, 0x,0A-蓝牙名字长度“BA”&&&&0x12, 0x00, 0x00, 0xD1, 0x01, 0x0B, 0x00, 0x0A, 0x42, 0x41, 0x38, 0x30, 0x30, 0x37, 0x32, 0x33, 0x32, 0x33,//“TCU_MNG_LE_INIT_REQ”, 0xcommand, 0xinitializes, 0xthe, 0xBT, 0xLow, 0xEnergy, 0xdevice., 0x&&&&0x07, 0x00, 0x00, 0xD3, 0x00, 0x00, 0x00,//initialize, 0xthe, 0xGATT, 0xserver&&&&0x07, 0x00, 0x00, 0xD2, 0x00, 0x00, 0x00,//initialize, 0xthe, 0xGATT, 0xclient&&&&0x12, 0x00, 0x00, 0xE1, 0x3D, 0x0B, 0x00, 0x03, 0xFC, 0x08, 0x00, 0xD1, 0x66, 0x98, 0x04, 0x00, 0x00, 0x00,//send, 0xHCI, 0xcommand, 0x&03, 0xFC, 0x08, 0x00, 0xD1, 0x66, 0x98, 0x04, 0x00, 0x00, 0x00&, 0xwrite, 0xdata, 0xto, 0xthe, 0xmemory, 0xin, 0xthe, 0xChiron.地址(lsb)66, 0x98, 0x04, 0x00, 0x写, 0x00, 0x00&&&&0x12, 0x00, 0x00, 0xE1, 0x3D, 0x0B, 0x00, 0x03, 0xFC, 0x08, 0x00, 0xD1, 0x54, 0x98, 0x04, 0x00, 0x00, 0x00,//send, 0xHCI, 0xcommand, 0x&03, 0xFC, 0x08, 0x00, 0xD1, 0x54, 0x98, 0x04, 0x00, 0x00, 0x00&, 0xwrite, 0xdata, 0xto, 0xthe, 0xmemory, 0xin, 0xthe, 0xChiron.地址(lsb)54, 0x98, 0x04, 0x00, 0x写, 0x00, 0x00&&&&0x07, 0x00, 0x00, 0xE5, 0x01, 0x00, 0x00,//To, 0xsetup, 0xSPP, 0xdevice., 0x&&&&0x0A, 0x00, 0x00, 0xD3, 0x20, 0x03, 0x00, 0x02, 0x00, 0x18,//add, 0xprimary, 0xservice, 0xattributes, 0xto, 0xthe, 0xserver, 0xdatabase., 0xUUID:0018&&&&0x0D, 0x00, 0x00, 0xD3, 0x22, 0x06, 0x00, 0x01, 0x00, 0x02, 0x02, 0x00, 0x2A,//, 0xadd, 0xcharacteristic, 0xdeclaration, 0x, 0xfor, 0xa, 0xparticular, 0xprimary, 0xor, 0xsecondary, 0xservice., 0xUUID, 0x002A&&&&0x1A, 0x00, 0x00, 0xD3, 0x23, 0x13, 0x00, 0x10, 0x00, 0x02, 0x00, 0x2A, 0x0A, 0x00, 0x42, 0x41, 0x38, 0x30, 0x30, 0x37, 0x32, 0x33, 0x32, 0x33, 0x03, 0x07,//, 0xadd, 0xelements, 0xlike, 0xCharacteristic, 0xValue, 0xDeclaration,, 0xCharacteristic, 0xDescriptor, 0xDeclaration, 0xetc, 0xfor, 0xthe, 0xCharacteristic, 0xdeclared.Characteristic, 0xHandle, 0x:10, 0x00,Attribute, 0xType, 0x:00, 0x2A,Attribute, 0xValue:42, 0x41, 0x38, 0x30, 0x30, 0x37, 0x32, 0x33, 0x32, 0x33&BA&,Attribute, 0xPermission, 0x:03, 0x07...This, 0xresponse, 0xwill, 0xcontain, 0xthe, 0xhandle, 0xgenerated, 0xfor, 0xthis, 0xcharacteristic, 0xelement, 0xby, 0xthe, 0xserver, 0xdatabase., 0x&&&&0x0D, 0x00, 0x00, 0xD3, 0x22, 0x06, 0x00, 0x01, 0x00, 0x02, 0x02, 0x01, 0x2A,//, 0xadd, 0xcharacteristic, 0xdeclaration, 0x, 0xfor, 0xa, 0xparticular, 0xprimary, 0xor, 0xsecondary, 0xservice., 0xUUID, 0x01, 0x2A&&&&0x12, 0x00, 0x00, 0xD3, 0x23, 0x0B, 0x00, 0x20, 0x00, 0x02, 0x01, 0x2A, 0x02, 0x00, 0x00, 0x00, 0x03, 0x07,//, 0xadd, 0xelements, 0xlike, 0xCharacteristic, 0xValue, 0xDeclaration,, 0xCharacteristic, 0xDescriptor, 0xDeclaration, 0xetc, 0xfor, 0xthe, 0xCharacteristic, 0xdeclared.Characteristic, 0xHandle, 0x:20, 0x00,Attribute, 0xType, 0x:01, 0x2A,00,Attribute, 0xValue:00, 0x00,Attribute, 0xPermission, 0x:03, 0x07...This, 0xresponse, 0xwill, 0xcontain, 0xthe, 0xhandle, 0xgenerated, 0xfor, 0xthis, 0xcharacteristic, 0xelement, 0xby, 0xthe, 0xserver, 0xdatabase., 0x&&&&0x0D, 0x00, 0x00, 0xD3, 0x22, 0x06, 0x00, 0x01, 0x00, 0x02, 0x02, 0x02, 0x2A,//, 0xadd, 0xcharacteristic, 0xdeclaration, 0x, 0xfor, 0xa, 0xparticular, 0xprimary, 0xor, 0xsecondary, 0xservice., 0xUUID, 0x02, 0x2A&&&&0x11, 0x00, 0x00, 0xD3, 0x23, 0x0A, 0x00, 0x30, 0x00, 0x02, 0x02, 0x2A, 0x01, 0x00, 0x00, 0x03, 0x07,//Characteristic, 0xHandle, 0x:30, 0x00,Attribute, 0xType, 0x:02, 0x2A,Attribute, 0xValue:00, 0x,Attribute, 0xPermission, 0x:03, 0x07&&&&0x0D, 0x00, 0x00, 0xD3, 0x22, 0x06, 0x00, 0x01, 0x00, 0x02, 0x02, 0x03, 0x2A,//, 0xadd, 0xcharacteristic, 0xdeclaration, 0x, 0xfor, 0xa, 0xparticular, 0xprimary, 0xor, 0xsecondary, 0xservice., 0xUUID, 0x03, 0x2A&&&&0x16, 0x00, 0x00, 0xD3, 0x23, 0x0F, 0x00, 0x40, 0x00, 0x02, 0x03, 0x2A, 0x06, 0x00, 0x8F, 0xCF, 0x03, 0x07, 0x02, 0x04, 0x03, 0x07,//Characteristic, 0xHandle, 0x:40, 0x00,Attribute, 0xType, 0x:03, 0x2A,Attribute, 0xValue:8F, 0xCF, 0x03, 0x07, 0x02, 0x04, 0x,Attribute, 0xPermission, 0x:03, 0x07&&&&0x0D, 0x00, 0x00, 0xD3, 0x22, 0x06, 0x00, 0x01, 0x00, 0x02, 0x02, 0x04, 0x2A,//, 0xadd, 0xcharacteristic, 0xdeclaration, 0x, 0xfor, 0xa, 0xparticular, 0xprimary, 0xor, 0xsecondary, 0xservice., 0xUUID, 0x04, 0x2A&&&&0x18, 0x00, 0x00, 0xD3, 0x23, 0x11, 0x00, 0x50, 0x00, 0x02, 0x04, 0x2A, 0x08, 0x00, 0x0A, 0x00, 0x03, 0x07, 0x00, 0x00, 0x00, 0x00, 0x03, 0x07,//Characteristic, 0xHandle, 0x:50, 0x00,Attribute, 0xType, 0x:04, 0x2A,Attribute, 0xValue:0A, 0x00, 0x03, 0x07, 0x00, 0x00, 0x00, 0x00, 0x,Attribute, 0xPermission, 0x:03, 0x07&&&&0x0A, 0x00, 0x00, 0xD3, 0x20, 0x03, 0x00, 0x02, 0x0A, 0x18,//ios, 0xBLE_UUID_CGM_SERVICE, 0x, 0xUUID:0A18&&&&0x0D, 0x00, 0x00, 0xD3, 0x22, 0x06, 0x00, 0x00, 0x01, 0x02, 0x02, 0x29, 0x2A,//2A29, 0x, 0xManufacturer, 0xName, 0xString&&&&0x15, 0x00, 0x00, 0xD3, 0x23, 0x0E, 0x00, 0x10, 0x01, 0x02, 0x29, 0x2A, 0x05, 0x00, 0x49, 0x54, 0x52, 0x4F, 0x4E, 0x03, 0x07,//, 0xITRON&&&&0x0D, 0x00, 0x00, 0xD3, 0x22, 0x06, 0x00, 0x00, 0x01, 0x02, 0x02, 0x24, 0x2A,//2A24, 0xModel, 0xNumber, 0xstring&&&&0x1B, 0x00, 0x00, 0xD3, 0x23, 0x14, 0x00, 0x20, 0x01, 0x02, 0x24, 0x2A, 0x0B, 0x00, 0x54, 0x43, 0x33, 0x35, 0x36, 0x36, 0x31, 0x2D, 0x35, 0x30, 0x31, 0x03, 0x07,//TC, 0x&&&&0x0D, 0x00, 0x00, 0xD3, 0x22, 0x06, 0x00, 0x00, 0x01, 0x02, 0x02, 0x25, 0x2A,//2A25, 0xSerial, 0xNumber, 0xstring&&&&0x14, 0x00, 0x00, 0xD3, 0x23, 0x0D, 0x00, 0x30, 0x01, 0x02, 0x25, 0x2A, 0x04, 0x00, 0x30, 0x30, 0x30, 0x30, 0x03, 0x07,//0000&&&&0x0D, 0x00, 0x00, 0xD3, 0x22, 0x06, 0x00, 0x00, 0x01, 0x02, 0x02, 0x27, 0x2A,//2A27, 0xHardware, 0xRevision, 0xString&&&&0x18, 0x00, 0x00, 0xD3, 0x23, 0x11, 0x00, 0x40, 0x01, 0x02, 0x27, 0x2A, 0x08, 0x00, 0x35, 0x30, 0x35, 0x30, 0x5F, 0x53, 0x50, 0x50, 0x03, 0x07,//5050_SSP, 0x&&&&0x0D, 0x00, 0x00, 0xD3, 0x22, 0x06, 0x00, 0x00, 0x01, 0x02, 0x02, 0x26, 0x2A,//2A26, 0xFirmware, 0xRevision, 0xString, 0x&&&&0x1F, 0x00, 0x00, 0xD3, 0x23, 0x18, 0x00, 0x50, 0x01, 0x02, 0x26, 0x2A, 0x0F, 0x00, 0x38, 0x2E, 0x30, 0x30, 0x2E, 0x37, 0x32, 0x42, 0x20, 0x52, 0x4F, 0x4D, 0x3D, 0x35, 0x30, 0x03, 0x07,//8.00.72B, 0xROM=50, 0x&&&&0x0D, 0x00, 0x00, 0xD3, 0x22, 0x06, 0x00, 0x00, 0x01, 0x02, 0x02, 0x28, 0x2A,//2A28, 0xSoftware, 0xRevision, 0xString&&&&0x14, 0x00, 0x00, 0xD3, 0x23, 0x0D, 0x00, 0x60, 0x01, 0x02, 0x28, 0x2A, 0x04, 0x00, 0x30, 0x30, 0x30, 0x30, 0x03, 0x07,//, 0x0000&&&&0x0D, 0x00, 0x00, 0xD3, 0x22, 0x06, 0x00, 0x00, 0x01, 0x02, 0x02, 0x23, 0x2A,//2A23, 0xSystem, 0xID&&&&0x21, 0x00, 0x00, 0xD3, 0x23, 0x1A, 0x00, 0x70, 0x01, 0x02, 0x23, 0x2A, 0x11, 0x00, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x2D, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x03, 0x07,//00000, 0x&&&&0x18, 0x00, 0x00, 0xD3, 0x20, 0x11, 0x00, 0x10, 0x55, 0xE4, 0x05, 0xD2, 0xAF, 0x9F, 0xA9, 0x8F, 0xE5, 0x4A, 0x7D, 0xFE, 0x43, 0x53, 0x53, 0x49,//主要service, 0xuuid, 0x&&&&0x1B, 0x00, 0x00, 0xD3, 0x22, 0x14, 0x00, 0x00, 0x02, 0x0A, 0x10, 0xFE, 0x69, 0xCA, 0x9A, 0x56, 0x19, 0xF6, 0xAB, 0x02, 0x4D, 0xAA, 0x6D, 0x43, 0x53, 0x53, 0x49,//UUID, 0x69FE, 0x, 0x0A可读|可写&&&&0x27, 0x00, 0x00, 0xD3, 0x23, 0x20, 0x00, 0x10, 0x02, 0x10, 0xFE, 0x69, 0xCA, 0x9A, 0x56, 0x19, 0xF6, 0xAB, 0x02, 0x4D, 0xAA, 0x6D, 0x43, 0x53, 0x53, 0x49, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x07,&&&&0x1B, 0x00, 0x00, 0xD3, 0x22, 0x14, 0x00, 0x00, 0x02, 0x18, 0x10, 0x18, 0x03, 0xA6, 0x28, 0x5E, 0xD8, 0xEC, 0x91, 0x1C, 0x48, 0xA3, 0xAC, 0x43, 0x53, 0x53, 0x49,//UUID, 0x0318, 0x, 0x18可写|通知&&&&0x1F, 0x00, 0x00, 0xD3, 0x23, 0x18, 0x00, 0x20, 0x02, 0x10, 0x18, 0x03, 0xA6, 0x28, 0x5E, 0xD8, 0xEC, 0x91, 0x1C, 0x48, 0xA3, 0xAC, 0x43, 0x53, 0x53, 0x49, 0x01, 0x00, 0x01, 0x03, 0x07,&&&&0x1B, 0x00, 0x00, 0xD3, 0x22, 0x14, 0x00, 0x00, 0x02, 0x10, 0x10, 0x16, 0x96, 0x24, 0x47, 0xC6, 0x23, 0x61, 0xBA, 0xD9, 0x4B, 0x4D, 0x1E, 0x43, 0x53, 0x53, 0x49,//UUID, 0x9616, 0x, 0x10通知&&&&0x1F, 0x00, 0x00, 0xD3, 0x23, 0x18, 0x00, 0x30, 0x02, 0x10, 0x16, 0x96, 0x24, 0x47, 0xC6, 0x23, 0x61, 0xBA, 0xD9, 0x4B, 0x4D, 0x1E, 0x43, 0x53, 0x53, 0x49, 0x01, 0x00, 0x01, 0x03, 0x07,&&&&0x1B, 0x00, 0x00, 0xD3, 0x22, 0x14, 0x00, 0x00, 0x02, 0x0C, 0x10, 0xB3, 0x9B, 0x72, 0x34, 0xBE, 0xEC, 0xD4, 0xA8, 0xF4, 0x43, 0x41, 0x88, 0x43, 0x53, 0x53, 0x49,//UUID, 0x9BB3, 0x, 0x0C写无回复|可写&&&&0x1F, 0x00, 0x00, 0xD3, 0x23, 0x18, 0x00, 0x40, 0x02, 0x10, 0xB3, 0x9B, 0x72, 0x34, 0xBE, 0xEC, 0xD4, 0xA8, 0xF4, 0x43, 0x41, 0x88, 0x43, 0x53, 0x53, 0x49, 0x01, 0x00, 0x01, 0x03, 0x07,&&&&0x1B, 0x00, 0x00, 0xD3, 0x22, 0x14, 0x00, 0x00, 0x02, 0x18, 0x10, 0x6E, 0xE2, 0x17, 0xEF, 0xDA, 0x97, 0x4C, 0x95, 0x9B, 0x3A, 0x6E, 0x02, 0x43, 0x53, 0x53, 0x49,//UUID, 0x6E10, 0x, 0x18可写|通知&&&&0x1F, 0x00, 0x00, 0xD3, 0x23, 0x18, 0x00, 0x50, 0x02, 0x10, 0x6E, 0xE2, 0x17, 0xEF, 0xDA, 0x97, 0x4C, 0x95, 0x9B, 0x3A, 0x6E, 0x02, 0x43, 0x53, 0x53, 0x49, 0x01, 0x00, 0x01, 0x03, 0x07,&&&&0x0D, 0x00, 0x00, 0xE1, 0x3D, 0x06, 0x00, 0x24, 0x0C, 0x03, 0x04, 0x04, 0x24,//send, 0xHCI, 0xcommand, 0x&24, 0x0C, 0x03, 0x04, 0x04, 0x24,//, 0xWrite, 0xClass, 0xof, 0xDevice, 0xCommand, 0x, 0xClassOfDevice:04, 0x04, 0x24&&&&0x12, 0x00, 0x00, 0xE1, 0x3D, 0x0B, 0x00, 0x03, 0xFC, 0x08, 0x00, 0xD1, 0x50, 0x98, 0x04, 0x00, 0x01, 0x01,//send, 0xHCI, 0xcommand, 0x&03, 0xFC, 0x08, 0x00, 0xD1, 0x50, 0x98, 0x04, 0x00, 0x01, 0x01, 0x在50, 0x98, 0x04, 0x00, 0x写01&&&&0x0E, 0x00, 0x00, 0xE1, 0x3D, 0x07, 0x00, 0x1E, 0x0C, 0x04, 0x00, 0x02, 0x12, 0x00,//send, 0xHCI, 0xcommand, 0x&1E, 0x0C, 0x04, 0x00, 0x02, 0x12, 0x00,//, 0xWrite, 0xInquiry, 0xScan, 0xActivity, 0xCommand&&&&0x0E, 0x00, 0x00, 0xE1, 0x3D, 0x07, 0x00, 0x1C, 0x0C, 0x04, 0x00, 0x04, 0x12, 0x00,//send, 0xHCI, 0xcommand, 0x&1C, 0x0C, 0x04, 0x00, 0x04, 0x12, 0x00,//Write_Page_Scan_Activity, 0x&&&&0x08, 0x00, 0x00, 0xE1, 0x0C, 0x01, 0x00, 0x03,//To, 0xset, 0xInquiry, 0xScan,, 0xPage, 0xScan., 0x&&&&0x56, 0x00, 0x00, 0xD1, 0x08, 0x4F, 0x00, 0xA0, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x0F, 0x02, 0x01, 0x02, 0x0B, 0x09, 0x42, 0x41, 0x38, 0x30, 0x30, 0x37, 0x32, 0x33, 0x32, 0x33, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x0B, 0x09, 0x42, 0x41, 0x38, 0x30, 0x30, 0x37, 0x32, 0x33, 0x32, 0x33, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,&&&&////0x56, 0x00, 0x00, 0x&&&&////0xD1,//ServiceID, 0x, 0x1, 0xByte, 0x, 0x&&&&////0x08,//OpCode, 0x, 0x1, 0xByte, 0x, 0x&&&&////0x4F, 0x00,//Parameter, 0xLength, 0x, 0x, 0x2, 0xBytes, 0x, 0x&&&&////0xA0, 0x00,//Adv_Interval_Min, 0x, 0x2, 0xBytes, 0x&&&&////0x00, 0x01,//Adv_Interval_Max, 0x, 0x2, 0xBytes, 0x&&&&////0x00,//Advertising_Type, 0x, 0x1, 0xByte, 0x&&&&////0x00,//Own_Address_Type, 0x, 0x1, 0xByte, 0x&&&&////0x00,//Direct_Address_Type, 0x, 0x1, 0xByte, 0x&&&&////0x00, 0x00, 0x00, 0x00, 0x00, 0x00,//Direct_Address, 0x, 0x6, 0xBytes, 0x&&&&////0x07,//Adv_Channel_Map, 0x, 0x1, 0xByte, 0x&&&&////0x00,//Adv_Filter_Policy, 0x, 0x1, 0xByte, 0x&&&&////0x0F,//Adv_Data_Length, 0x, 0x1, 0xByte, 0x&&&&////0x02, 0x01, 0x02, 0x0B, 0x09, 0x42, 0x41, 0x38, 0x30, 0x30, 0x37, 0x32, 0x33, 0x32, 0x33, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,//Adv_Data, 0x, 0x31, 0xBytes, 0x&&&&////0x0C,//Scan_Resp_Data_Len, 0x, 0x1, 0xByte, 0x&&&&////0x0B, 0x09, 0x42, 0x41, 0x38, 0x30, 0x30, 0x37, 0x32, 0x33, 0x32, 0x33, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,//Scan_Resp_Data, 0x, 0x31, 0xBytes, 0x};uint16_t command_length[]={ &&&&0x0004, &&&&0x000D, &&&&0x000A, //&&&&0x0007, //&&&&0x0033, //&&&&0x00FE, //&&&&0x00FE, //&&&&0x00CA, //&&&&0x000F, //&&&&0x0033, //&&&&0x000F, //&&&&0x0033, //&&&&0x000F, &&&&0x0007, &&&&0x0014, &&&&0x0012, &&&&0x0007, &&&&0x0007, &&&&0x0012, &&&&0x0012, &&&&0x0007, &&&&0x000A, &&&&0x000D, &&&&0x001A, &&&&0x000D, &&&&0x0012, &&&&0x000D, &&&&0x0011, &&&&0x000D, &&&&0x0016, &&&&0x000D, &&&&0x0018, &&&&0x000A, &&&&0x000D, &&&&0x0015, &&&&0x000D, &&&&0x001B, &&&&0x000D, &&&&0x0014, &&&&0x000D, &&&&0x0018, &&&&0x000D, &&&&0x001F, &&&&0x000D, &&&&0x0014, &&&&0x000D, &&&&0x0021, &&&&0x0018, &&&&0x001B, &&&&0x0027, &&&&0x001B, &&&&0x001F, &&&&0x001B, &&&&0x001F, &&&&0x001B, &&&&0x001F, &&&&0x001B, &&&&0x001F, &&&&0x000D, &&&&0x0012, &&&&0x000E, &&&&0x000E, &&&&0x0008, &&&&0x0056};
注意。。不要像我这样直接使用io引脚给蓝牙供电。pa14上本来有个led灯,再加上蓝牙。可能会超出了io输出最大电流。刚百度了下,stm32的输出电流最大25ma。经过这几天使用,单片机通电后会发热了,不知道是不是io口坏了,但功能都还能用,pa14led灯也正常。3.3v供电下,总电流有80ma。包括蓝牙电流。
:uint8_t command_Cont[]={&&&&0x01, 0x03, 0x0C, 0x00,//OpCode=0c03==&OGF(0x0c&&2)03,, 0xOCF:03, 0xReset, 0xCommand&&&&0x01, 0x08, 0xFC, 0x09, 0x00, 0xA1, 0x00, 0x00, 0x00, 0x14, 0x0C, 0xFF, 0x00,//M2Message_Ge ..&( 08:51)&嗯,谢谢。知道思路了,之前也是因为第条命令长度不一,不好发送,你这样就可以按长度发送了。有时间再做作业=740) window.open('http://bbs.mydigit.cn/mobcent/app/data/smilies/03.png');" style="max-width:100%;" onload="if(is_ie6&&this.offsetWidth>740)this.width=740;" >
这个不错,学习一下。
就2分了别嫌少啊
这个必须支持下
不错,恰巧需要。
35661模块,用stm32已经可以完全控制了。BT ,BLE都可用了。
查看完整版本: [--
Powered by
Time 0.136789 second(s),query:5 Gzip enabled

我要回帖

更多关于 hc05蓝牙模块与单片机 的文章

 

随机推荐