~diegosarmentero/ubuntu-system-settings/update-battery

« back to all changes in this revision

Viewing changes to plugins/bluetooth/bluetooth.h

  • Committer: CI bot
  • Author(s): Mathieu Trudel-Lapierre
  • Date: 2014-06-23 13:52:09 UTC
  • mfrom: (742.1.8 ubuntu-system-settings)
  • Revision ID: ps-jenkins@lists.canonical.com-20140623135209-c4a7hhxmy9fcey9o
Implement discoverability and some bluetooth fixes:
  - Discoverability: make the system visible to other bluetooth devices
  - Trusted: when successfully paired and connected, mark device as Trusted so it can automatically connect again.
  - Connect the Audio interface for all audio devices, including Headsets. Some bluetooth audio devices that don't contain a microphone still show up as Headsets, and won't connect successfully otherwise. This will still work for standard headsets, since Audio connects all audio interfaces.
  - Stop discovery when a device is selected for connection, and it sometimes causes connection attempts to fail. Fixes: 1268047, 1331642

Show diffs side-by-side

added added

removed removed

Lines of Context:
50
50
                READ isDiscovering
51
51
                NOTIFY discoveringChanged);
52
52
 
 
53
    Q_PROPERTY (bool discoverable
 
54
                READ isDiscoverable
 
55
                NOTIFY discoverableChanged);
 
56
 
53
57
Q_SIGNALS:
54
58
    void selectedDeviceChanged();
55
59
    void discoveringChanged(bool isActive);
 
60
    void discoverableChanged(bool isActive);
56
61
 
57
62
private Q_SLOTS:
58
63
    void onPairingDone();
61
66
    Bluetooth(QObject *parent = 0);
62
67
    ~Bluetooth() {}
63
68
 
 
69
    Q_INVOKABLE QString adapterName() const { return m_devices.adapterName(); }
64
70
    Q_INVOKABLE void setSelectedDevice(const QString &address);
65
71
    Q_INVOKABLE void connectDevice(const QString &address);
66
72
    Q_INVOKABLE void disconnectDevice();
 
73
    Q_INVOKABLE void toggleDiscovery();
 
74
    Q_INVOKABLE void startDiscovery();
 
75
    Q_INVOKABLE void stopDiscovery();
67
76
 
68
77
public:
69
78
    Agent * getAgent();
72
81
    QAbstractItemModel * getDisconnectedDevices();
73
82
 
74
83
    bool isDiscovering() const { return m_devices.isDiscovering(); }
 
84
    bool isDiscoverable() const { return m_devices.isDiscoverable(); }
75
85
 
76
86
private:
77
87
    QDBusConnection m_dbus;