Dawn Framework 1.0
Universal data acquisition framework for embedded systems
adv.hxx
1// dawn/include/dawn/proto/nimble/adv.hxx
2//
3// SPDX-License-Identifier: Apache-2.0
4//
5
6#pragma once
7
8#include "dawn/debug.hxx"
9#include "dawn/porting/config.hxx"
10#include "host/ble_gap.h"
11
12namespace dawn
13{
22{
23public:
24 static constexpr size_t GAPNAME_MAX =
25 CONFIG_DAWN_PROTO_NIMBLE_GAPNAME_MAX;
26 static_assert(GAPNAME_MAX <= 26, "GAP name must fit in legacy advertising data");
27 static uint8_t ownAddrType;
28 static char gapName[GAPNAME_MAX + 1];
29
30 CProtoNimbleAdv() = default;
31 ~CProtoNimbleAdv() = default;
32
33 static void startAdvertise();
34 static void setGapName(const char *name, uint8_t len);
35
36private:
37 static void putAd(uint8_t ad_type, uint8_t ad_len, const void *ad, uint8_t *buf, uint8_t *len);
38
39 static void updateAd();
40 static int gapEventCb(struct ble_gap_event *event, void *arg);
41};
42
43} // Namespace dawn
BLE advertisement management and GAP interface.
Definition adv.hxx:22
static size_t GAPNAME_MAX
Max GAP device name length (excluding null).
Definition adv.hxx:24
static char gapName[GAPNAME_MAX+1]
GAP device name visible during BLE discovery.
Definition adv.hxx:28
static uint8_t ownAddrType
BLE device address type (random/static/public).
Definition adv.hxx:27
Out-of-tree user-extension hooks for Dawn.
Definition bindable.hxx:13