Facade over org.bluez: enumerates adapters and devices. More...
#include <PhosphorServiceBluetooth/BluetoothHost.h>
Signals | |
| void | adapterAdded (PhosphorServiceBluetooth::BluetoothAdapter *adapter) |
| void | adapterRemoved (PhosphorServiceBluetooth::BluetoothAdapter *adapter) |
| void | deviceAdded (PhosphorServiceBluetooth::BluetoothDevice *device) |
| void | deviceRemoved (PhosphorServiceBluetooth::BluetoothDevice *device) |
| void | adapterCountChanged () |
| void | deviceCountChanged () |
Public Member Functions | |
| BluetoothHost (QObject *parent=nullptr) | |
| Observes the system bus's org.bluez (the production wiring). | |
| BluetoothHost (QDBusConnection connection, QString service, QObject *parent=nullptr) | |
Observes service on connection. | |
| ~BluetoothHost () override | |
| void | refresh () |
| QList< BluetoothAdapter * > | adapters () const |
| QList< BluetoothDevice * > | devices () const |
| int | adapterCount () const |
| int | deviceCount () const |
| BluetoothAgent * | agent () const |
| The pairing agent registered with BlueZ (KeyboardDisplay capability). | |
| PhosphorServiceBluetooth::BluetoothAdapter * | adapterAt (int index) const |
Adapter / device at index, or nullptr when out of range. | |
| PhosphorServiceBluetooth::BluetoothDevice * | deviceAt (int index) const |
Facade over org.bluez: enumerates adapters and devices.
Built on PhosphorDBus::ObjectManager pointed at the BlueZ root (/). Adapters (org.bluez.Adapter1) and devices (org.bluez.Device1) are materialised as typed children, parented to the host and vended through the *Added / *Removed signals. When an adapter goes away its devices are dropped too (cascade), independent of BlueZ's own per-device removals.
Inert when the bus is unavailable (no daemon → empty lists, no crash). The discovery / pairing / connect write surface lives on the adapter and device objects; the pairing agent is exposed via agent().
|
explicit |
Observes the system bus's org.bluez (the production wiring).
| PhosphorServiceBluetooth::BluetoothHost::BluetoothHost | ( | QDBusConnection | connection, |
| QString | service, | ||
| QObject * | parent = nullptr ) |
Observes service on connection.
Lets a consumer (or a test harness) point the host at a non-default bus / service name.
|
override |
|
signal |
|
nodiscard |
Adapter / device at index, or nullptr when out of range.
|
nodiscard |
|
signal |
|
signal |
|
nodiscard |
|
nodiscard |
The pairing agent registered with BlueZ (KeyboardDisplay capability).
Connect to its request signals and answer via its respond* slots to drive an interactive pairing flow. Null when the bus is unavailable or the agent object could not be exported (it would be unusable either way). Shared by hosts on this bus/service and retained until the last host closes. Its availability reflects BlueZ registration.
|
signal |
|
nodiscard |
|
nodiscard |
|
signal |
|
signal |
|
nodiscard |
| void PhosphorServiceBluetooth::BluetoothHost::refresh | ( | ) |