Skip to content

Commit afeb696

Browse files
fix CORDIO not passing the conn id in param for adv stop event
the hci handle is different from host handle, this is how it's done in conn open event, we carry the conn id in the hdr.param
1 parent 963657b commit afeb696

File tree

1 file changed

+8
-0
lines changed
  • connectivity/FEATURE_BLE/libraries/cordio_stack/ble-host/sources/stack/dm

1 file changed

+8
-0
lines changed

connectivity/FEATURE_BLE/libraries/cordio_stack/ble-host/sources/stack/dm/dm_adv_ae.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
#include "dm_adv.h"
3232
#include "dm_dev.h"
3333
#include "dm_main.h"
34+
#include "dm_conn.h"
3435

3536
/**************************************************************************************************
3637
Macros
@@ -1374,6 +1375,13 @@ void dmExtAdvHciHandler(hciEvt_t *pEvent)
13741375
if (!DM_ADV_CONN_DIRECTED(advType))
13751376
{
13761377
pEvent->hdr.event = DM_ADV_SET_STOP_IND;
1378+
if (pEvent->leAdvSetTerm.status == HCI_SUCCESS) {
1379+
/* translate the handle to conn id */
1380+
dmConnCcb_t* ccb = dmConnCcbByHandle(pEvent->leAdvSetTerm.handle);
1381+
if (ccb) {
1382+
pEvent->hdr.param = ccb->connId;
1383+
}
1384+
}
13771385
(*dmCb.cback)((dmEvt_t *) pEvent);
13781386
}
13791387
/* else if low duty cycle directed advertising failed to create connection */

0 commit comments

Comments
 (0)