skald.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2018 Freie Universität Berlin
3  *
4  * This file is subject to the terms and conditions of the GNU Lesser
5  * General Public License v2.1. See the file LICENSE in the top level
6  * directory for more details.
7  */
8 
9 #pragma once
10 
46 #include <stdint.h>
47 
48 #include "ztimer.h"
49 #include "net/ble.h"
50 #include "net/netdev/ble.h"
51 
52 #ifdef __cplusplus
53 extern "C" {
54 #endif
55 
59 #ifndef SKALD_ADV_CHAN
60 #define SKALD_ADV_CHAN { 37, 38, 39 }
61 #endif
62 
66 typedef struct {
67  uint8_t u8[16];
68 } skald_uuid_t;
69 
73 typedef struct {
77  uint8_t cur_chan;
78  uint32_t adv_itvl_ms;
79 } skald_ctx_t;
80 
84 void skald_init(void);
85 
95 
102 
110 void skald_generate_random_addr(uint8_t *buf);
111 
112 #ifdef __cplusplus
113 }
114 #endif
115 
BLE specific adaption for the Netdev API.
void skald_adv_start(skald_ctx_t *ctx)
Start advertising the given packet.
void skald_init(void)
Initialize Skald and the underlying radio.
void skald_generate_random_addr(uint8_t *buf)
Generate a random public address.
void skald_adv_stop(skald_ctx_t *ctx)
Stop the ongoing advertisement.
uint32_t ztimer_now_t
type for ztimer_now() result
Definition: ztimer.h:311
BLE packet structure (as defined by the BLE standard)
Definition: ble.h:103
Advertising context holding the advertising data and state.
Definition: skald.h:73
ztimer_t timer
timer for scheduling advertising events
Definition: skald.h:75
uint32_t adv_itvl_ms
advertising interval [ms]
Definition: skald.h:78
uint8_t cur_chan
keep track of advertising channels
Definition: skald.h:77
netdev_ble_pkt_t pkt
packet holding the advertisement (GAP) data
Definition: skald.h:74
ztimer_now_t last
last timer trigger (for offset compensation)
Definition: skald.h:76
UUID representation format used by Skald.
Definition: skald.h:66
ztimer structure
Definition: ztimer.h:319
General BLE values as defined by the BT standard.
ztimer API