9#ifndef BLUEZQT_DEVICE_H
10#define BLUEZQT_DEVICE_H
14#include "bluezqt_export.h"
15#include "gattserviceremote.h"
17#include "mediaplayer.h"
18#include "mediatransport.h"
31class BLUEZQT_EXPORT
Device :
public QObject
35 Q_PROPERTY(QString ubi READ ubi)
36 Q_PROPERTY(QString address READ address NOTIFY addressChanged)
37 Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged)
38 Q_PROPERTY(QString friendlyName READ friendlyName NOTIFY friendlyNameChanged)
39 Q_PROPERTY(QString remoteName READ remoteName NOTIFY remoteNameChanged)
40 Q_PROPERTY(quint32 deviceClass READ deviceClass NOTIFY deviceClassChanged)
41 Q_PROPERTY(
Type type READ type NOTIFY typeChanged)
42 Q_PROPERTY(quint16 appearance READ appearance NOTIFY appearanceChanged)
43 Q_PROPERTY(QString icon READ icon NOTIFY iconChanged)
44 Q_PROPERTY(
bool paired READ isPaired NOTIFY pairedChanged)
45 Q_PROPERTY(
bool trusted READ isTrusted WRITE setTrusted NOTIFY trustedChanged)
46 Q_PROPERTY(
bool blocked READ isBlocked WRITE setBlocked NOTIFY blockedChanged)
47 Q_PROPERTY(
bool legacyPairing READ hasLegacyPairing NOTIFY legacyPairingChanged)
48 Q_PROPERTY(qint16 rssi READ rssi NOTIFY rssiChanged)
49 Q_PROPERTY(ManData manufacturerData READ manufacturerData NOTIFY manufacturerDataChanged)
50 Q_PROPERTY(
bool servicesResolved READ isServicesResolved NOTIFY servicesResolvedChanged)
51 Q_PROPERTY(
bool connected READ isConnected NOTIFY connectedChanged)
52 Q_PROPERTY(QStringList uuids READ uuids NOTIFY uuidsChanged)
53 Q_PROPERTY(QString modalias READ modalias NOTIFY modaliasChanged)
54 Q_PROPERTY(BatteryPtr battery READ battery NOTIFY batteryChanged)
55 Q_PROPERTY(InputPtr input READ input NOTIFY inputChanged)
56 Q_PROPERTY(MediaPlayerPtr mediaPlayer READ mediaPlayer NOTIFY mediaPlayerChanged)
57 Q_PROPERTY(MediaTransportPtr mediaTransport READ mediaTransport NOTIFY mediaTransportChanged)
58 Q_PROPERTY(AdapterPtr adapter READ adapter)
59 Q_PROPERTY(QList<GattServiceRemotePtr> gattServices READ gattServices NOTIFY gattServicesChanged)
599 BLUEZQT_NO_EXPORT
explicit Device(
const QString &path,
const QVariantMap &properties, AdapterPtr adapter);
601 class DevicePrivate *
const d;
603 friend class DevicePrivate;
604 friend class ManagerPrivate;
610Q_DECLARE_METATYPE(BluezQt::ManData)
Bluetooth adapter.
Definition adapter.h:33
Bluetooth device.
Definition device.h:32
PendingCall * connectProfile(const QString &uuid)
Connects a specific profile of the device.
bool isTrusted() const
Returns whether the device is trusted.
void nameChanged(const QString &name)
Indicates that device's name have changed.
QString icon() const
Returns an icon name of the device.
bool isConnected() const
Returns whether the device is connected.
bool hasLegacyPairing() const
Returns whether the device has legacy pairing.
PendingCall * pair()
Initiates a pairing with the device.
PendingCall * setTrusted(bool trusted)
Sets the trusted state of the device.
InputPtr input() const
Returns the input interface for the device.
void modaliasChanged(const QString &modalias)
Indicates that device's modalias have changed.
QList< GattServiceRemotePtr > gattServices() const
Returns list of services known by the device.
QString remoteName() const
Returns a remote name of the device.
QHash< QString, QByteArray > serviceData() const
Returns the service advertisement data.
QString name() const
Returns a name of the device.
Type
Device types.
Definition device.h:65
@ Modem
The device is a modem.
Definition device.h:69
@ Wearable
The device is a wearable device.
Definition device.h:97
@ Uncategorized
The device is not of any of the known types.
Definition device.h:103
@ Headset
The device is a headset.
Definition device.h:75
@ Imaging
The device is an uncategorized imaging device.
Definition device.h:95
@ Tablet
The device is a graphics tablet (input device).
Definition device.h:87
@ Camera
The device is a camera.
Definition device.h:91
@ Peripheral
The device is an uncategorized peripheral device.
Definition device.h:89
@ AudioVideo
The device is an uncategorized audio video device.
Definition device.h:79
@ Toy
The device is a toy.
Definition device.h:99
@ Network
The device is a network.
Definition device.h:73
@ Mouse
The device is a mouse.
Definition device.h:83
@ Phone
The device is a phone.
Definition device.h:67
@ Headphones
The device is a headphones.
Definition device.h:77
@ Computer
The device is a computer.
Definition device.h:71
@ Joypad
The device is a joypad.
Definition device.h:85
@ Printer
The device is a printer.
Definition device.h:93
@ Keyboard
The device is a keyboard.
Definition device.h:81
@ Health
The device is a health device.
Definition device.h:101
QStringList uuids() const
Returns UUIDs of supported services by the device.
~Device() override
Destroys a Device object.
PendingCall * connectToDevice()
Connects all auto-connectable profiles of the device.
static QString typeToString(Device::Type type)
Returns a string for device type.
PendingCall * cancelPairing()
Cancels a pairing with the device.
PendingCall * setBlocked(bool blocked)
Sets the blocked state of the device.
static Device::Type stringToType(const QString &typeString)
Returns a device type for string.
bool isPaired() const
Returns whether the device is paired.
qint16 rssi() const
Returns Received Signal Strength Indicator of the device.
void deviceRemoved(DevicePtr device)
Indicates that the device was removed.
bool isBlocked() const
Returns whether the device is blocked.
quint32 deviceClass() const
Returns a class of the device.
void typeChanged(Type type)
Indicates that device's type have changed.
void trustedChanged(bool trusted)
Indicates that device's trusted state have changed.
PendingCall * disconnectProfile(const QString &uuid)
Disconnects a specific profile of the device.
void mediaTransportChanged(MediaTransportPtr mediaTransport)
Indicates that device's media transport have changed.
void inputChanged(InputPtr input)
Indicates that device's input have changed.
BatteryPtr battery() const
Returns the battery interface for the device.
void blockedChanged(bool blocked)
Indicates that device's blocked state have changed.
void iconChanged(const QString &icon)
Indicates that device's icon have changed.
ManData manufacturerData() const
Returns manufacturer specific advertisement data.
void mediaPlayerChanged(MediaPlayerPtr mediaPlayer)
Indicates that device's media player have changed.
void gattServicesChanged(QList< GattServiceRemotePtr > services)
Indicates that device GATT services list has changed.
void appearanceChanged(quint16 appearance)
Indicates that device's appearance have changed.
void legacyPairingChanged(bool legacyPairing)
Indicates that device's legacy pairing state have changed.
void friendlyNameChanged(const QString &friendlyName)
Indicates that device's friendly name have changed.
void gattServiceChanged(GattServiceRemotePtr service)
Indicates that at least one of the device's services have changed.
QString address() const
Returns an address of the device.
quint16 appearance() const
Returns an appearance of the device.
void serviceDataChanged(const QHash< QString, QByteArray > &serviceData)
Indicates that the device's service data has changed.
QString friendlyName() const
Returns a friendly name of the device.
void rssiChanged(qint16 rssi)
Indicates that device's RSSI have changed.
void remoteNameChanged(const QString &remoteName)
Indicates that device's remote name have changed.
void gattServiceRemoved(GattServiceRemotePtr service)
Indicates that a service was removed.
void connectedChanged(bool connected)
Indicates that device's connected state have changed.
PendingCall * setName(const QString &name)
Sets the name of the device.
void servicesResolvedChanged(bool servicesResolved)
Indicates that device's servicesResolved state have changed.
QString modalias() const
Returns remote device ID in modalias format.
void pairedChanged(bool paired)
Indicates that device's paired state have changed.
DevicePtr toSharedPtr() const
Returns a shared pointer from this.
void deviceClassChanged(quint32 deviceClass)
Indicates that device's class have changed.
PendingCall * disconnectFromDevice()
Disconnects all connected profiles of the device.
void batteryChanged(BatteryPtr battery)
Indicates that device's battery has changed.
void uuidsChanged(const QStringList &uuids)
Indicates that device's UUIDs have changed.
QString ubi() const
Returns an UBI of the device.
void gattServiceAdded(GattServiceRemotePtr service)
Indicates that a new service was added (eg.
Device::Type type() const
Returns a type of the device.
void manufacturerDataChanged(ManData man)
Indicates that device's manufacturer data have changed.
MediaPlayerPtr mediaPlayer() const
Returns the media player interface for the device.
MediaTransportPtr mediaTransport() const
Returns the media transport interface for the device.
bool isServicesResolved() const
Returns whether or not service discovery has been resolved.
AdapterPtr adapter() const
Returns an adapter that discovered this device.
void deviceChanged(DevicePtr device)
Indicates that at least one of the device's properties have changed.
void addressChanged(const QString &address)
Indicates that device's address have changed.
Pending method call.
Definition pendingcall.h:33