[riot-notifications] [RIOT-OS/RIOT] pkg/nimble/scanner: add function to set scan duration (#16701)

benpicco notifications at github.com
Wed Aug 18 17:57:49 CEST 2021


@benpicco commented on this pull request.



>  
     if ((argc == 2) && (memcmp(argv[1], "help", 4) == 0)) {
         printf("usage: %s [timeout in ms]\n", argv[0]);
         return 0;
     }
     if (argc >= 2) {
-        timeout = (uint32_t)(atoi(argv[1]) * 1000);
+        timeout = (uint32_t)atoi(argv[1]);

```suggestion
        timeout = atoi(argv[1]);
```

> @@ -68,6 +68,9 @@ int nimble_scanner_init(const struct ble_gap_disc_params *params,
 
 /**
  * @brief   Start scanning using timing parameters configured on initialization
+ *
+ * @note    Scanning will run for ever unless stopped or unless a different
+ *          scan duration is set with @ref nimble_scan_set_scan_duration

`nimble_scan_set_scan_duration` does not exist in doxygen

> @@ -32,13 +32,19 @@
 static nimble_scanner_cb _disc_cb = NULL;
 static struct ble_gap_disc_params _scan_params = { 0 };
 
+/* duration of the scanning procedure */
+static int32_t _scan_duration;

Why not
```suggestion
static int32_t _scan_duration = BLE_HS_FOREVER;
```

> +    _scan_duration = BLE_HS_FOREVER;
+

```suggestion
```

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/16701#pullrequestreview-733076213
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20210818/be3c84ed/attachment.htm>


More information about the notifications mailing list