One BlueZ device (org.bluez.Device1), e.g. More...
#include <PhosphorServiceBluetooth/BluetoothDevice.h>
Signals | |
| void | operationFinished (const QString &operation, const QString &errorName) |
| Completion of a write request; state follows BlueZ properties. | |
| void | addressChanged () |
| void | nameChanged () |
| void | aliasChanged () |
| void | iconChanged () |
| void | pairedChanged () |
| void | trustedChanged () |
| void | blockedChanged () |
| void | connectedChanged () |
| void | rssiChanged () |
| void | batteryPercentageChanged () |
| void | adapterChanged () |
| void | uuidsChanged () |
Public Member Functions | |
| BluetoothDevice (QDBusConnection connection, const QString &dbusPath, const QVariantMap &initialProperties, QObject *parent=nullptr) | |
| ~BluetoothDevice () override | |
| QString | dbusPath () const |
| QString | address () const |
| QString | name () const |
| QString | alias () const |
| QString | icon () const |
| bool | paired () const |
| bool | trusted () const |
| bool | blocked () const |
| bool | connected () const |
| int | rssi () const |
| int | batteryPercentage () const |
| -1 when the device does not report Battery1.Percentage. | |
| void | applyBattery (const QVariantMap &properties) |
| Internal ObjectManager update, including removal (empty map). | |
| QString | adapter () const |
| QStringList | uuids () const |
| void | connectDevice () |
| Establish / tear down a connection to this device (org.bluez.Device1.Connect / Disconnect). | |
| void | disconnectDevice () |
| void | setTrusted (bool trusted) |
| Mark the device (un)trusted / (un)blocked (org.bluez.Device1 Properties.Set). | |
| void | setBlocked (bool blocked) |
| void | pair () |
| Begin / abort pairing (org.bluez.Device1.Pair / CancelPairing). | |
| void | cancelPairing () |
One BlueZ device (org.bluez.Device1), e.g.
/org/bluez/hci0/dev_AA_BB_CC_DD_EE_FF.
Initial properties are supplied by BluetoothHost from the ObjectManager enumeration; subsequent changes arrive via PropertiesChanged. The write surface is exposed via connectDevice / disconnectDevice / setTrusted / setBlocked / pair / cancelPairing (fire-and-forget; cached state moves on the PropertiesChanged echo).
rssi is only reported by BlueZ for devices currently in range (during discovery): it is 0 for a never-seen / cached device, and is reset to 0 when BlueZ invalidates it as the device goes out of range. Owned by BluetoothHost; never constructed from QML.
| PhosphorServiceBluetooth::BluetoothDevice::BluetoothDevice | ( | QDBusConnection | connection, |
| const QString & | dbusPath, | ||
| const QVariantMap & | initialProperties, | ||
| QObject * | parent = nullptr ) |
|
override |
|
nodiscard |
|
signal |
|
nodiscard |
|
signal |
|
nodiscard |
|
signal |
| void PhosphorServiceBluetooth::BluetoothDevice::applyBattery | ( | const QVariantMap & | properties | ) |
Internal ObjectManager update, including removal (empty map).
|
nodiscard |
-1 when the device does not report Battery1.Percentage.
|
signal |
|
nodiscard |
|
signal |
| void PhosphorServiceBluetooth::BluetoothDevice::cancelPairing | ( | ) |
| void PhosphorServiceBluetooth::BluetoothDevice::connectDevice | ( | ) |
Establish / tear down a connection to this device (org.bluez.Device1.Connect / Disconnect).
Fire-and-forget; connected reflects the outcome via PropertiesChanged. Named *Device to avoid shadowing the static QObject::connect / disconnect.
|
nodiscard |
|
signal |
|
nodiscard |
| void PhosphorServiceBluetooth::BluetoothDevice::disconnectDevice | ( | ) |
|
nodiscard |
|
signal |
|
nodiscard |
|
signal |
|
signal |
Completion of a write request; state follows BlueZ properties.
| void PhosphorServiceBluetooth::BluetoothDevice::pair | ( | ) |
Begin / abort pairing (org.bluez.Device1.Pair / CancelPairing).
Fire-and-forget; during Pair() BlueZ drives the registered BluetoothAgent's callbacks, and paired reflects the outcome via PropertiesChanged.
|
nodiscard |
|
signal |
|
nodiscard |
|
signal |
| void PhosphorServiceBluetooth::BluetoothDevice::setBlocked | ( | bool | blocked | ) |
| void PhosphorServiceBluetooth::BluetoothDevice::setTrusted | ( | bool | trusted | ) |
Mark the device (un)trusted / (un)blocked (org.bluez.Device1 Properties.Set).
Fire-and-forget; the cached value moves only on the PropertiesChanged echo, never optimistically.
|
nodiscard |
|
signal |
|
nodiscard |
|
signal |