code clean up
This commit is contained in:
1 parent
8034f79236
commit
a96bcc04d2
2 files changed
+15
-9
No files matched your search
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in new issue
Block a user