Expand description
HomeKit Accessory Protocol (HAP) Bluetooth LE transport.
Discover, pair with, read from, and stream events off a HomeKit accessory
over BLE, reusing the pairing crypto from hap_crypto, the TLV8 codec
from hap_tlv8, and the attribute model from hap_model.
This is Milestone A: a standalone transport. Unifying it with the IP
hap_controller under one HapController is Milestone B.
Structs§
- Accessory
- One accessory in the bridge/accessory database.
- Accessory
Pairing - The pairing material a successful Pair Setup yields about the accessory.
- BleAccessory
- A connected BLE accessory: holds the GATT link, the secure session, the cached attribute database, and a map from (aid, iid) to GATT characteristic UUID for issuing PDUs.
- BleBroadcast
State - Broadcast-notification material for one accessory, persistable by the caller.
Holds a secret (
BroadcastKeyis zeroized on drop). - BleController
- A BLE HAP controller: holds the long-term controller identity used for pairing and verification.
- Bluest
Connection - A
GattConnectionover a connectedbluestDevicethat reconnects and retries on a dropped link. - Broadcast
Key - A 32-byte ChaCha20-Poly1305 key for decrypting encrypted broadcast
notifications. Zeroized on drop; its
Debugis redacted. - Characteristic
- One characteristic on a service.
- Characteristic
Event - A characteristic value-change event.
- Controller
Keypair - A controller’s long-term Ed25519 identity used across pairings.
- Discovered
BleAccessory - A HAP accessory found while scanning over BLE.
- Gatt
Characteristic - One GATT characteristic discovered on the accessory.
- Gatt
Service - One GATT service and its characteristics.
- Paired
- The result of a successful BLE pairing.
- RawAdvert
- A raw advertisement observed by a backend scanner: the Apple (0x004C)
manufacturer-data bytes. Parsed into a
crate::advert::HapAdvertby callers. - Service
- One service on an accessory.
Enums§
- BleError
- Errors from the BLE transport.
- Char
Format - The HAP characteristic value format (the
formatfield on a characteristic). - Char
Value - A decoded characteristic value, collapsed across the integer widths.
- Characteristic
Type - HAP-defined CharacteristicType (generated).
Unknowncarries any non-HAP UUID. - HapAdvert
- A parsed HAP advertisement of interest to the controller.
- Service
Type - HAP-defined ServiceType (generated).
Unknowncarries any non-HAP UUID.
Traits§
- Advert
Source - A source of continuous BLE advertisements, used post-pairing to receive
sleepy-device events with no active connection. Separate from
GattConnection(the connected I/O seam) so each has one responsibility. Backends without a scanner return an immediately-closed receiver. - Gatt
Connection - The transport seam: read/write/subscribe a characteristic and enumerate the
GATT database. One real impl (
bluest), one mock (tests).
Functions§
- connect_
gatt - Connect to a discovered accessory and return a resilient GATT link.
- scan
- Scan for HAP accessories advertising over BLE for
timeout.
Type Aliases§
- Result
- The crate result alias.