From 2bbc8a0baed5ab20173d4408d90c304e890abdbd Mon Sep 17 00:00:00 2001 From: Vincent Coubard Date: Fri, 29 May 2020 17:48:22 +0100 Subject: [PATCH] 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. --- .../ble-host/sources/stack/dm/dm_adv_leg.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_adv_leg.c b/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_adv_leg.c index ae45fc603b..f71bcb7921 100644 --- a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_adv_leg.c +++ b/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_adv_leg.c @@ -140,17 +140,14 @@ void dmAdvActSetData(dmAdvMsg_t *pMsg) DM_TRACE_INFO1("dmAdvActSetData: state: %d", dmAdvCb.advState[DM_ADV_HANDLE_DEFAULT]); - if (dmAdvCb.advState[DM_ADV_HANDLE_DEFAULT] == DM_ADV_STATE_IDLE) + /* set new data in HCI */ + if (pMsg->apiSetData.location == DM_DATA_LOC_ADV) { - /* set new data in HCI */ - if (pMsg->apiSetData.location == DM_DATA_LOC_ADV) - { - HciLeSetAdvDataCmd(pMsg->apiSetData.len, pMsg->apiSetData.pData); - } - else - { - HciLeSetScanRespDataCmd(pMsg->apiSetData.len, pMsg->apiSetData.pData); - } + HciLeSetAdvDataCmd(pMsg->apiSetData.len, pMsg->apiSetData.pData); + } + else + { + HciLeSetScanRespDataCmd(pMsg->apiSetData.len, pMsg->apiSetData.pData); } }