setupProfiles();
}
+bool BluetoothDevice::paired()
+{
+ QVariantMap props = m_device->GetProperties();
+ return props["Paired"].toBool();
+}
+
void BluetoothDevice::setupProfiles()
{
if(isProfileSupported(BluetoothProfiles::hid))
{
emit trustedChanged(value.variant().toBool());
}
+
+ if(name == "Paired")
+ {
+ emit pairedChanged();
+ }
+
emit propertyChanged(name,value.variant());
///TODO: create individual signals for each property... maybe
Q_PROPERTY(bool audioConnected READ audioConnected NOTIFY audioConnectedChanged)
Q_PROPERTY(bool inputConnected READ inputConnected NOTIFY inputConnectedChanged)
Q_PROPERTY(bool trusted READ trusted WRITE setTrusted NOTIFY trustedChanged)
+ Q_PROPERTY(bool paired READ paired NOTIFY pairedChanged)
Q_PROPERTY(QStringList profiles READ profiles NOTIFY profilesChanged)
Q_PROPERTY(QString alias READ alias)
Q_PROPERTY(QString name READ name)
public:
explicit BluetoothDevice(QDBusObjectPath path = QDBusObjectPath(), QObject *parent = 0);
+ bool paired();
signals:
void connectedChanged(bool isConnected);
void propertyChanged(QString name, QVariant value);
void profilesChanged(QStringList uuids);
void trustedChanged(bool trust);
+ void pairedChanged();
public slots:
void unpair();