Skip to content

Commit 2bbc8a0

Browse files
committed
BLE: remove limitation in the Cordio to update adv payload
Nothing in the Bluetooth standard prevents update of advertising payload while advertising is active. This limitation wasn't present in previous version of the stack and is not present for extended advertising.
1 parent c7759fe commit 2bbc8a0

File tree

1 file changed

+7
-10
lines changed
  • features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/dm

1 file changed

+7
-10
lines changed

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

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -140,17 +140,14 @@ void dmAdvActSetData(dmAdvMsg_t *pMsg)
140140

141141
DM_TRACE_INFO1("dmAdvActSetData: state: %d", dmAdvCb.advState[DM_ADV_HANDLE_DEFAULT]);
142142

143-
if (dmAdvCb.advState[DM_ADV_HANDLE_DEFAULT] == DM_ADV_STATE_IDLE)
143+
/* set new data in HCI */
144+
if (pMsg->apiSetData.location == DM_DATA_LOC_ADV)
144145
{
145-
/* set new data in HCI */
146-
if (pMsg->apiSetData.location == DM_DATA_LOC_ADV)
147-
{
148-
HciLeSetAdvDataCmd(pMsg->apiSetData.len, pMsg->apiSetData.pData);
149-
}
150-
else
151-
{
152-
HciLeSetScanRespDataCmd(pMsg->apiSetData.len, pMsg->apiSetData.pData);
153-
}
146+
HciLeSetAdvDataCmd(pMsg->apiSetData.len, pMsg->apiSetData.pData);
147+
}
148+
else
149+
{
150+
HciLeSetScanRespDataCmd(pMsg->apiSetData.len, pMsg->apiSetData.pData);
154151
}
155152
}
156153

0 commit comments

Comments
 (0)