From df443c20ca533573b5b9aa0fff7f7768fb78f3e8 Mon Sep 17 00:00:00 2001 From: paul-szczepanek-arm <33840200+paul-szczepanek-arm@users.noreply.github.com> Date: Thu, 6 Dec 2018 17:54:13 +0000 Subject: [PATCH] copy periodic payload --- .../stack/cordio_stack/ble-host/sources/stack/dm/dm_adv.h | 2 +- .../stack/cordio_stack/ble-host/sources/stack/dm/dm_adv_ae.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/cordio_stack/ble-host/sources/stack/dm/dm_adv.h b/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/cordio_stack/ble-host/sources/stack/dm/dm_adv.h index 123c78b8f5..f1269ebb23 100644 --- a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/cordio_stack/ble-host/sources/stack/dm/dm_adv.h +++ b/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/cordio_stack/ble-host/sources/stack/dm/dm_adv.h @@ -151,7 +151,7 @@ typedef struct uint8_t advHandle; uint8_t op; uint8_t len; - uint8_t *pData; + uint8_t pData[]; } dmAdvPerApiSetData_t; /* Data structure for DM_ADV_PER_MSG_API_START */ diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/cordio_stack/ble-host/sources/stack/dm/dm_adv_ae.c b/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/cordio_stack/ble-host/sources/stack/dm/dm_adv_ae.c index 0edc91e329..eb48e3ac1d 100644 --- a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/cordio_stack/ble-host/sources/stack/dm/dm_adv_ae.c +++ b/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/cordio_stack/ble-host/sources/stack/dm/dm_adv_ae.c @@ -1634,13 +1634,13 @@ void DmPerAdvSetData(uint8_t advHandle, uint8_t op, uint8_t len, uint8_t *pData) WSF_ASSERT(advHandle < DM_NUM_ADV_SETS); WSF_ASSERT(len <= HCI_PER_ADV_DATA_LEN); - if ((pMsg = WsfMsgAlloc(sizeof(dmAdvPerApiSetData_t))) != NULL) + if ((pMsg = WsfMsgAlloc(sizeof(dmAdvPerApiSetData_t) + len)) != NULL) { pMsg->hdr.event = DM_ADV_PER_MSG_API_SET_DATA; pMsg->advHandle = advHandle; pMsg->op = op; pMsg->len = len; - pMsg->pData = pData; + memcpy(pMsg->pData, pData, len); WsfMsgSend(dmCb.handlerId, pMsg); } }