程序跑起来以后,SimpleBLEPeripheral中peripheralStateNotificationCB回调立即默认GAPROLE_CONNECTED连接状态了???是怎么回事,换了好几个模块同样的现象,也有正常的模块,很奇怪为什么会这样???????????求教
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
case GAPROLE_CONNECTED:
{
#if (defined HAL_LCD) && (HAL_LCD == TRUE)
HalLcdWriteString( "Connected", HAL_LCD_LINE_3 );
#endif // (defined HAL_LCD) && (HAL_LCD == TRUE)
#ifdef PLUS_BROADCASTER
// Only turn advertising on for this state when we first connect
// otherwise, when we go from connected_advertising back to this state
// we will be turning advertising back on.
if ( first_conn_flag == 0 )
{
uint8 advertEnabled = FALSE; // Turn on Advertising
// Disable connectable advertising.
GAPRole_SetParameter(GAPROLE_ADVERT_ENABLED, sizeof(uint8),
&advertEnabled);
// Set to true for non-connectabel advertising.
advertEnabled = TRUE;
// Enable non-connectable advertising.
GAPRole_SetParameter(GAPROLE_ADV_NONCONN_ENABLED, sizeof(uint8),
&advertEnabled);
first_conn_flag = 1;
}
#endif // PLUS_BROADCASTER
simpleBLEState = BLE_STATE_CONNECTED;
}
break;