enhance BLEGap, adding BLEGapConnection to support up to max 20 connections

This commit is contained in:
hathach committed 2019-01-17 12:53:22 +07:00
1 parent 2b603b9bbc
commit e312da361e
9 files changed
+191 -138

No files matched your search

+2 -16
View File
@@ -388,10 +388,6 @@ void BLEScanner::_eventHandler(ble_evt_t* evt)
if ( para->role == BLE_GAP_ROLE_CENTRAL)
{
_runnning = false;
// Turn on Conn LED
Bluefruit._stopConnLed();
Bluefruit._setConnLed(true);
}
}
break;
@@ -399,18 +395,8 @@ void BLEScanner::_eventHandler(ble_evt_t* evt)
case BLE_GAP_EVT_DISCONNECTED:
if ( BLE_GAP_ROLE_CENTRAL == Bluefruit.Gap.getRole(evt->evt.common_evt.conn_handle) )
{
// skip if already running
if ( !_runnning )
{
// Turn off Conn LED
Bluefruit._setConnLed(false);
// Auto start if enabled
if ( _start_if_disconnect )
{
start(_param.timeout);
}
}
// Auto start if enabled
if ( !_runnning && _start_if_disconnect ) start(_param.timeout);
}
break;