Skip to content

Commit

Permalink
reinstate fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
paul-szczepanek-arm committed Mar 1, 2019
1 parent 0c85578 commit e247852
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
Expand Up @@ -86,13 +86,13 @@ extern "C" {

/*! \brief Number of supported advertising sets: must be set to 1 for legacy advertising */
#ifndef DM_NUM_ADV_SETS
#define DM_NUM_ADV_SETS 1
#define DM_NUM_ADV_SETS 3
#endif

/*! \brief Number of scanner and initiator PHYs (LE 1M, LE 2M and LE Coded): must be set to 1 for
legacy scanner and initiator */
#ifndef DM_NUM_PHYS
#define DM_NUM_PHYS 1
#define DM_NUM_PHYS 3
#endif
/**@}*/

Expand Down
Expand Up @@ -153,14 +153,14 @@ void DmAdvSetData(uint8_t advHandle, uint8_t op, uint8_t location, uint8_t len,
WSF_ASSERT((location == DM_DATA_LOC_SCAN) || (location == DM_DATA_LOC_ADV));
WSF_ASSERT(advHandle < DM_NUM_ADV_SETS);

if ((pMsg = WsfMsgAlloc(sizeof(dmAdvApiSetData_t))) != NULL)
if ((pMsg = WsfMsgAlloc(sizeof(dmAdvApiSetData_t) + len)) != NULL)
{
pMsg->hdr.event = DM_ADV_MSG_API_SET_DATA;
pMsg->advHandle = advHandle;
pMsg->op = op;
pMsg->location = location;
pMsg->len = len;
pMsg->pData = pData;
memcpy(pMsg->pData, pData, len);
WsfMsgSend(dmCb.handlerId, pMsg);
}
}
Expand Down
Expand Up @@ -101,7 +101,7 @@ typedef struct
uint8_t op;
uint8_t location;
uint8_t len;
uint8_t *pData;
uint8_t pData[];
} dmAdvApiSetData_t;

/* Data structure for DM_ADV_MSG_API_START */
Expand Down Expand Up @@ -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 */
Expand Down
Expand Up @@ -1660,13 +1660,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);
}
}
Expand Down

0 comments on commit e247852

Please sign in to comment.