BluezQt 5.109.0
Properties | Signals | Public Member Functions | List of all members
BluezQt::Adapter

Bluetooth adapter. More...

#include <BluezQt/Adapter>

Properties

quint32 adapterClass
 
QString address
 
QList< DevicePtr > devices
 
bool discoverable
 
quint32 discoverableTimeout
 
bool discovering
 
LEAdvertisingManagerPtr leAdvertisingManager
 
MediaPtr media
 
QString modalias
 
QString name
 
bool pairable
 
quint32 pairableTimeout
 
bool powered
 
QString systemName
 
QString ubi
 
QStringList uuids
 

Signals

void adapterChanged (AdapterPtr adapter)
 Indicates that at least one of the adapter's properties have changed.
 
void adapterClassChanged (quint32 adapterClass)
 Indicates that adapter's class have changed.
 
void adapterRemoved (AdapterPtr adapter)
 Indicates that the adapter was removed.
 
void deviceAdded (DevicePtr device)
 Indicates that a new device was added (eg.
 
void deviceChanged (DevicePtr device)
 Indicates that at least one of the device's properties have changed.
 
void deviceRemoved (DevicePtr device)
 Indicates that a device was removed.
 
void discoverableChanged (bool discoverable)
 Indicates that adapter's discoverable state have changed.
 
void discoverableTimeoutChanged (quint32 timeout)
 Indicates that adapter's discoverable timeout have changed.
 
void discoveringChanged (bool discovering)
 Indicates that adapter's discovering state have changed.
 
void gattManagerChanged (GattManagerPtr gattManager)
 Indicates that adapter's GATT manager have changed.
 
void leAdvertisingManagerChanged (LEAdvertisingManagerPtr leAdvertisingManager)
 Indicates that adapter's LE advertising manager have changed.
 
void mediaChanged (MediaPtr media)
 Indicates that adapter's media have changed.
 
void modaliasChanged (const QString &modalias)
 Indicates that adapter's modalias have changed.
 
void nameChanged (const QString &name)
 Indicates that adapter's name have changed.
 
void pairableChanged (bool pairable)
 Indicates that adapter's pairable state have changed.
 
void pairableTimeoutChanged (quint32 timeout)
 Indicates that adapter's pairable timeout have changed.
 
void poweredChanged (bool powered)
 Indicates that adapter's powered state have changed.
 
void systemNameChanged (const QString &systemName)
 Indicates that adapter's system name have changed.
 
void uuidsChanged (const QStringList &uuids)
 Indicates that adapter's UUIDs have changed.
 

Public Member Functions

 ~Adapter () override
 Destroys an Adapter object.
 
quint32 adapterClass () const
 Returns a class of the adapter.
 
QString address () const
 Returns an address of the adapter.
 
DevicePtr deviceForAddress (const QString &address) const
 Returns a device for specified address.
 
QList< DevicePtr > devices () const
 Returns list of devices known by the adapter.
 
quint32 discoverableTimeout () const
 Returns the discoverable timeout in seconds of the adapter.
 
GattManagerPtr gattManager () const
 Returns the GATT manager interface for the adapter.
 
PendingCallgetDiscoveryFilters ()
 Get the discovery filters for the caller.
 
bool isDiscoverable () const
 Returns whether the adapter is discoverable by other devices.
 
bool isDiscovering ()
 Returns whether the adapter is discovering for other devices.
 
bool isPairable () const
 Returns whether the adapter is pairable with other devices.
 
bool isPowered () const
 Returns whether the adapter is powered on.
 
LEAdvertisingManagerPtr leAdvertisingManager () const
 Returns the LE advertising manager interface for the adapter.
 
MediaPtr media () const
 Returns the media interface for the adapter.
 
QString modalias () const
 Returns local device ID in modalias format.
 
QString name () const
 Returns a name of the adapter.
 
quint32 pairableTimeout () const
 Returns the pairable timeout in seconds of the adapter.
 
PendingCallremoveDevice (DevicePtr device)
 Removes the specified device.
 
PendingCallsetDiscoverable (bool discoverable)
 Sets the discoverable state of the adapter.
 
PendingCallsetDiscoverableTimeout (quint32 timeout)
 Sets the discoverable timeout of the adapter.
 
PendingCallsetDiscoveryFilter (const QVariantMap &filter)
 Set the discovery filter for the caller.
 
PendingCallsetName (const QString &name)
 Sets the name of the adapter.
 
PendingCallsetPairable (bool pairable)
 Sets the pairable state of the adapter.
 
PendingCallsetPairableTimeout (quint32 timeout)
 Sets the pairable timeout of the adapter.
 
PendingCallsetPowered (bool powered)
 Sets the powered state of the adapter.
 
PendingCallstartDiscovery ()
 Starts device discovery.
 
PendingCallstopDiscovery ()
 Stops device discovery.
 
QString systemName () const
 Returns a system name (hostname) of the adapter.
 
AdapterPtr toSharedPtr () const
 Returns a shared pointer from this.
 
QString ubi () const
 Returns an UBI of the adapter.
 
QStringList uuids () const
 Returns UUIDs of supported services by the adapter.
 

Detailed Description

Bluetooth adapter.

This class represents a Bluetooth adapter.

Constructor & Destructor Documentation

◆ ~Adapter()

BluezQt::Adapter::~Adapter ( )
override

Destroys an Adapter object.

Member Function Documentation

◆ adapterChanged

void BluezQt::Adapter::adapterChanged ( AdapterPtr  adapter)
signal

Indicates that at least one of the adapter's properties have changed.

◆ adapterClass()

quint32 BluezQt::Adapter::adapterClass ( ) const

Returns a class of the adapter.

Returns
class of adapter

◆ adapterClassChanged

void BluezQt::Adapter::adapterClassChanged ( quint32  adapterClass)
signal

Indicates that adapter's class have changed.

◆ adapterRemoved

void BluezQt::Adapter::adapterRemoved ( AdapterPtr  adapter)
signal

Indicates that the adapter was removed.

◆ address()

QString BluezQt::Adapter::address ( ) const

Returns an address of the adapter.

Example address: "1C:E5:C3:BC:94:7E"

Returns
address of adapter

◆ deviceAdded

void BluezQt::Adapter::deviceAdded ( DevicePtr  device)
signal

Indicates that a new device was added (eg.

found by discovery).

◆ deviceChanged

void BluezQt::Adapter::deviceChanged ( DevicePtr  device)
signal

Indicates that at least one of the device's properties have changed.

◆ deviceForAddress()

DevicePtr BluezQt::Adapter::deviceForAddress ( const QString &  address) const

Returns a device for specified address.

Parameters
addressaddress of device (eg. "40:79:6A:0C:39:75")
Returns
null if there is no device with specified address

◆ deviceRemoved

void BluezQt::Adapter::deviceRemoved ( DevicePtr  device)
signal

Indicates that a device was removed.

◆ devices()

QList< DevicePtr > BluezQt::Adapter::devices ( ) const

Returns list of devices known by the adapter.

Returns
list of devices

◆ discoverableChanged

void BluezQt::Adapter::discoverableChanged ( bool  discoverable)
signal

Indicates that adapter's discoverable state have changed.

◆ discoverableTimeout()

quint32 BluezQt::Adapter::discoverableTimeout ( ) const

Returns the discoverable timeout in seconds of the adapter.

Discoverable timeout defines how long the adapter stays in discoverable state after calling setDiscoverable(true).

Timeout 0 means infinitely.

Returns
discoverable timeout of adapter

◆ discoverableTimeoutChanged

void BluezQt::Adapter::discoverableTimeoutChanged ( quint32  timeout)
signal

Indicates that adapter's discoverable timeout have changed.

◆ discoveringChanged

void BluezQt::Adapter::discoveringChanged ( bool  discovering)
signal

Indicates that adapter's discovering state have changed.

◆ gattManager()

GattManagerPtr BluezQt::Adapter::gattManager ( ) const

Returns the GATT manager interface for the adapter.

Returns
null if adapter have no GATT manager

◆ gattManagerChanged

void BluezQt::Adapter::gattManagerChanged ( GattManagerPtr  gattManager)
signal

Indicates that adapter's GATT manager have changed.

◆ getDiscoveryFilters()

PendingCall * BluezQt::Adapter::getDiscoveryFilters ( )

Get the discovery filters for the caller.

This returns the available filters that can be given to setDiscoveryFilter, for details see Bluez documentation for Adapter object

Possible errors: PendingCall::Failed

Returns
string list pending call

◆ isDiscoverable()

bool BluezQt::Adapter::isDiscoverable ( ) const

Returns whether the adapter is discoverable by other devices.

Returns
true if adapter is discoverable

◆ isDiscovering()

bool BluezQt::Adapter::isDiscovering ( )

Returns whether the adapter is discovering for other devices.

Returns
true if adapter is discovering

◆ isPairable()

bool BluezQt::Adapter::isPairable ( ) const

Returns whether the adapter is pairable with other devices.

Returns
true if adapter is pairable

◆ isPowered()

bool BluezQt::Adapter::isPowered ( ) const

Returns whether the adapter is powered on.

Returns
true if adapter is powered on

◆ leAdvertisingManager()

LEAdvertisingManagerPtr BluezQt::Adapter::leAdvertisingManager ( ) const

Returns the LE advertising manager interface for the adapter.

Returns
null if adapter have no Bluetooth LE

◆ leAdvertisingManagerChanged

void BluezQt::Adapter::leAdvertisingManagerChanged ( LEAdvertisingManagerPtr  leAdvertisingManager)
signal

Indicates that adapter's LE advertising manager have changed.

◆ media()

MediaPtr BluezQt::Adapter::media ( ) const

Returns the media interface for the adapter.

Returns
null if adapter have no media

◆ mediaChanged

void BluezQt::Adapter::mediaChanged ( MediaPtr  media)
signal

Indicates that adapter's media have changed.

◆ modalias()

QString BluezQt::Adapter::modalias ( ) const

Returns local device ID in modalias format.

Returns
adapter modalias

◆ modaliasChanged

void BluezQt::Adapter::modaliasChanged ( const QString &  modalias)
signal

Indicates that adapter's modalias have changed.

◆ name()

QString BluezQt::Adapter::name ( ) const

Returns a name of the adapter.

Returns
name of adapter

◆ nameChanged

void BluezQt::Adapter::nameChanged ( const QString &  name)
signal

Indicates that adapter's name have changed.

◆ pairableChanged

void BluezQt::Adapter::pairableChanged ( bool  pairable)
signal

Indicates that adapter's pairable state have changed.

◆ pairableTimeout()

quint32 BluezQt::Adapter::pairableTimeout ( ) const

Returns the pairable timeout in seconds of the adapter.

Pairable timeout defines how long the adapter stays in pairable state after calling setPairable(true).

Timeout 0 means infinitely.

Returns
pairable timeout of adapter

◆ pairableTimeoutChanged

void BluezQt::Adapter::pairableTimeoutChanged ( quint32  timeout)
signal

Indicates that adapter's pairable timeout have changed.

◆ poweredChanged

void BluezQt::Adapter::poweredChanged ( bool  powered)
signal

Indicates that adapter's powered state have changed.

◆ removeDevice()

PendingCall * BluezQt::Adapter::removeDevice ( DevicePtr  device)

Removes the specified device.

It will also remove the pairing information.

Possible errors: PendingCall::InvalidArguments, PendingCall::Failed

Parameters
devicedevice to be removed
Returns
void pending call

◆ setDiscoverable()

PendingCall * BluezQt::Adapter::setDiscoverable ( bool  discoverable)

Sets the discoverable state of the adapter.

Parameters
discoverablediscoverable state
Returns
void pending call

◆ setDiscoverableTimeout()

PendingCall * BluezQt::Adapter::setDiscoverableTimeout ( quint32  timeout)

Sets the discoverable timeout of the adapter.

Parameters
timeouttimeout in seconds
Returns
void pending call

◆ setDiscoveryFilter()

PendingCall * BluezQt::Adapter::setDiscoveryFilter ( const QVariantMap &  filter)

Set the discovery filter for the caller.

When this method is called with no filter parameter, the filter is removed.

For details and available filter options, see Bluez documentation for Adapter object

Possible errors: PendingCall::InvalidArguments, PendingCall::Failed

Parameters
filteroptions dictionary
Returns
void pending call

◆ setName()

PendingCall * BluezQt::Adapter::setName ( const QString &  name)

Sets the name of the adapter.

Parameters
namename of adapter
Returns
void pending call

◆ setPairable()

PendingCall * BluezQt::Adapter::setPairable ( bool  pairable)

Sets the pairable state of the adapter.

Parameters
pairablepairable state
Returns
void pending call

◆ setPairableTimeout()

PendingCall * BluezQt::Adapter::setPairableTimeout ( quint32  timeout)

Sets the pairable timeout of the adapter.

Parameters
timeouttimeout in seconds
Returns
void pending call

◆ setPowered()

PendingCall * BluezQt::Adapter::setPowered ( bool  powered)

Sets the powered state of the adapter.

Parameters
poweredpowered state
Returns
void pending call

◆ startDiscovery()

PendingCall * BluezQt::Adapter::startDiscovery ( )

Starts device discovery.

Possible errors: PendingCall::NotReady, PendingCall::Failed

Returns
void pending call
See also
discoverableTimeout() const

◆ stopDiscovery()

PendingCall * BluezQt::Adapter::stopDiscovery ( )

Stops device discovery.

Possible errors: PendingCall::NotReady, PendingCall::Failed, PendingCall::NotAuthorized

Returns
void pending call

◆ systemName()

QString BluezQt::Adapter::systemName ( ) const

Returns a system name (hostname) of the adapter.

Returns
system name of adapter

◆ systemNameChanged

void BluezQt::Adapter::systemNameChanged ( const QString &  systemName)
signal

Indicates that adapter's system name have changed.

◆ toSharedPtr()

AdapterPtr BluezQt::Adapter::toSharedPtr ( ) const

Returns a shared pointer from this.

Returns
AdapterPtr

◆ ubi()

QString BluezQt::Adapter::ubi ( ) const

Returns an UBI of the adapter.

Example UBI: "/org/bluez/hci0"

Returns
UBI of adapter

◆ uuids()

QStringList BluezQt::Adapter::uuids ( ) const

Returns UUIDs of supported services by the adapter.

UUIDs will always be returned in uppercase.

Returns
UUIDs of supported services

◆ uuidsChanged

void BluezQt::Adapter::uuidsChanged ( const QStringList &  uuids)
signal

Indicates that adapter's UUIDs have changed.