[riot-notifications] [RIOT-OS/RIOT] pkg/nimble/scanner: pass adv pkt type to callback (#12174)

Hauke Petersen notifications at github.com
Thu Sep 5 16:21:04 CEST 2019


### Contribution description
The NimBLE GAP event triggered on receiving advertising packets (`BLE_GAP_EVENT_DISC`) includes a field denoting the actual type of the advertising message received. This could be a simple `ADV_IND`, but also includes packets like `SCAN_IND` or `NONCONN_IND`. Passing this information to the callback registered with the `nimble_scanner` is quite useful to filter out a certain group of packets before starting to actually looking at their payload, and therefore saving some energy.

This PR adds this packet type field as parameter to the callback function passed to the `nimble_scanner` module. The PR also includes the corresponding adaptation for the `nimble_scanlist` module, so this new information is also saved in the scanlist and printed on demand.

### Testing procedure
Build, flash, and run the `examples/nimble_scanner` application: you should see the pkt type printed out with the scan results.

### Issues/PRs references
none
You can view, comment on, or merge this pull request online at:

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

-- Commit Summary --

  * pkb/nimble/scanner: pass adv pkt type to callback
  * pkg/nimble/scanlist: save and print adv pkt type

-- File Changes --

    M pkg/nimble/scanlist/include/nimble_scanlist.h (4)
    M pkg/nimble/scanlist/nimble_scanlist.c (3)
    M pkg/nimble/scanlist/nimble_scanlist_print.c (32)
    M pkg/nimble/scanner/include/nimble_scanner.h (9)
    M pkg/nimble/scanner/nimble_scanner.c (2)

-- Patch Links --

https://github.com/RIOT-OS/RIOT/pull/12174.patch
https://github.com/RIOT-OS/RIOT/pull/12174.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/12174
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190905/79444075/attachment-0001.htm>


More information about the notifications mailing list