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.

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

Other Parts Discussed in Thread: CC2650

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

  • 你是想通过CC2650读取手表的中数据?
  • 不是, 是2650怎样产生华为那个手环的那个manufacturedata

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

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

  • 参考下面的代码:

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

  • 长度不够,你这都10个数了
  • 好的 , 谢谢哈, 长度改成10就可以了吧。 哪个历程里面带的manufacturedata?
  • 例程中都没有写,你要用的话参考上面的例程写一下就可以了