modules/woz_aliro/include/aliro_reader.h
asxeem/openaliro
Module

aliro_reader.h

modules/woz_aliro/include/aliro_reader.h

used by aliro_reader.c

API

Fint aliro_reader_start(void)

modules/woz_aliro/include/aliro_reader.h:26

Bring up the Aliro reader (starts the BLE transport + session layer). Returns 0 on success, negative on failure.

Fconst void * aliro_reader_ble_prepare(void)

modules/woz_aliro/include/aliro_reader.h:37

Prepare the reader for attach mode + return the Aliro GATT service def to register (cast to const struct ble_gatt_svc_def *). NULL on failure.

Fint aliro_reader_start_attached(void)

modules/woz_aliro/include/aliro_reader.h:41

Start the reader on the shared host (L2CAP CoC + advertising + engine). Returns 0 on success, negative on failure.

Fvoid aliro_reader_refresh_adv(void)

modules/woz_aliro/include/aliro_reader.h:48

Re-emit the BLE advertisement using the currently-provisioned GRK. Call after Matter provisioning (SetAliroReaderConfig) if the reader may already be advertising: it starts on kCommissioningComplete, before Apple sends the Aliro config, so its first advertisement has no GRK and the phone cannot resolve it. No-op if the reader has no GRK or is not yet advertising.

Fvoid aliro_reader_rssi_sample(uint16_t conn_handle, int8_t rssi_dbm)

modules/woz_aliro/include/aliro_reader.h:56

Fvoid aliro_reader_notify_unlock(bool unsecured)

modules/woz_aliro/include/aliro_reader.h:63

Fbool aliro_reader_session_active(void)

modules/woz_aliro/include/aliro_reader.h:72

Fbool aliro_reader_authenticated_credential(uint8_t cred_pub[65])

modules/woz_aliro/include/aliro_reader.h:81

Fvoid aliro_reader_prov_print(void)

modules/woz_aliro/include/aliro_reader.h:89

Print the reader identity (dev vs provisioned, reader_id), the trust store, and the most-recently-presented credential key.

Fint aliro_reader_trust_last(void)

modules/woz_aliro/include/aliro_reader.h:94

Trust the most-recently-presented credential public key and persist it to NVS. Returns 0 (added + saved), 1 (nothing presented yet, or already trusted), negative on a store error.

Fint aliro_reader_trust_clear(void)

modules/woz_aliro/include/aliro_reader.h:100

Empty the trust store and persist it, keeping the reader identity. Returns 0 (cleared + saved), 1 (already empty), negative on an NVS error. Needed because nothing evicts superseded credentials and a Matter factory reset leaves this store intact, so it otherwise fills up and rejects the current credential.

Fint aliro_reader_provision_identity(const uint8_t reader_id[32], const uint8_t sign_priv[32], const uint8_t grk[16])

modules/woz_aliro/include/aliro_reader.h:114

Store the reader identity provisioned over Matter and persist it to NVS: reader_id = groupIdentifier(16) || groupSubIdentifier(16), sign_priv = signingKey(32), grk = groupResolvingKey(16) for the BLE-UWB advertising dynamic tag (pass all-zero if none); clears the dev flag. Existing trust anchors are preserved. Returns 0 on success, negative on an NVS error.

Fint aliro_reader_provision_add_trust(const uint8_t cred_pub[65])

modules/woz_aliro/include/aliro_reader.h:120

Add a trusted credential public key (uncompressed P-256, 65 bytes) presented over Matter SetCredential and persist. Returns 0 (added), 1 (already present), negative (store full / not a P-256 point / NVS error).

Fint aliro_reader_provision_clear(void)

modules/woz_aliro/include/aliro_reader.h:124

Revert to the dev identity + empty trust store (Matter ClearAliroReaderConfig) and persist. Returns 0 on success, negative on an NVS error.

Fvoid aliro_reader_stepup_arm(void)

modules/woz_aliro/include/aliro_reader.h:133

Arm a one-shot Access-Document request: the next transaction is forced into the standard phase and requests + verifies a document. Never per-unlock; the verdict is logged only and never gates access.

Fvoid aliro_reader_stepup_status(void)

modules/woz_aliro/include/aliro_reader.h:136

Print the armed state and the most recent verification verdict.