File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed
connectivity/FEATURE_BLE/source/cordio/source Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,9 @@ bool dummy_gap_event_handler(const wsfMsgHdr_t *msg)
32
32
}
33
33
}
34
34
35
+ #if BLE_FEATURE_PERIODIC_ADVERTISING && BLE_ROLE_OBSERVER
36
+ sync_handle_t PalGap::_pending_periodic_sync_handle = 0 ;
37
+ #endif
35
38
36
39
bool PalGap::is_feature_supported (
37
40
ble::controller_supported_features_t feature
@@ -592,7 +595,8 @@ void PalGap::gap_handler(const wsfMsgHdr_t *msg)
592
595
593
596
handler->on_periodic_advertising_sync_established (
594
597
hci_error_code_t (evt->status ),
595
- evt->syncHandle ,
598
+ /* the Cordio host stack uses a different ID to identify the control block */
599
+ _pending_periodic_sync_handle,
596
600
evt->advSid ,
597
601
connection_peer_address_type_t (evt->advAddrType ),
598
602
evt->advAddr ,
@@ -1343,6 +1347,8 @@ ble_error_t PalGap::periodic_advertising_create_sync(
1343
1347
if (sync_id == DM_SYNC_ID_NONE) {
1344
1348
return BLE_ERROR_INTERNAL_STACK_FAILURE;
1345
1349
} else {
1350
+ /* this is not the real handle, this is CORDIO internal handle but the user doesn't need to know that */
1351
+ _pending_periodic_sync_handle = sync_id;
1346
1352
return BLE_ERROR_NONE;
1347
1353
}
1348
1354
}
Original file line number Diff line number Diff line change @@ -566,6 +566,10 @@ class PalGap final : public ble::PalGap {
566
566
}
567
567
568
568
private:
569
+ #if BLE_FEATURE_PERIODIC_ADVERTISING && BLE_ROLE_OBSERVER
570
+ /* must be static because is needed in a static handler, there can only be one sync in progress */
571
+ static sync_handle_t _pending_periodic_sync_handle;
572
+ #endif
569
573
PalGapEventHandler *_pal_event_handler;
570
574
address_t device_random_address;
571
575
bool use_active_scanning;
You can’t perform that action at this time.
0 commit comments