From 58c7c3868e2efc95ee3146443f79765de14301af Mon Sep 17 00:00:00 2001 From: paul-szczepanek-arm <33840200+paul-szczepanek-arm@users.noreply.github.com> Date: Thu, 6 Dec 2018 15:04:23 +0000 Subject: [PATCH] check return value of DmSyncStart --- .../targets/TARGET_CORDIO/source/CordioPalGap.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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()