[riot-notifications] [RIOT-OS/RIOT] sys/nimble_autoadv: add new module (#13425)

Hendrik van Essen notifications at github.com
Wed Nov 4 16:12:55 CET 2020

> Do you know what was allowing this in master version of examples/nimble_gatt?

The restart of advertising is done by the `_gap_event_cb` callback. It's given as parameter to `ble_gap_adv_start` and eventually ends up being used within the nimble stack. If something changes, the callback receives e.g. `BLE_GAP_EVENT_CONNECT` and starts advertising again.

In https://github.com/RIOT-OS/RIOT/pull/13506/commits/15135265be56df715b556f9279848bdf7749a394 by using the new `nimble_autoadv` module I'm able to remove `gap_event_cb` and `start_advertise`.
- `gap_event_cb`@`nimble_gatt` is mapped to `_gap_event_cb`@`nimble_autoadv` (exactly the same)
- `start_advertise`@`nimble_gatt` is mapped to `nimble_autoadv_start`@`nimble_autoadv`
  - `nimble_autoadv_start` is by default called automatically by `nimble_autoadv_init` via `auto_init.c` by `nimble_riot_init`

> are you just changing the logic that is causing the device to resume advertising after a disconnect?

I would describe it like the following. `nimble_autoadv` is outsourcing the logic to a separate module so the logic for restarting the advertising is reusable for other applications. They don't need to define the same simple callback all over again. But by making it a module we also add some features so it's not stuck to a set of settings.

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/20201104/e083ba81/attachment.htm>

More information about the notifications mailing list