diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/source/CordioPalGap.cpp b/features/FEATURE_BLE/targets/TARGET_CORDIO/source/CordioPalGap.cpp index 022147577d..c70b7b4da5 100644 --- a/features/FEATURE_BLE/targets/TARGET_CORDIO/source/CordioPalGap.cpp +++ b/features/FEATURE_BLE/targets/TARGET_CORDIO/source/CordioPalGap.cpp @@ -1014,7 +1014,7 @@ ble_error_t Gap::periodic_advertising_create_sync( ); } - DmSyncStart( + dmSyncId_t sync_id = DmSyncStart( advertising_sid, peer_address_type.value(), peer_address.data(), @@ -1022,7 +1022,11 @@ ble_error_t Gap::periodic_advertising_create_sync( sync_timeout ); + if (sync_id == DM_SYNC_ID_NONE) { return BLE_ERROR_NONE; + } else { + return BLE_ERROR_INTERNAL_STACK_FAILURE; + } } ble_error_t Gap::cancel_periodic_advertising_create_sync()