Skip to content

Commit 7293b76

Browse files
paul-szczepanek-armDonatien Garnier
authored andcommitted
omit reports without periodic interval
1 parent a485f4f commit 7293b76

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

BLE_PeriodicAdvertising/source/main.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,11 @@ class PeriodicDemo : private mbed::NonCopyable<PeriodicDemo>, public ble::Gap::E
303303
return;
304304
}
305305

306+
/* if we're looking for periodic advertising don't bother unless it's present */
307+
if (_role_established && event.isPeriodicIntervalPresent()) {
308+
return;
309+
}
310+
306311
ble::AdvertisingDataParser adv_parser(event.getPayload());
307312

308313
/* parse the advertising payload, looking for a discoverable device */
@@ -317,6 +322,9 @@ class PeriodicDemo : private mbed::NonCopyable<PeriodicDemo>, public ble::Gap::E
317322
if (_role_established) {
318323
printf("We found the peer, syncing\r\n");
319324
_gap.stopScan();
325+
326+
printf("We found the peer, syncing with SID %d %d\r\n", event.getSID());
327+
320328
ble_error_t error = _gap.createSync(
321329
event.getPeerAddressType(),
322330
event.getPeerAddress(),

0 commit comments

Comments
 (0)