modules/woz_aliro/include/aliro_ble_central.h
openaliro/openaliro
Module

aliro_ble_central.h

Device-side (User-Device) BLE transport interface: the central/client mirror of…

modules/woz_aliro/include/aliro_ble_central.h4 documented symbols

Overview

Device-side (User-Device) BLE transport interface: the central/client mirror of aliro_ble.h. Where the reader advertises 0xFFF2, serves the GATT characteristics and runs an L2CAP CoC server, the initiator scans, connects, reads the reader's SPSM/versions, writes its selected version and opens a CoC client to that SPSM. The platform-free half (advert + READ-payload decoding, BleSK salt assembly) lives in aliro_ble_central.c and is host-testable; the NimBLE backend for the transport calls sits in ports/esp32, so a Zephyr bt_gap_*/bt_l2cap_* backend can be written behind this same header.

depends on aliro_advtag.h  ·  used by aliro_ble_central.c

API

Cstruct aliro_ble_central_adv

modules/woz_aliro/include/aliro_ble_central.h:38

Reader identity recovered from one 0xFFF2 service-data advert. Field order is the inverse of build_aliro_svc_data (aliro_ble.c:532).

Cstruct aliro_ble_central_peer

modules/woz_aliro/include/aliro_ble_central.h:49

What the peer publishes on the reader-SPSM characteristic (D3B5A130-9E23-4B3A-8BE4-6B1EE5F980A3), read before the CoC opens.

Cstruct aliro_ble_central_callbacks

modules/woz_aliro/include/aliro_ble_central.h:90

Callbacks for BLE central transport: on_ready when CoC opens and peer facts are known, on_data for each inbound SDU, on_closed when link or CoC drops.

Cstruct aliro_ble_central_config

modules/woz_aliro/include/aliro_ble_central.h:104

Configuration for BLE central transport: reader_id to match by truncated group/sub ID in adverts, selected_version for device-version characteristic, and callbacks.

##define ALIRO_BLE_CENTRAL_MAX_VERSIONS 8u

modules/woz_aliro/include/aliro_ble_central.h:31

##define ALIRO_BLE_CENTRAL_SVC_DATA_LEN 26u

modules/woz_aliro/include/aliro_ble_central.h:34

Fint aliro_ble_central_parse_adv(const uint8_t *svc_data, size_t len, struct aliro_ble_central_adv *out)

modules/woz_aliro/include/aliro_ble_central.h:59

Fint aliro_ble_central_adv_matches(const struct aliro_ble_central_adv *adv, const uint8_t reader_id[32])

modules/woz_aliro/include/aliro_ble_central.h:65

Fint aliro_ble_central_parse_read_payload(const uint8_t *payload, size_t len, struct aliro_ble_central_peer *out)

modules/woz_aliro/include/aliro_ble_central.h:73

Fint aliro_ble_central_blesk_salt(const struct aliro_ble_central_peer *peer, uint16_t selected, uint8_t *out, size_t cap, size_t *out_len)

modules/woz_aliro/include/aliro_ble_central.h:81

Fint aliro_ble_central_start(const struct aliro_ble_central_config *cfg)

modules/woz_aliro/include/aliro_ble_central.h:116

Fint aliro_ble_central_send(uint16_t conn_handle, const uint8_t *data, size_t len)

modules/woz_aliro/include/aliro_ble_central.h:120