rymanluk commented on a change in pull request #283: Adding Periodic 
Advertising Feature
URL: https://github.com/apache/mynewt-nimble/pull/283#discussion_r250689904
 
 

 ##########
 File path: nimble/host/src/ble_gap.c
 ##########
 @@ -1388,23 +1410,33 @@ ble_gap_rx_per_adv_rpt(struct hci_le_subev_per_adv_rpt 
*evt) {
 }
 
 void
-ble_gap_rx_per_adv_sync_lost(struct hci_le_subev_per_adv_sync_lost *evt) {
-
+ble_gap_rx_periodic_adv_sync_lost(
+               struct hci_le_subev_periodic_adv_sync_lost *evt) {
        struct ble_gap_event event;
        struct ble_gap_master_state state;
+    struct ble_hs_periodic_disc *pdisc;
 
        memset(&event, 0, sizeof event);
 
-       event.type = BLE_GAP_EVENT_PER_ADV_SYNC_LOST;
+       event.type = BLE_GAP_EVENT_PERIODIC_ADV_SYNC_LOST;
        event.per_adv_sync_lost.sync_handle = evt->sync_handle;
 
+       ble_hs_lock();
+       /* The handle must be in the list */
+       pdisc = ble_hs_periodic_disc_find_assert(evt->sync_handle);
+
+       /* Remove the handle from the list */
+       ble_hs_periodic_disc_remove(pdisc);
 
 Review comment:
   maybe `ble_hs_periodic_sync_remove` and the same with other functions related

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to