summaryrefslogtreecommitdiffstats
path: root/core/qt-ble.h
diff options
context:
space:
mode:
Diffstat (limited to 'core/qt-ble.h')
-rw-r--r--core/qt-ble.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/core/qt-ble.h b/core/qt-ble.h
index f1e353946..cd27423a4 100644
--- a/core/qt-ble.h
+++ b/core/qt-ble.h
@@ -2,6 +2,7 @@
#ifndef QT_BLE_H
#define QT_BLE_H
+#include <QVector>
#include <QLowEnergyController>
#include <QEventLoop>
@@ -14,7 +15,10 @@ public:
~BLEObject();
dc_status_t write(const void* data, size_t size, size_t *actual);
dc_status_t read(void* data, size_t size, size_t *actual);
- QLowEnergyService *service;
+
+ //TODO: need better mode of selecting the desired service than below
+ inline QLowEnergyService *preferredService()
+ { return services.isEmpty() ? nullptr : services[0]; }
public slots:
void addService(const QBluetoothUuid &newService);
@@ -23,7 +27,9 @@ public slots:
void writeCompleted(const QLowEnergyDescriptor &d, const QByteArray &value);
private:
- QLowEnergyController *controller;
+ QVector<QLowEnergyService *> services;
+
+ QLowEnergyController *controller = nullptr;
QList<QByteArray> receivedPackets;
QEventLoop waitForPacket;
};