POWER_SAVING打开时,CC2541无法广播CC2541。sniffer抓取不到任何数据。
目前我的BLE板子没有设计触发按键,所以需要蓝牙一直工作在低功耗广播状态下。我打算采取的方案是1S广播一次,400MS的任务定时。在没有广播或任务时,需要蓝牙进入低功耗P2模式。
这个是adveritise 设置
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 ),
};