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

 ##########
 File path: nimble/host/src/ble_gap.c
 ##########
 @@ -2919,13 +3049,533 @@ ble_gap_ext_adv_remove(uint8_t instance)
     return 0;
 }
 
+#if MYNEWT_VAL(BLE_PERIODIC_ADV)
+static int
+ble_gap_periodic_adv_params_tx(uint8_t instance,
+        const struct ble_gap_periodic_adv_params *params)
+
+{
+    struct hci_periodic_adv_params hci_adv_params;
+    uint8_t buf[BLE_HCI_LE_SET_PERIODIC_ADV_PARAMS_LEN];
+    int rc;
+
+    memset(&hci_adv_params, 0, sizeof(hci_adv_params));
+
+    if (params->include_tx_power) {
+        hci_adv_params.properties |= 
BLE_HCI_LE_SET_PERIODIC_ADV_PROP_INC_TX_PWR;
+    }
+
+    /* Fill optional fields if application did not specify them. */
+    if (params->itvl_min == 0 && params->itvl_max == 0) {
+        hci_adv_params.min_interval = 30 / 1.25;   //30 ms
+        hci_adv_params.max_interval = 60 / 1.25;   //150 ms
 
 Review comment:
   comment does not match. BTW. Maybe we could have defines for default ones?

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