translate hci conn handle to host handle for adv stop event

pull/14747/head
Paul Szczepanek 2021-06-09 14:04:47 +01:00
parent 6b930d6449
commit 963657bfb0
1 changed files with 8 additions and 1 deletions

View File

@ -869,10 +869,17 @@ void PalGap::gap_handler(const wsfMsgHdr_t *msg)
break; break;
} }
connection_handle_t connection_handle = DM_CONN_ID_NONE;
/* the way we distinguish between local close and connection is the invalid HCI conn handle */
if (evt->status == HCI_SUCCESS && evt->handle != DM_CONN_HCI_HANDLE_NONE) {
/* use the translated conn handle */
connection_handle = evt->hdr.param;
}
handler->on_advertising_set_terminated( handler->on_advertising_set_terminated(
hci_error_code_t(evt->status), hci_error_code_t(evt->status),
evt->advHandle, evt->advHandle,
evt->handle, connection_handle,
evt->numComplEvts evt->numComplEvts
); );
} break; } break;