Skip to content

Commit 11ac1e0

Browse files
paul-szczepanek-armCruz Monrreal II
authored andcommitted
copy periodic payload
1 parent 8a3b5f4 commit 11ac1e0

File tree

2 files changed

+3
-3
lines changed
  • features/FEATURE_BLE/targets/TARGET_CORDIO/stack/cordio_stack/ble-host/sources/stack/dm

2 files changed

+3
-3
lines changed

features/FEATURE_BLE/targets/TARGET_CORDIO/stack/cordio_stack/ble-host/sources/stack/dm/dm_adv.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ typedef struct
151151
uint8_t advHandle;
152152
uint8_t op;
153153
uint8_t len;
154-
uint8_t *pData;
154+
uint8_t pData[];
155155
} dmAdvPerApiSetData_t;
156156

157157
/* Data structure for DM_ADV_PER_MSG_API_START */

features/FEATURE_BLE/targets/TARGET_CORDIO/stack/cordio_stack/ble-host/sources/stack/dm/dm_adv_ae.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1634,13 +1634,13 @@ void DmPerAdvSetData(uint8_t advHandle, uint8_t op, uint8_t len, uint8_t *pData)
16341634
WSF_ASSERT(advHandle < DM_NUM_ADV_SETS);
16351635
WSF_ASSERT(len <= HCI_PER_ADV_DATA_LEN);
16361636

1637-
if ((pMsg = WsfMsgAlloc(sizeof(dmAdvPerApiSetData_t))) != NULL)
1637+
if ((pMsg = WsfMsgAlloc(sizeof(dmAdvPerApiSetData_t) + len)) != NULL)
16381638
{
16391639
pMsg->hdr.event = DM_ADV_PER_MSG_API_SET_DATA;
16401640
pMsg->advHandle = advHandle;
16411641
pMsg->op = op;
16421642
pMsg->len = len;
1643-
pMsg->pData = pData;
1643+
memcpy(pMsg->pData, pData, len);
16441644
WsfMsgSend(dmCb.handlerId, pMsg);
16451645
}
16461646
}

0 commit comments

Comments
 (0)