Skip to content

Commit e247852

Browse files
reinstate fixes
1 parent 0c85578 commit e247852

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/cfg/cfg_stack.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,13 +86,13 @@ extern "C" {
8686

8787
/*! \brief Number of supported advertising sets: must be set to 1 for legacy advertising */
8888
#ifndef DM_NUM_ADV_SETS
89-
#define DM_NUM_ADV_SETS 1
89+
#define DM_NUM_ADV_SETS 3
9090
#endif
9191

9292
/*! \brief Number of scanner and initiator PHYs (LE 1M, LE 2M and LE Coded): must be set to 1 for
9393
legacy scanner and initiator */
9494
#ifndef DM_NUM_PHYS
95-
#define DM_NUM_PHYS 1
95+
#define DM_NUM_PHYS 3
9696
#endif
9797
/**@}*/
9898

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,14 +153,14 @@ void DmAdvSetData(uint8_t advHandle, uint8_t op, uint8_t location, uint8_t len,
153153
WSF_ASSERT((location == DM_DATA_LOC_SCAN) || (location == DM_DATA_LOC_ADV));
154154
WSF_ASSERT(advHandle < DM_NUM_ADV_SETS);
155155

156-
if ((pMsg = WsfMsgAlloc(sizeof(dmAdvApiSetData_t))) != NULL)
156+
if ((pMsg = WsfMsgAlloc(sizeof(dmAdvApiSetData_t) + len)) != NULL)
157157
{
158158
pMsg->hdr.event = DM_ADV_MSG_API_SET_DATA;
159159
pMsg->advHandle = advHandle;
160160
pMsg->op = op;
161161
pMsg->location = location;
162162
pMsg->len = len;
163-
pMsg->pData = pData;
163+
memcpy(pMsg->pData, pData, len);
164164
WsfMsgSend(dmCb.handlerId, pMsg);
165165
}
166166
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ typedef struct
101101
uint8_t op;
102102
uint8_t location;
103103
uint8_t len;
104-
uint8_t *pData;
104+
uint8_t pData[];
105105
} dmAdvApiSetData_t;
106106

107107
/* Data structure for DM_ADV_MSG_API_START */
@@ -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/ble-host/sources/stack/dm/dm_adv_ae.c

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

1663-
if ((pMsg = WsfMsgAlloc(sizeof(dmAdvPerApiSetData_t))) != NULL)
1663+
if ((pMsg = WsfMsgAlloc(sizeof(dmAdvPerApiSetData_t) + len)) != NULL)
16641664
{
16651665
pMsg->hdr.event = DM_ADV_PER_MSG_API_SET_DATA;
16661666
pMsg->advHandle = advHandle;
16671667
pMsg->op = op;
16681668
pMsg->len = len;
1669-
pMsg->pData = pData;
1669+
memcpy(pMsg->pData, pData, len);
16701670
WsfMsgSend(dmCb.handlerId, pMsg);
16711671
}
16721672
}

0 commit comments

Comments
 (0)