[riot-notifications] [RIOT-OS/RIOT] nimble/netif: add support for BT5 PHY modes (#16860)

Hauke Petersen notifications at github.com
Thu Sep 16 10:51:20 CEST 2021

### Contribution description
This PR adds support for the additional BLE PHY modes that were introduced with Bluetooth 5, the 2Mbit mode as well as the Coded (long range) PHY  mode. 

To use these modes, extended advertisements are required by the Bluetooth standard. Once this mode is enabled in NimBLE, NimBLE switches to a different set of GAP API calls for scanning and connecting. To keep the `nimble_netif` API independent form these underlying API switches, two NImBLE-independent configuration structs used by the `nimble_netif_connect()` and `nimble_netif_accept()` are introduced. This way `nimble_netif` can transparently used with or without enabling extended advertising mode (`MYNEWT_VAL_BLE_EXT_ADV`).

These small API changes to those 2 functions have the further advantage, that the API can be extended in the future without breaking it, again :-)

This PR is rebased on a bunch of fixes and foremost on the extended `nimble_scanner` PR, as the entirety of these changes is useful for testing and they all play together...

### Testing procedure
Run e.g. `gnrc_networking` on two boards with IP over BLE support. Use the build-in shell commands (`ble adv `, `ble_adv_ext`, `ble_adv_dir`) to advertise in different modes, while using the `ble scan` shell command to verify the selected modes. Also establish connections between the nodes using different PHY modes, e.g. `ble connect nodename 1000 CODED`

NOTE: the Coded (long-range) PHY mode is not supported by the `nrf52832` line of CPUs...

### Issues/PRs references
rebased on top of #16838, #16839, #16843, and #16859

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


-- Commit Summary --

  * pkg/nimble/netif: migrate return values to errno
  * pkg/nimble/netif_conn: fix doxygen
  * pkg/nimble/netif: fix doxygen leftover
  * shell/sc_nimble_netif: adapt to new return values
  * nimble/rpble: adapt to new return values
  * nimble/autoconn: adapt to new return values
  * nimble/scanner: rename and optimize status func
  * nimble/scanner: migrate to use errno return values
  * shell/sc_nimble_netif: adapt to scanner API change
  * cpu/nrf52: add features for coded and 2Mbit PHYs
  * pkg/nimble: improve readablility in Makefile.dep
  * pkg/nimble: add config options for BLE5 PHYs
  * pkg/nimble/scanner: rework to enable BLE5 scanning
  * pkg/nimble/scanlist: adapt to scanner changes
  * examples/nimble_scanner: adapt to scanner changes
  * prototype working
  * nimble/addr: fix byte-order and string termination
  * fixup! nimble/scanner: fix legacy ADV detection for ext adv
  * fixup! nimble/scanlist: optimize phy code and use ADV_IND
  * nimble/scanlist: use nimble_addr_print()
  * pkg/nimble/nimble_riot.h: add PHY mode defines
  * nimble/netif: enable PHY mode selection and EXT ADV
  * shell/sc_nimble_netif: expose PHY options

-- File Changes --

    M cpu/nrf52/Makefile.features (7)
    M examples/gnrc_networking/Makefile (10)
    M examples/nimble_scanner/main.c (27)
    M makefiles/pseudomodules.inc.mk (3)
    M pkg/nimble/Makefile (2)
    M pkg/nimble/Makefile.dep (18)
    M pkg/nimble/Makefile.include (35)
    M pkg/nimble/addr/nimble_addr.c (6)
    M pkg/nimble/autoconn/nimble_autoconn.c (2)
    M pkg/nimble/contrib/include/nimble_riot.h (10)
    M pkg/nimble/netif/include/nimble_netif.h (112)
    M pkg/nimble/netif/include/nimble_netif_conn.h (3)
    M pkg/nimble/netif/nimble_netif.c (263)
    M pkg/nimble/netif/nimble_netif_conn.c (4)
    M pkg/nimble/rpble/nimble_rpble.c (2)
    M pkg/nimble/scanlist/include/nimble_scanlist.h (6)
    M pkg/nimble/scanlist/nimble_scanlist.c (7)
    M pkg/nimble/scanlist/nimble_scanlist_print.c (43)
    M pkg/nimble/scanner/include/nimble_scanner.h (92)
    M pkg/nimble/scanner/nimble_scanner.c (102)
    M sys/shell/commands/sc_nimble_netif.c (405)
    A tests/nimble_netif_ext/Makefile (22)
    A tests/nimble_netif_ext/Makefile.ci (4)
    A tests/nimble_netif_ext/main.c (45)

-- Patch Links --


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20210916/fc1d0b31/attachment-0001.htm>

More information about the notifications mailing list