diff --git a/libraries/Bluefruit52Lib/src/BLEAdvertising.h b/libraries/Bluefruit52Lib/src/BLEAdvertising.h index 91ddaae6..059b6984 100644 --- a/libraries/Bluefruit52Lib/src/BLEAdvertising.h +++ b/libraries/Bluefruit52Lib/src/BLEAdvertising.h @@ -44,6 +44,21 @@ #include "BLEService.h" #include "services/BLEBeacon.h" +/* Advertising Guideline from Apple + * https://developer.apple.com/library/content/qa/qa1931/_index.html + * + * The advertising interval of your peripheral affects the time to discovery + * and connect performance. Outside of ideal conditions, for example when your + * app is no longer active in the foreground, the time to discovery becomes + * longer. To maximize the probability of being discovered, the accessory + * must advertise at one of the listed intervals exactly. + * + * The recommended advertising pattern and advertising intervals are: + * - First, advertise at 20 ms intervals for at least 30 seconds + * - If not discovered after 30 seconds, you may change to one of the following + * longer intervals: 152.5 ms, 211.25 ms, 318.75 ms, 417.5 ms, 546.25 ms, + * 760 ms, 852.5 ms, 1022.5 ms, 1285 ms + */ #define BLE_ADV_INTERVAL_FAST_DFLT 32 // 20 ms (in 0.625 ms unit) #define BLE_ADV_INTERVAL_SLOW_DFLT 244 // 152.5 ms (in 0.625 ms unit) #define BLE_ADV_FAST_TIMEOUT_DFLT 30 // in seconds diff --git a/libraries/Bluefruit52Lib/src/bluefruit.cpp b/libraries/Bluefruit52Lib/src/bluefruit.cpp index cafa79ed..91c7cbd2 100644 --- a/libraries/Bluefruit52Lib/src/bluefruit.cpp +++ b/libraries/Bluefruit52Lib/src/bluefruit.cpp @@ -514,15 +514,6 @@ void AdafruitBluefruit::_ble_handler(ble_evt_t* evt) Advertising.start(); break; - case BLE_GAP_EVT_TIMEOUT: - if (evt->evt.gap_evt.params.timeout.src == BLE_GAP_TIMEOUT_SRC_ADVERTISING) - { - // TODO advanced advertising - // Restart Advertising - Advertising.start(); - } - break; - case BLE_GAP_EVT_SEC_PARAMS_REQUEST: { // Pairing in progress