SYD8801微信接入测试结果【精简协议】【AirSync】
SYD8801是一款低功耗高性能蓝牙低功耗SOC,集成了高性能2.4GHz射频收发机、32位ARM Cortex-M0处理器、128kB Flash存储器、以及丰富的数字接口。SYD8801片上集成了Balun无需阻抗匹配网络、高效率DCDC降压转换器,适合用于可穿戴、物联网设备等。具体可咨询:http://www.syd-tek.com/关于微信接入的内容请看:http://blog.csdn.net/chengdong1314/article/details/78070453
SYD8801微信接入测试结果-精简协议
这里首先使用AirSyncDebugger软件进行调试,调试结果如下:
http://img.blog.csdn.net/20170929135632946http://img.blog.csdn.net/20170929135637841http://img.blog.csdn.net/20170929135641613
微信接入的资料请看:http://download.csdn.net/download/chengdong1314/10001695
关于SYD8801端的微信接入的源代码请和SYD官方索要!官方有提供详细资源和源代码!
下面来真正的连接微信!
第一步当然是组建微信公众号,这方面的工作请看前面提及的资料:http://blog.csdn.net/chengdong1314/article/details/78070453
这里要提醒一下:
第一微信公众号的配置必须要对,否则不可能连接成功
第二MAC地址必须要和公众号的匹配对的上
第三必须的过得了AirSyncDebugger的测试
进入公众号时显示连接中,如下左图,如果各方面配置不对则会显示连接0个设备,如下右图:
http://img.blog.csdn.net/20171010233527780http://img.blog.csdn.net/20171010233638695
如果连接成功则会显示成功连接到1个设备,如下左图所示,这时候可以在微信运动看到上传的步数,如下右图:
http://img.blog.csdn.net/20171010233824158http://img.blog.csdn.net/20171011090004285
这时候抓包到的数据如下,确实手环上传了步数:
http://img.blog.csdn.net/20171010234126848
SYD8801微信接入测试结果-AirSync
关于AirSync的说明请看博客http://blog.csdn.net/chengdong1314/article/details/78070453的相关章节
这里使用AirSyncDebugger软件进行调试,第一步先进行设置,包括DEVICE_TYPE和DEVICE_ID,这两个的定义在《mpbledemo2.h》温江中,如下:
#define DEVICE_TYPE "gh_ca9217796a90" //device type,需填入您申请到的微信测试id号
#define DEVICE_ID "gh_ca9217796a90_dc295255d8de6c6fd0597acaf2f41d06" //deviceid,需填入您申请到的deviceid
设置步骤如下(注意:手指指的地方就是要点击的地方),这里输入的DEVICE_TYPE和DEVICE_ID要和代码对应上:
http://img.blog.csdn.net/20180128150957843http://img.blog.csdn.net/20180128151002337http://img.blog.csdn.net/20180128151007245http://img.blog.csdn.net/20180128151016043
接下来就是测试截图(注意:从第二个图开始(device_auth发送)都要用按键切换两次到记步界面,这时候手环才会发送相应数据包,因为发送的调用在记步界面开始的地方):
http://img.blog.csdn.net/20180128151734267http://img.blog.csdn.net/20180128151740063http://img.blog.csdn.net/20180128151743465http://img.blog.csdn.net/20180128151748092http://img.blog.csdn.net/20180128151751161
发送数据包的入口代码:
http://img.blog.csdn.net/20180128152211735?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvY2hlbmdkb25nMTMxNA==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast
另外在《ble_wechat_service.h》文件中定义了目前是微信精简协议还是AIRSYNC,定义_WECHAT_代表使用精简协议,定义__AIRSYNC__代表使用AIRSYNC,目前都是分开测试的,合在一起还没有测试,不过理论上可行!
http://img.blog.csdn.net/20180128152334384?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvY2hlbmdkb25nMTMxNA==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast
关于SYD8801端的微信接入的源代码请和SYD官方索要!官方有提供详细资源和源代码!
最后下面是AirSyncDebugger软件的日志:
***** onTestBroadcastRecord *****
result = true, Has 0xfee7 or standard service in broadcast record
广播包:03 19 05 00 02 01 05 05 03 01 00 E7 FE 09 FF 00 00 E0 39 76 BD 26 95 06 09 55 41 52 54 46 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
***** onTestManufatureData *****
resut= true, 广播包中 manufacture specific data 字段中MAC地址校验成功.
***** onDiscoverService *****
result = true, DiscoverService success
Discovered Services
ServiceUUID: 00001800-0000-1000-8000-00805f9b34fb
ServiceUUID: 00001801-0000-1000-8000-00805f9b34fb
ServiceUUID: 0000180a-0000-1000-8000-00805f9b34fb
ServiceUUID: 0000180f-0000-1000-8000-00805f9b34fb
ServiceUUID: 00000001-0000-1000-8000-00805f9b34fb
ServiceUUID: 0000fee7-0000-1000-8000-00805f9b34fb
ServiceUUID: 0000ff00-0000-1000-8000-00805f9b34fb
***** onTestHasWeChatService *****
result = true, has WeChatService or standard service
***** onTestHasIndicateCharacteristic *****
result = true, has WeChat Indicate Characteristic
***** onTestHasWriteCharacteristic *****
result = true, has Wechat Write Characteristic
***** onTestHasReadCharacteristic *****
result = true, Has WeChat read characteristic
***** onTestWriteCharacteristicPermisson *****
result = true, has Write permission
***** onTestIndicateCharacteristicPermisson *****
result = true, has Indication permission
***** onTestReadCharacteristicPermisson *****
result = true, Read Characteristic is read able
***** onTestStartIndicating *****
result = true, can Start Indicate
***** onConnected *****
result = true, connected
------onDataReceived------
data length = 20
data dump = FE 01 00 57 27 11 00 01 0A 00 12 10 A9 31 21 A9 B4 A7 3B BA
data receive seq = 1
------onDataReceived------
data length = 20
data dump = 3C 53 1D 2B F9 A6 04 27 18 84 80 04 20 01 28 01 62 31 67 68
data receive seq = 2
------onDataReceived------
data length = 20
data dump = 5F 63 61 39 32 31 37 37 39 36 61 39 30 5F 64 63 32 39 35 32
data receive seq = 3
------onDataReceived------
data length = 20
data dump = 35 35 64 38 64 65 36 63 36 66 64 30 35 39 37 61 63 61 66 32
data receive seq = 4
------onDataReceived------
data length = 7
data dump = 66 34 31 64 30 36 00
data receive seq = 5
***** onTestRecvAuthReqtWhenStartedIndicating *****
result = true, received auth request pack
***** onTestIsValidAuthReqPack *****
result = true, is a valid auth request pack
AuthRequestPack: FE 01 00 57 27 11 00 01 0A 00 12 10 A9 31 21 A9 B4 A7 3B BA 3C 53 1D 2B F9 A6 04 27 18 84 80 04 20 01 28 01 62 31 67 68 5F 63 61 39 32 31 37 37 39 36 61 39 30 5F 64 63 32 39 35 32 35 35 64 38 64 65 36 63 36 66 64 30 35 39 37 61 63 61 66 32 66 34 31 64 30 36 00
has BaseRequest
has Md5DeviceTypeAndDeviceId, Md5DeviceTypeAndDeviceId = A9 31 21 A9 B4 A7 3B BA 3C 53 1D 2B F9 A6 04 27
Md5DeviceTypeAndDeviceId BitLength = 128bit
Md5DeviceTypeAndDeviceId checkout success
no MacAddress field!
has ProtoVersion field, ProtoVersion = 65540
has AuthProto field, AuthProto = 1
has AuthMethod field, AuthMethod = EAM_md5
no AesSign field!
has DeviceName field, DeviceName = gh_ca9217796a90_dc295255d8de6c6fd0597acaf2f41d06
**** send auth response ****
data len = 14
data dump = FE 01 00 0E 4E 21 00 01 0A 02 08 00 12 00
------onDataReceived------
data length = 16
data dump = FE 01 00 10 27 13 00 02 0A 00 1A 04 11 22 33 44
data receive seq = 6
***** onTestRecvInitReqPack *****
result = true, received init request pack
***** onTestIsValidInitReqPack *****
result = true, valid init request pack: has BaseRequest
has Challenge field, Challenge = 11 22 33 44
**** send init request response ****
data len = 25
data dump = FE 01 00 19 4E 23 00 02 0A 02 08 00 10 B4 24 18 F8 AC 01 20 D1 BB CA BF 07
------onDataReceived------
data length = 20
data dump = FE 01 00 27 27 12 00 03 0A 00 12 1B FE CF 00 01 00 1B 00 01
data receive seq = 7
------onDataReceived------
data length = 19
data dump = 00 03 00 00 48 65 6C 6C 6F 2C 20 57 65 43 68 61 74 21 00
data receive seq = 8
*** receive SendDataRequest ****
date type = manufactureSvr data
data len = 31
data dump = 0A 00 12 1B FE CF 00 01 00 1B 00 01 00 03 00 00 48 65 6C 6C 6F 2C 20 57 65 43 68 61 74 21 00
**** send SendData Response(echo request) ****
data len = 45
data dump = FE 01 00 2D 4E 22 00 03 0A 02 08 00 12 1F 0A 00 12 1B FE CF 00 01 00 1B 00 01 00 03 00 00 48 65 6C 6C 6F 2C 20 57 65 43 68 61 74 21 00
***** onTestIsValidSendDataRequest *****
result = true, is a valid SendDataRequest pack: has BaseRequest field
has Data field, data = FE CF 00 01 00 1B 00 01 00 03 00 00 48 65 6C 6C 6F 2C 20 57 65 43 68 61 74 21 00
no Type field, use default manufactureSvr data type
**** send ManufactureSvr Push ****
data len = 22
data dump = FE 01 00 16 75 31 00 00 0A 00 12 08 31 32 33 34 35 36 37 38 18 00
**** send Html Push ****
data len = 23
data dump = FE 01 00 17 75 31 00 00 0A 00 12 08 31 32 33 34 35 36 37 38 18 91 4E
**** send wxWristBand Push ****
data len = 14
data dump = FE 01 00 0E 75 31 00 00 0A 00 12 00 18 01
**** send EnterDeviceChatView Push ****
data len = 14
data dump = FE 01 00 0E 75 32 00 00 0A 00 10 01 18 01
**** send Exit ChatView Push ****
data len = 14
data dump = FE 01 00 0E 75 32 00 00 0A 00 10 02 18 01
**** send Enter HtmlChatView Push ****
data len = 14
data dump = FE 01 00 0E 75 32 00 00 0A 00 10 01 18 02
**** send Exit HtmlChatView Push ****
data len = 14
data dump = FE 01 00 0E 75 32 00 00 0A 00 10 02 18 02
**** send enterBackground Push ****
data len = 12
data dump = FE 01 00 0C 75 33 00 00 0A 00 10 01
**** send enterForground Push ****
data len = 12
data dump = FE 01 00 0C 75 33 00 00 0A 00 10 02
**** send enterSleep Push ****
data len = 12
data dump = FE 01 00 0C 75 33 00 00 0A 00 10 03
*****Disconnected Device*****
共享充电宝 用的公众号 很好 很强大 以后可以用得到希望有更详细的心得分享 MARK
页:
[1]