TI中文支持网
TI专业的中文技术问题搜集分享网站

蓝牙从机事件处理函数 SimpleBLEPeripheral_ProcessEvent的疑问

蓝牙从机事件处理函数 SimpleBLEPeripheral_ProcessEvent以下程序

if ( events & SBP_PERIODIC_EVT )
{
// Restart timer
if ( SBP_PERIODIC_EVT_PERIOD )
{
osal_start_timerEx( simpleBLEPeripheral_TaskID, SBP_PERIODIC_EVT, SBP_PERIODIC_EVT_PERIOD );
}

// Perform periodic application task
performPeriodicTask();

delay(10000);    //为什么这里给一个比较长的延时函数,蓝牙会自动断开连接(或者在这个事情处理中调用的某个函数,此函数内调用比较长的延时函数,蓝牙都                   会断开连接,为什么???)

return (events ^ SBP_PERIODIC_EVT);
}

Shu Davin:

闹笑话了吧,OS里面能这样加Delay?

Supervision timeout超时了。

可以通过osal_start_timerEx函数在10000后触发一个事件来处理。

waiting:

回复 Shu Davin:

请问Supervision timeout在哪里可以设置?

admin admin1:

回复 waiting:

http://www.deyisupport.com/question_answer/wireless_connectivity/bluetooth/f/103/t/59908.aspx

HG:

回复 waiting:

Hi DCG,

Supervision Timeout – This is the maximum amount of time between two successful connection events. If this amount of time passes without a successful connection event, the device is to consider the connection lost, and return to an unconnected state. This parameter value is represented in units of 10ms. The supervision timeout value can range from a minimum of 10 (100ms) to 3200 (32.0s). In addition, the timeout must be larger than the effective connection interval。

   可以在peripheral.h中的GAPROLE_TIMEOUT_MULTIPLIER参数上设置。

   #define GAPROLE_TIMEOUT_MULTIPLIER  0x314  //!< Update Parameter Timeout Multiplier (n * 10ms). Range: 100ms to 32 seconds (0x000a – 0x0c80). Read/Write. Size is uint16. Default is 1000.

赞(0)
未经允许不得转载:TI中文支持网 » 蓝牙从机事件处理函数 SimpleBLEPeripheral_ProcessEvent的疑问
分享到: 更多 (0)