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

Francisco notifications at github.com
Tue Aug 3 12:02:20 CEST 2021


### Contribution description

This PR adds a function to enable setting the scan duration, similar to what is done for the autoadv module. By default it will run forever. The `nimble_scanner` example has been adapted accordingly.

### Testing procedure

`make -C examples/nimble_scanner/ flash term`

```
2021-08-03 12:00:47,058 # main(): This is RIOT! (Version: 2021.10-devel-270-g0202e2-pr_nimble_scanner_set_duration)
2021-08-03 12:00:47,059 # NimBLE Scanner Example Application
2021-08-03 12:00:47,059 # Type `scan help` for more information
> scan 1000
2021-08-03 12:01:21,922 # scan 1000
2021-08-03 12:01:22,925 # Scanning for 1000 ms now ... done
2021-08-03 12:01:22,926 # 
2021-08-03 12:01:22,926 # Results:
2021-08-03 12:01:22,935 # [ 0] e4:dd:e0:8f:73:65 (RANDOM) [IND] "RIOT-autoconn", adv_msg_cnt: 19, adv_int: 49093us, last_rssi: -55
2021-08-03 12:01:22,936 # 
> scan
2021-08-03 12:01:24,617 # scan
2021-08-03 12:01:25,620 # Scanning for 1000 ms now ... done
2021-08-03 12:01:25,621 # 
2021-08-03 12:01:25,621 # Results:
2021-08-03 12:01:25,630 # [ 0] e4:dd:e0:8f:73:65 (RANDOM) [IND] "RIOT-autoconn", adv_msg_cnt: 18, adv_int: 47056us, last_rssi: -55
2021-08-03 12:01:25,630 # 
```

You can view, comment on, or merge this pull request online at:

  https://github.com/RIOT-OS/RIOT/pull/16701

-- Commit Summary --

  * pkg/nimble/scanner: add function to set scan duration
  * examples/nimble_scanner: use nimble_scanner_ser_scan_duration

-- File Changes --

    M examples/nimble_scanner/Makefile (1)
    M examples/nimble_scanner/main.c (15)
    M pkg/nimble/scanner/include/nimble_scanner.h (12)
    M pkg/nimble/scanner/nimble_scanner.c (19)

-- Patch Links --

https://github.com/RIOT-OS/RIOT/pull/16701.patch
https://github.com/RIOT-OS/RIOT/pull/16701.diff

-- 
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20210803/5c8d5c23/attachment.htm>


More information about the notifications mailing list