Expand description
The BlueZ object model.
BlueZ publishes the whole Bluetooth world as a D-Bus object tree and expects
clients to track it through ObjectManager:
/org/bluez org.bluez.AgentManager1
/org/bluez/hci0 org.bluez.Adapter1
org.bluez.LEAdvertisingManager1
org.bluez.GattManager1
/org/bluez/hci0/dev_AA_BB_CC_DD_EE_FF org.bluez.Device1
…/dev_AA_BB_CC_DD_EE_FF/service0010 org.bluez.GattService1
…/service0010/char0011 org.bluez.GattCharacteristic1
…/char0011/desc0013 org.bluez.GattDescriptor1So an object path is the handle, and the hierarchy is encoded in it: a characteristic’s service is its parent path. That is the opposite of CoreBluetooth, where handles are opaque pointers and the tree is walked by asking. It is also why this layer keeps a cached mirror of the tree — every lookup would otherwise be a round trip.
§Where this differs from CoreBluetooth
- Discovery is not a request/reply.
StartDiscoveryreturns immediately and devices appear asInterfacesAddedsignals. Same as CoreBluetooth. - GATT reads are.
ReadValuereturns the bytes in its method reply, so there is no read-versus-notification ambiguity to resolve — the problemcrate::dbus’s Apple counterpart needs a FIFO for does not exist here. - Notifications are property changes.
StartNotifythenPropertiesChangedonValue. - Services are not discovered explicitly. Connecting resolves them and
sets
ServicesResolved; the objects simply appear in the tree.
Modules§
Structs§
- Bluez
- A connection to BlueZ, with a cached mirror of its object tree.
- Object
- One object in BlueZ’s tree: its interfaces and their properties.
Enums§
- Event
- What the tree tells us happened.
Constants§
Traits§
- Event
Sink - Where tree changes are delivered. Called on the D-Bus reader thread.