Skald, who advertises to the world¶
Skald, a minimalistic BLE advertising stack.
About¶
Skald is a very minimalistic BLE implementation, implementing the broadcaster
role only. With this focus, the stack allows for setting up different kind of beacons using an extremely low memory footprint.
Design Decisions and Limitations¶
- support for local addresses only (using
luid
to generate them) - advertising interval is configured during compile time, override by setting
CFLAGS+=-DSKALD_INTERVAL=xxx
- advertising channels are configured during compile time, override by setting
CFLAGS+=-DSKALD_ADV_CHAN={37,39}
Implementation state¶
Supported:
- advertising of custom GAP payloads
- iBeacon (full support)
- Eddystone (partly supported)
Limitations:
- currently Skald supports random static addresses only (generated using the
luid
module)
-
void
skald_init
(void)¶ Initialize Skald and the underlying radio.
-
void
skald_adv_start
(skald_ctx_t * ctx)¶ Start advertising the given packet.
The packet will be send out each advertising interval (see SKALD_INTERVAL) on each of the defined advertising channels (see SKALD_ADV_CHAN).
Parameters
ctx: start advertising this context
-
void
skald_adv_stop
(skald_ctx_t * ctx)¶ Stop the ongoing advertisement.
Parameters
ctx: stop advertising this context
-
void
skald_generate_random_addr
(uint8_t * buf)¶ Generate a random public address.
Note
buf
must be able to hold BLE_ADDR_LEN (6) bytesParameters
buf: the generated address is written to this buffer
-
SKALD_INTERVAL
¶ Static advertising interval.
1
(1 * US_PER_SEC)
-
SKALD_ADV_CHAN
¶ Static list of used advertising channels.
1
{ 37, 38, 39 }
-
struct
skald_uuid_t
¶ UUID representation format used by Skald.
-
uint8_t
u8
()¶ UUID with byte-wise access.
-
uint8_t
-
struct
skald_ctx_t
¶ Advertising context holding the advertising data and state.
-
netdev_ble_pkt_t
pkt
¶ packet holding the advertisement (GAP) data
-
xtimer.h::xtimer_t
timer
¶ timer for scheduling advertising events
-
uint32_t
last
¶ last timer trigger (for offset compensation)
-
uint8_t
cur_chan
¶ keep track of advertising channels
-
netdev_ble_pkt_t