最小连接间隔设置为400 最大连接间隔设置为420 超时时间设置为200
串口打印:
从机例程修改代码为:
uint16_t User_Define_MinConnectionInterval = 400;
uint16_t User_Define_MaxConnectionInterval = 420;
uint16_t User_Define_TimeOut = 200;
/******************************** ******************************/
if (events & SBP_PARAM_UPDATE_EVT)
{
// Send connect param update request
uint8 ret = GAPRole_PeripheralConnParamUpdateReq(peripheralConnList.connHandle,
User_Define_MinConnectionInterval,
User_Define_MaxConnectionInterval,
DEFAULT_DESIRED_SLAVE_LATENCY,
User_Define_TimeOut,
Peripheral_TaskID);
PRINT("ret=%d\r\n", ret);
static uint8 consult_num = 0;
if (peripheralConnList.connInterval < 300)
{
consult_num++;
PRINT("consult_num=%d\r\n", consult_num);
if (consult_num < 5)
{
tmos_start_task(Peripheral_TaskID, SBP_PARAM_UPDATE_EVT, 1000);
}
else
{
consult_num = 0;
}
}
return (events ^ SBP_PARAM_UPDATE_EVT);
}