BLE-CC254x-1.5.0.16协议栈例程SimpleBLEPeripheral测试发现底层有BUG。
连接超时设置如下:
// Supervision timeout value (units of 10ms, 1000=10s) if automatic parameter update request is enabled
#define DEFAULT_DESIRED_CONN_TIMEOUT 500
当回调返回GAPROLE_CONNECTED后,有时把主机蓝牙关闭,例程过很久才会返回GAPROLE_WAITING_AFTER_TIMEOUT(有时会有十几分钟),然后返回GAPROLE_ADVERTISING进行广播
Viki Shi:
In simple_peripheral, you will get GAPROLE_WAITING state change event if either side initiates disconnection or you will get GAPROLE_WAITING_AFTER_TIMEOUT after supervision timeout has been reached due to not receiving any packet from the master. Therefore you could for example try to restart advertising in these states.
参考下这边的类似问题:e2echina.ti.com/…/178984
shilei dou:
回复 Viki Shi:
我的意思是:主机蓝牙关闭,过十几分钟才收到GAPROLE_WAITING_AFTER_TIMEOUT