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

 ##########
 File path: nimble/host/src/ble_gap.c
 ##########
 @@ -1315,6 +1333,112 @@ ble_gap_rx_adv_set_terminated(struct 
hci_le_adv_set_terminated *evt)
 }
 #endif
 
+/* Periodic adv events */
+#if MYNEWT_VAL(BLE_EXT_ADV) && MYNEWT_VAL(BLE_PERIODIC_ADV)
+void
+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_sync * psync;
+
+    memset(&event, 0, sizeof event);
+
+    /* There must be memory for psync as the check was done when creating
+     * sync
+     */
+    psync = ble_hs_periodic_sync_alloc();
+    BLE_HS_DBG_ASSERT(psync != NULL);
 
 Review comment:
   It is good oto have BLE_HS_DBG_ASSERT here but if it is not enabled we 
should also handle out of memory also without it. Please return when `psync` is 
NULL

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