Skip to content

Commit 0072938

Browse files
only set conn handle if adv stop event is successful
1 parent cc0f81f commit 0072938

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

connectivity/FEATURE_BLE/source/cordio/source/PalGapImpl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -871,7 +871,7 @@ void PalGap::gap_handler(const wsfMsgHdr_t *msg)
871871

872872
connection_handle_t connection_handle = DM_CONN_ID_NONE;
873873
/* the way we distinguish between local close and connection is the invalid HCI conn handle */
874-
if (evt->handle != DM_CONN_HCI_HANDLE_NONE) {
874+
if (evt->status == HCI_SUCCESS && evt->handle != DM_CONN_HCI_HANDLE_NONE) {
875875
/* use the translated conn handle */
876876
connection_handle = evt->hdr.param;
877877
}

0 commit comments

Comments
 (0)