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

 ##########
 File path: nimble/host/src/ble_gap.c
 ##########
 @@ -1336,14 +1336,36 @@ ble_gap_rx_adv_set_terminated(struct 
hci_le_adv_set_terminated *evt)
 /* Periodic adv events */
 #if MYNEWT_VAL(BLE_EXT_ADV) && MYNEWT_VAL(BLE_PERIODIC_ADV)
 void
-ble_gap_rx_per_adv_sync_estab(struct hci_le_subev_per_adv_sync_estab *evt)
+ble_gap_rx_peroidic_adv_sync_estab(
+               struct hci_le_subev_periodic_adv_sync_estab *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_ESTAB;
+       /* There must be memory for pdisc as the check was done when creating
+        * sync
+        */
+       pdisc = ble_hs_periodic_disc_alloc(evt->sync_handle);
 
 Review comment:
   sync_handle seems to be written to pdisc twice. I would remove sync_handle 
from `ble_hs_periodic_disc_alloc` 

----------------------------------------------------------------
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