TI中文支持网
TI专业的中文技术问题搜集分享网站

怎样在CC2650蓝牙广播包里面添加manufactureData

第一个图是我现在的例子里面的,第二个图是华为手环的,请问怎样添加Manufacturedata 到我的heartrate例程中,谢谢

Kevin Qiu1:

你是想通过CC2650读取手表的中数据?

user1388075:

回复 Kevin Qiu1:

不是, 是2650怎样产生华为那个手环的那个manufacturedata

你看红色框框里面的。华为的手环有。

我的这个2650怎样改程序,添加红色框框那个字段

Kevin Qiu1:

回复 user1388075:

参考下面的代码:


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,

};

user1388075:

回复 Kevin Qiu1:

//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 了呢

Kevin Qiu1:

回复 user1388075:

长度不够,你这都10个数了

user1388075:

回复 Kevin Qiu1:

好的 , 谢谢哈, 长度改成10就可以了吧。哪个历程里面带的manufacturedata?

Kevin Qiu1:

回复 user1388075:

例程中都没有写,你要用的话参考上面的例程写一下就可以了

赞(0)
未经允许不得转载:TI中文支持网 » 怎样在CC2650蓝牙广播包里面添加manufactureData
分享到: 更多 (0)