Dawn Framework
1.0
Universal data acquisition framework for embedded systems
dawn
include
dawn
proto
nimble
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
12
namespace
dawn
13
{
21
class
CProtoNimbleAdv
22
{
23
public
:
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
36
private
:
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
dawn::CProtoNimbleAdv
BLE advertisement management and GAP interface.
Definition
adv.hxx:22
dawn::CProtoNimbleAdv::GAPNAME_MAX
static size_t GAPNAME_MAX
Max GAP device name length (excluding null).
Definition
adv.hxx:24
dawn::CProtoNimbleAdv::gapName
static char gapName[GAPNAME_MAX+1]
GAP device name visible during BLE discovery.
Definition
adv.hxx:28
dawn::CProtoNimbleAdv::ownAddrType
static uint8_t ownAddrType
BLE device address type (random/static/public).
Definition
adv.hxx:27
dawn
Out-of-tree user-extension hooks for Dawn.
Definition
bindable.hxx:13
Generated by
1.9.8