我把BLE CC2540模块设置为Peripheral ,现在我要通过BLE CC2540模块打印其广播出去的数据,要如何获取?还有如果要增加它广播出去的数据,要怎么做?谢谢!
Barbara Wu:
看看GAPRole_SetParameter(GAPROLE_ADVERT_DATA, sizeof(advertData), advertData);
wu wen:
回复 Barbara Wu:
能给点提示吗?看了还是不明白广播的数据在哪?
Barbara Wu:
回复 wu wen:
可以在SimpleBLEPeripheral例程里面搜一下这个函数还有advertData
wu wen:
回复 Barbara Wu:
static uint8 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( SIMPLEPROFILE_SERV_UUID ), HI_UINT16( SIMPLEPROFILE_SERV_UUID ), };
这里面哪些是代表广播信息的?包括哪些信息?
Barbara Wu:
回复 wu wen:
所有都是
为什么要这么定义 每个定义代表的意思,可以参考BLE的通讯协议在bluetooth.org网站上可以下载到
wu wen:
回复 Barbara Wu:
那我要怎么获得RSSI呢?