8#include "dawn/debug.hxx"
9#include "dawn/porting/config.hxx"
10#include "host/ble_gap.h"
25 CONFIG_DAWN_PROTO_NIMBLE_GAPNAME_MAX;
26 static_assert(
GAPNAME_MAX <= 26,
"GAP name must fit in legacy advertising data");
29 static constexpr uint16_t
CONN_ITVL_MIN = CONFIG_DAWN_PROTO_NIMBLE_CONN_ITVL_MIN;
30 static constexpr uint16_t CONN_ITVL_MAX = CONFIG_DAWN_PROTO_NIMBLE_CONN_ITVL_MAX;
38 static void startAdvertise();
39 static void setGapName(
const char *name, uint8_t len);
43 static constexpr uint32_t ADV_RETRY_MS = 100;
45 static void putAd(uint8_t ad_type, uint8_t ad_len,
const void *ad, uint8_t *buf, uint8_t *len);
47 static void updateAd();
48 static void requestConnParams(uint16_t conn_handle);
49 static int gapEventCb(
struct ble_gap_event *event,
void *arg);
50 static void advRetryCb(
struct ble_npl_event *ev);
51 static void scheduleAdvRetry();
BLE advertisement management and GAP interface.
static uint16_t CONN_ITVL_MIN
Preferred connection interval (units of 1.25ms); 0 leaves it untouched.
static size_t GAPNAME_MAX
Max GAP device name length (excluding null).
static char gapName[GAPNAME_MAX+1]
GAP device name visible during BLE discovery.
static uint8_t ownAddrType
BLE device address type (random/static/public).
Out-of-tree user-extension hooks for Dawn.