You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by GitBox <gi...@apache.org> on 2018/12/20 15:52:32 UTC

[GitHub] andrzej-kaczmarek commented on a change in pull request #277: nimble/ll: Fix updating adv and scan response data while advertising

andrzej-kaczmarek commented on a change in pull request #277: nimble/ll: Fix updating adv and scan response data while advertising
URL: https://github.com/apache/mynewt-nimble/pull/277#discussion_r243320465
 
 

 ##########
 File path: nimble/controller/src/ble_ll_adv.c
 ##########
 @@ -3098,6 +3121,42 @@ ble_ll_adv_reschedule_event(struct ble_ll_adv_sm *advsm)
 #endif
 }
 
+static void
+ble_ll_adv_update_adv_scan_rsp_data(struct ble_ll_adv_sm *advsm)
+{
+    if (!(advsm->flags & BLE_LL_ADV_SM_FLAG_NEW_ADV_DATA) &&
+                    !(advsm->flags & BLE_LL_ADV_SM_FLAG_NEW_SCAN_RSP_DATA)) {
+        return;
+    }
+
+#if MYNEWT_VAL(BLE_LL_CFG_FEAT_LL_EXT_ADV)
+    if (advsm->aux_active) {
+        return;
+    }
+#endif
+
+    if (advsm->flags & BLE_LL_ADV_SM_FLAG_NEW_ADV_DATA){
+
+        if (advsm->updated_data) {
+            os_mbuf_free_chain(advsm->adv_data);
+            advsm->adv_data = advsm->updated_data;
+            advsm->updated_data = NULL;
+        }
+
+        advsm->flags &= ~BLE_LL_ADV_SM_FLAG_NEW_ADV_DATA;
+    } else if (advsm->flags & BLE_LL_ADV_SM_FLAG_NEW_SCAN_RSP_DATA) {
+        os_mbuf_free_chain(advsm->scan_rsp_data);
+        advsm->scan_rsp_data = advsm->updated_data;
+        advsm->updated_data = NULL;
+        advsm->flags &= ~BLE_LL_ADV_SM_FLAG_NEW_SCAN_RSP_DATA;
+    }
+
+#if MYNEWT_VAL(BLE_LL_CFG_FEAT_LL_EXT_ADV)
+        /* DID shall be updated when host provides new advertising data */
 
 Review comment:
   indentation

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services