第一个图是我现在的例子里面的,第二个图是华为手环的,请问怎样添加Manufacturedata 到我的heartrate例程中,谢谢
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
第一个图是我现在的例子里面的,第二个图是华为手环的,请问怎样添加Manufacturedata 到我的heartrate例程中,谢谢
参考下面的代码:
static uint8_t advertData[] = { // Flags; this sets the device to use limited discoverable // mode (advertises for 30 seconds at a time) instead of general // discoverable mode (advertises indefinitely) 0x02, // length of this data GAP_ADTYPE_FLAGS, DEFAULT_DISCOVERABLE_MODE | GAP_ADTYPE_FLAGS_BREDR_NOT_SUPPORTED, // service UUID, to notify central devices what services are included // in this peripheral 0x03, // length of this data GAP_ADTYPE_16BIT_MORE, // some of the UUID's, but not all LO_UINT16(THROUGHPUT_SERVICE_SERV_UUID), HI_UINT16(THROUGHPUT_SERVICE_SERV_UUID), 0x07, // length of this data including the data type byte GAP_ADTYPE_MANUFACTURER_SPECIFIC, // manufacturer specific advertisement data type 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, };//GAP - Advertisement data (max size = 31 bytes)
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),
0x09, // length of this data including the data type byte
GAP_ADTYPE_MANUFACTURER_SPECIFIC, // manufacturer specific advertisement data type
0x43,
0x52,
0x01,
0x05,
0x01,
0x00,
0x00,
0x00,
0x01
};
为啥我把他改成这样就看不到manufacturedata 了呢