[advertising] fast mode will blink Blue LED 2x slow mode

This commit is contained in:
hathach committed 2017-07-21 23:22:03 +07:00
1 parent cd2da96afb
commit 161e4d4de8
3 files changed
+9 -2

No files matched your search

@@ -258,6 +258,8 @@ bool BLEAdvertising::start(uint16_t timeout)
VERIFY_STATUS( sd_ble_gap_adv_data_set(_data, _count, Bluefruit.ScanResponse.getData(), Bluefruit.ScanResponse.count()), false );
// Initially advertising in fast mode
// Fast mode blink 2x than slow mode
Bluefruit.setConnLedInterval(CFG_ADV_BLINKY_INTERVAL/2);
VERIFY( _start(_fast_interval, _fast_timeout) );
return true;
@@ -308,6 +310,9 @@ void BLEAdvertising::_eventHandler(ble_evt_t* evt)
{
_runnning = false;
// If still advertising, it is only in slow mode --> blink normal
Bluefruit.setConnLedInterval(CFG_ADV_BLINKY_INTERVAL);
if ( _stop_timeout == 0 )
{
// if stop_timeout is 0 --> no timeout