summaryrefslogtreecommitdiffstats
path: root/bluetooth/bluetooth.h
diff options
context:
space:
mode:
authorMatt Ranostay <matt.ranostay@konsulko.com>2018-10-30 09:49:21 -0700
committerMatt Ranostay <matt.ranostay@konsulko.com>2018-11-21 13:36:34 -0800
commit4b397bae8a69c814c80c64b2d9c2d01e3877582e (patch)
tree046ecaf7e8345975d41fd9555e03a3ec2dc0b3be /bluetooth/bluetooth.h
parent5d24f154a70c4bf2ce9aea28a60bc5e55eb1f925 (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.h29
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",
};
};