File tree Expand file tree Collapse file tree 2 files changed +5
-12
lines changed
libraries/Bluefruit52Lib/src Expand file tree Collapse file tree 2 files changed +5
-12
lines changed Original file line number Diff line number Diff line change @@ -138,8 +138,8 @@ bool BLEScanner::stop(void)
138
138
{
139
139
VERIFY_STATUS ( sd_ble_gap_scan_stop (), false );
140
140
141
- Bluefruit._stopConnLed (); // stop blinking
142
141
_runnning = false ;
142
+ Bluefruit._stopConnLed (); // stop blinking
143
143
144
144
return true ;
145
145
}
@@ -406,6 +406,7 @@ void BLEScanner::_eventHandler(ble_evt_t* evt)
406
406
if (evt->evt .gap_evt .params .timeout .src == BLE_GAP_TIMEOUT_SRC_SCAN)
407
407
{
408
408
_runnning = false ;
409
+ Bluefruit._stopConnLed ();
409
410
if (_stop_cb) ada_callback (NULL , 0 , _stop_cb);
410
411
}
411
412
break ;
Original file line number Diff line number Diff line change @@ -826,16 +826,7 @@ void AdafruitBluefruit::_ble_handler(ble_evt_t* evt)
826
826
LOG_LV2 (" GAP" , " Disconnect Reason 0x%02X" , evt->evt .gap_evt .params .disconnected .reason );
827
827
828
828
// Turn off Conn LED If not connected at all
829
- bool still_connected = false ;
830
- for (uint8_t i=0 ; i<BLE_MAX_CONNECTION; i++)
831
- {
832
- if ( _connection[i] && _connection[i]->connected () )
833
- {
834
- still_connected = true ;
835
- break ;
836
- }
837
- }
838
- if ( !still_connected ) _setConnLed (false );
829
+ if ( !this ->connected () ) _setConnLed (false );
839
830
840
831
// Invoke disconnect callback
841
832
if ( conn->getRole () == BLE_GAP_ROLE_PERIPH )
@@ -848,7 +839,6 @@ void AdafruitBluefruit::_ble_handler(ble_evt_t* evt)
848
839
849
840
delete _connection[conn_hdl];
850
841
_connection[conn_hdl] = NULL ;
851
-
852
842
}
853
843
break ;
854
844
@@ -994,6 +984,8 @@ void AdafruitBluefruit::_startConnLed(void)
994
984
void AdafruitBluefruit::_stopConnLed (void )
995
985
{
996
986
xTimerStop (_led_blink_th, 0 );
987
+
988
+ _setConnLed ( this ->connected () );
997
989
}
998
990
999
991
void AdafruitBluefruit::_setConnLed (bool on_off)
You can’t perform that action at this time.
0 commit comments