Phosphor
Qt6 / Wayland library suite for window-management tools
Loading...
Searching...
No Matches
PhosphorServiceBluetooth::BluetoothHost Class Reference

Facade over org.bluez: enumerates adapters and devices. More...

#include <PhosphorServiceBluetooth/BluetoothHost.h>

Inheritance diagram for PhosphorServiceBluetooth::BluetoothHost:
[legend]

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

Detailed Description

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().

Constructor & Destructor Documentation

◆ BluetoothHost() [1/2]

PhosphorServiceBluetooth::BluetoothHost::BluetoothHost ( QObject * parent = nullptr)
explicit

Observes the system bus's org.bluez (the production wiring).

◆ BluetoothHost() [2/2]

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.

◆ ~BluetoothHost()

PhosphorServiceBluetooth::BluetoothHost::~BluetoothHost ( )
override

Member Function Documentation

◆ adapterAdded

void PhosphorServiceBluetooth::BluetoothHost::adapterAdded ( PhosphorServiceBluetooth::BluetoothAdapter * adapter)
signal

◆ adapterAt()

PhosphorServiceBluetooth::BluetoothAdapter * PhosphorServiceBluetooth::BluetoothHost::adapterAt ( int index) const
nodiscard

Adapter / device at index, or nullptr when out of range.

◆ adapterCount()

int PhosphorServiceBluetooth::BluetoothHost::adapterCount ( ) const
nodiscard

◆ adapterCountChanged

void PhosphorServiceBluetooth::BluetoothHost::adapterCountChanged ( )
signal

◆ adapterRemoved

void PhosphorServiceBluetooth::BluetoothHost::adapterRemoved ( PhosphorServiceBluetooth::BluetoothAdapter * adapter)
signal

◆ adapters()

QList< BluetoothAdapter * > PhosphorServiceBluetooth::BluetoothHost::adapters ( ) const
nodiscard

◆ agent()

BluetoothAgent * PhosphorServiceBluetooth::BluetoothHost::agent ( ) const
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.

◆ deviceAdded

void PhosphorServiceBluetooth::BluetoothHost::deviceAdded ( PhosphorServiceBluetooth::BluetoothDevice * device)
signal

◆ deviceAt()

PhosphorServiceBluetooth::BluetoothDevice * PhosphorServiceBluetooth::BluetoothHost::deviceAt ( int index) const
nodiscard

◆ deviceCount()

int PhosphorServiceBluetooth::BluetoothHost::deviceCount ( ) const
nodiscard

◆ deviceCountChanged

void PhosphorServiceBluetooth::BluetoothHost::deviceCountChanged ( )
signal

◆ deviceRemoved

void PhosphorServiceBluetooth::BluetoothHost::deviceRemoved ( PhosphorServiceBluetooth::BluetoothDevice * device)
signal

◆ devices()

QList< BluetoothDevice * > PhosphorServiceBluetooth::BluetoothHost::devices ( ) const
nodiscard

◆ refresh()

void PhosphorServiceBluetooth::BluetoothHost::refresh ( )

The documentation for this class was generated from the following file:
  • phosphor-service-bluetooth/include/PhosphorServiceBluetooth/BluetoothHost.h