1871 views|0 replies

6593

Posts

0

Resources
The OP
 

cc254x cc2640 WeChat access airsync-broadcast data [Copy link]

1. Experimental purpose:
Modify ble broadcast data to comply with airsync protocol
2. Experimental environment:
Hardware platform: cc2540, cc2541, cc2640
Protocol stack version: The broadcast data of each version of the protocol stack is consistent
Compiler: iar
airsync Verification method: mac address verification
Test tool: airsyncdebugger
3. Broadcast data protocol format:
1. The protocol stipulates that the broadcast data must end with a 6-bit mac address, and the last 78 bits are manufacturer information, which can be filled with 0; the broadcast service must include WeChat service
2. Specific implementation code:
static uint8 advertData[] =
{
0x02, // length of first data structure (2 bytes excluding length byte)
GAP_ADTYPE_FLAGS, // AD Type = Flags
DEFAULT_DISCOVERABLE_MODE | GAP_ADTYPE_FLAGS_BREDR_NOT_SUPPORTED,

// service UUID, to notify central devices what services are included
// in this peripheral
0x05, // length of second data structure (7 bytes excluding length byte)
GAP_ADTYPE_16BIT_MORE, // list of 16-bit UUID's available, but not complete list
LO_UINT16( WECHAT_SERV_UUID ), //Wechat Service
HI_UINT16( WECHAT_SERV_UUID ),
LO_UINT16( xxx_SERV_UUID ), //Custom Service
HI_UINT16( xxx_SERV_UUID ),

0x09,
GAP_ADTYPE_MANUFACTURER_SPECIFIC,

/*Manufacturer information, can be filled with 0*/
0x00,
0x00,

/*Device MAC address, needs to be filled when the program is running (6 Bytes)*/
0,0,0,0,0,0
};

4. Experimental results:
After modifying the broadcast data, you can test it through airsyncdebugger. Passing the first step of the test proves that the broadcast data has been modified successfully.

This post is from Microcontroller MCU
 

Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list