Skip to content

Commit 963657b

Browse files
translate hci conn handle to host handle for adv stop event
1 parent 6b930d6 commit 963657b

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -869,10 +869,17 @@ void PalGap::gap_handler(const wsfMsgHdr_t *msg)
869869
break;
870870
}
871871

872+
connection_handle_t connection_handle = DM_CONN_ID_NONE;
873+
/* the way we distinguish between local close and connection is the invalid HCI conn handle */
874+
if (evt->status == HCI_SUCCESS && evt->handle != DM_CONN_HCI_HANDLE_NONE) {
875+
/* use the translated conn handle */
876+
connection_handle = evt->hdr.param;
877+
}
878+
872879
handler->on_advertising_set_terminated(
873880
hci_error_code_t(evt->status),
874881
evt->advHandle,
875-
evt->handle,
882+
connection_handle,
876883
evt->numComplEvts
877884
);
878885
} break;

0 commit comments

Comments
 (0)