Skip to content

Commit e1e20f8

Browse files
paul-szczepanek-armCruz Monrreal II
authored andcommitted
check return value of DmSyncStart
1 parent 8c262e7 commit e1e20f8

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

features/FEATURE_BLE/targets/TARGET_CORDIO/source/CordioPalGap.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1014,15 +1014,19 @@ ble_error_t Gap::periodic_advertising_create_sync(
10141014
);
10151015
}
10161016

1017-
DmSyncStart(
1017+
dmSyncId_t sync_id = DmSyncStart(
10181018
advertising_sid,
10191019
peer_address_type.value(),
10201020
peer_address.data(),
10211021
allowed_skip,
10221022
sync_timeout
10231023
);
10241024

1025+
if (sync_id == DM_SYNC_ID_NONE) {
10251026
return BLE_ERROR_NONE;
1027+
} else {
1028+
return BLE_ERROR_INTERNAL_STACK_FAILURE;
1029+
}
10261030
}
10271031

10281032
ble_error_t Gap::cancel_periodic_advertising_create_sync()

0 commit comments

Comments
 (0)