diff options
author | Matt Ranostay <matt.ranostay@konsulko.com> | 2018-10-30 09:49:21 -0700 |
---|---|---|
committer | Matt Ranostay <matt.ranostay@konsulko.com> | 2018-11-05 23:07:50 -0800 |
commit | 61ef43a4520faa2c2c3118013b7bf26cac2e76bb (patch) | |
tree | 1bed891a7c02e04ea2d0207a9a8eb0de8e4f32bb /bluetooth/bluetooth.h | |
parent | 6446a124787e95acb7f65916ca0b09254de0b86e (diff) |
libqtappfw: bluetooth: update to rewrite of bluetooth binding
Bug-AGL: SPEC-1630
Change-Id: I705df82deefa371afa1f1d6ee57bb5457479408d
Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
Diffstat (limited to 'bluetooth/bluetooth.h')
-rw-r--r-- | bluetooth/bluetooth.h | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/bluetooth/bluetooth.h b/bluetooth/bluetooth.h index d8bbb80..0f38381 100644 --- a/bluetooth/bluetooth.h +++ b/bluetooth/bluetooth.h @@ -19,6 +19,7 @@ #include <QDebug> #include <QObject> +#include <QJsonArray> #include "messageengine.h" @@ -38,17 +39,17 @@ class Bluetooth : public QObject Q_INVOKABLE void start_discovery(void); Q_INVOKABLE void stop_discovery(void); - Q_INVOKABLE void remove_device(QString address); - Q_INVOKABLE void pair(QString address); - Q_INVOKABLE void cancel_pair(QString address); + Q_INVOKABLE void remove_device(QString device); + Q_INVOKABLE void pair(QString device); + Q_INVOKABLE void cancel_pair(QString device); - Q_INVOKABLE void connect(QString address, QString uuid); - Q_INVOKABLE void connect(QString address); + Q_INVOKABLE void connect(QString device, QString uuid); + Q_INVOKABLE void connect(QString device); - Q_INVOKABLE void disconnect(QString address, QString uuid); - Q_INVOKABLE void disconnect(QString address); + Q_INVOKABLE void disconnect(QString device, QString uuid); + Q_INVOKABLE void disconnect(QString device); - Q_INVOKABLE void send_confirmation(void); + Q_INVOKABLE void send_confirmation(int pincode); bool power() const { return m_power; }; bool discoverable() const { return m_discoverable; }; @@ -66,7 +67,10 @@ class Bluetooth : public QObject private: MessageEngine *m_mloop; - void generic_command(QString, QString); + void send_command(QString, QJsonObject); + void set_discovery_filter(); + void discovery_command(bool); + void processDeviceChangesEvent(QJsonObject data); // slots void onConnected(); @@ -82,11 +86,8 @@ class Bluetooth : public QObject QMap<QString, QString> uuids; const QStringList events { - "connection", - "request_confirmation", - "device_added", - "device_removed", - "device_updated", + "device_changes", + "agent", }; }; |