1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
RIOT/pkg/nimble/autoadv
2023-02-02 15:45:00 +01:00
..
include pkg/nimble/autoadv: add support for ext_adv 2022-04-27 08:22:58 +02:00
Makefile pkg/nimble/autoadv: add shell 2022-04-27 10:10:32 +02:00
nimble_autoadv.c pkg/nimble/autoadv: fix flag comparisons 2023-02-02 15:45:00 +01:00
README.md pkg/nimble/autoadv: prefix configurations with CONFIG_ 2022-04-25 08:43:51 +02:00
shell.c sys/shell_commands: convert to SHELL_COMMAND() 2022-06-07 09:25:04 +02:00

NimBLE automated advertisements

Module for automated bluetooth advertising. Advertising is restarted on disconnect events automatically. Defaults to the following characteristics: - General discoverable mode (BLE_GAP_DISC_MODE_GEN) - Undirected connectable mode (BLE_GAP_CONN_MODE_UND) - No expiration (BLE_HS_FOREVER) - No name

It can be enabled by adding

USEMODULE += nimble_autoadv

to your makefile.

If your application is calling functions from nimble, e.g. ble_svc_gap_device_name_set(), CONFIG_NIMBLE_AUTOADV_START_MANUALLY should be set to 1 with the following line in your Makefile:

CFLAGS += -DCONFIG_NIMBLE_AUTOADV_START_MANUALLY=1

Then the application should call nimble_autoadv_adv_start() after all of its nimble calls to prevent errors like BLE_HS_EBUSY.

To specify a device name add the following line to your Makefile:

CFLAGS += -DCONFIG_NIMBLE_AUTOADV_DEVICE_NAME='"Riot OS device"'

By the default, in the advertised packet, the module includes the advertising Flags data type. According to Bluetooth Core Specification Supplement (see §1.3.1)

The Flags data type shall be included when any of the Flag bits are non-zero and the advertising packet is connectable, otherwise the Flags data type may be omitted.

If your application is not connectable (eg. a temperature sensor advertising its current value), you might want omit this flag by clearing the CONFIG_NIMBLE_AUTOADV_FLAG_FIELD when including this module:

CFLAGS += -DCONFIG_NIMBLE_AUTOADV_FLAG_FIELD=0

This will grant three extra bytes in the advertisement packet.