为什么CC2541在启动广播不久后自动关闭?
时间:10-02
整理:3721RD
点击:
我发现CC2541板子在启动广播30秒后,就会收到事件:
GAP_END_DISCOVERABLE_DONE_EVENT
这个是蓝牙协议的规定,还是TI 协议栈里面的规定?
谢谢。
GAP_END_DISCOVERABLE_DONE_EVENT
这个是蓝牙协议的规定,还是TI 协议栈里面的规定?
谢谢。
看一下是不是将广播模式设置为受限的了,在受限制的广播模式下,会广播一段时间后停止广播。
可以设置为无限制广播
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 ),
};