1、默认的是这样的:
uint8_t advData1[] =
{
0x03,
GAP_ADTYPE_LOCAL_NAME_SHORT,
'S',
'P',
0x02,
GAP_ADTYPE_FLAGS,
GAP_ADTYPE_FLAGS_BREDR_NOT_SUPPORTED | GAP_ADTYPE_FLAGS_GENERAL,
0x03,
GAP_ADTYPE_16BIT_MORE,
// More 16-bit – UUID 0
LO_UINT16(0xfff0),
HI_UINT16(0xfff0),
};
2、怎样修改成这样的:
static uint8_t advertData[] =
{
// Flags
0x02,
GAP_ADTYPE_FLAGS,
GAP_ADTYPE_FLAGS_GENERAL | GAP_ADTYPE_FLAGS_BREDR_NOT_SUPPORTED,
// Service UUIDs
0x05,
GAP_ADTYPE_16BIT_MORE,
LO_UINT16(HEARTRATE_SERV_UUID),
HI_UINT16(HEARTRATE_SERV_UUID),
LO_UINT16(BATT_SERV_UUID),
HI_UINT16(BATT_SERV_UUID),
0x0C, // length of this data including the data type byte
GAP_ADTYPE_MANUFACTURER_SPECIFIC, // manufacturer specific advertisement data type
0x43,
0x52,
0x03,//设备类型
0x05,//协议版本号
0x01,//MAC地址 ofs = 15
0x02,
0x03,
0x04,
0x05,
0x06,
0x01//子设备类型
};
Kevin Qiu1:
可以在advData1中添加后面需要的数据信息
user1388075:
回复 Kevin Qiu1:
改不了,改了一编译,就被自动给删了
user1388075:
回复 Kevin Qiu1:
图形界面怎样加12个字节的GAP_ADTYPE_MANUFACTURER_SPECIFIC 类型数据?不会操作
Kevin Qiu1:
回复 user1388075:
上图中最后一项Additional data,设定其他数据长度
Kevin Qiu1:
回复 user1388075:
恭喜