haukepetersen opened a new pull request #840:
URL: https://github.com/apache/mynewt-nimble/pull/840


   I got a little tired of writing statements like `_adv_params.itvl_min = 
((XXX * 1000) / BLE_HCI_ADV_ITVL);` in my code ;-) So instead I find writing 
`_adv_params.itvl_min = BLE_GAP_ADV_ITVL_MS(XXX)` easier to read and less error 
prone. So I introduced some of these convenience macros to `host/ble_gap.,h`.
   
   For verification I printed the effected values to STDIO in a simple test 
application:
   ```
   Before (on master):
   2020-07-06 09:47:08,247 # You are running RIOT on a(n) nrf52dk board.
   2020-07-06 09:47:08,248 # This board features a(n) nrf52 MCU.
   2020-07-06 09:47:08,248 # BLE_GAP_ADV_FAST_INTERVAL1_MIN 48
   2020-07-06 09:47:08,248 # BLE_GAP_ADV_FAST_INTERVAL1_MAX 96
   2020-07-06 09:47:08,249 # BLE_GAP_ADV_FAST_INTERVAL2_MIN 160
   2020-07-06 09:47:08,249 # BLE_GAP_ADV_FAST_INTERVAL2_MAX 240
   2020-07-06 09:47:08,249 # BLE_GAP_SCAN_FAST_INTERVAL_MIN 48
   2020-07-06 09:47:08,250 # BLE_GAP_SCAN_FAST_INTERVAL_MAX 96
   2020-07-06 09:47:08,250 # BLE_GAP_LIM_DISC_SCAN_INT      18
   2020-07-06 09:47:08,250 # BLE_GAP_LIM_DISC_SCAN_WINDOW   18
   2020-07-06 09:47:08,251 # BLE_GAP_SCAN_FAST_WINDOW       48
   2020-07-06 09:47:08,251 # BLE_GAP_SCAN_SLOW_INTERVAL1    2048
   2020-07-06 09:47:08,252 # BLE_GAP_SCAN_SLOW_WINDOW1      18
   2020-07-06 09:47:08,252 # BLE_GAP_INITIAL_CONN_ITVL_MIN  24
   2020-07-06 09:47:08,252 # BLE_GAP_INITIAL_CONN_ITVL_MAX  40
   
   With this PR:
   2020-07-06 09:51:40,031 # BLE_GAP_ADV_FAST_INTERVAL1_MIN 48
   2020-07-06 09:51:40,031 # BLE_GAP_ADV_FAST_INTERVAL1_MAX 96
   2020-07-06 09:51:40,032 # BLE_GAP_ADV_FAST_INTERVAL2_MIN 160
   2020-07-06 09:51:40,032 # BLE_GAP_ADV_FAST_INTERVAL2_MAX 240
   2020-07-06 09:51:40,032 # BLE_GAP_SCAN_FAST_INTERVAL_MIN 48
   2020-07-06 09:51:40,033 # BLE_GAP_SCAN_FAST_INTERVAL_MAX 96
   2020-07-06 09:51:40,033 # BLE_GAP_LIM_DISC_SCAN_INT      18
   2020-07-06 09:51:40,034 # BLE_GAP_LIM_DISC_SCAN_WINDOW   18
   2020-07-06 09:51:40,034 # BLE_GAP_SCAN_FAST_WINDOW       48
   2020-07-06 09:51:40,034 # BLE_GAP_SCAN_SLOW_INTERVAL1    2048
   2020-07-06 09:51:40,035 # BLE_GAP_SCAN_SLOW_WINDOW1      18
   2020-07-06 09:51:40,035 # BLE_GAP_INITIAL_CONN_ITVL_MIN  24
   2020-07-06 09:51:40,035 # BLE_GAP_INITIAL_CONN_ITVL_MAX  40
   ```
   So should still be in order.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to