diff options
author | Jan Mulder <jlmulder@xs4all.nl> | 2017-07-03 19:24:39 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2017-07-04 23:46:07 +0900 |
commit | 6fe0388b966fe3a6d811f63a299896279864d8e7 (patch) | |
tree | 29ea4fc55149786aabefc95956ffafc5b8d4c561 /core/qt-ble.h | |
parent | 40d85b5d633568a76c570d01d0ca00463e060c23 (diff) | |
download | subsurface-6fe0388b966fe3a6d811f63a299896279864d8e7.tar.gz |
OSTC over BLE: initialize Terminal I/O client
This initalizes the Terminal I/O client as described in paragraph 3 of
http://www.telit.com/fileadmin/user_upload/products/Downloads/sr-rf/BlueMod/TIO_Implementation_Guide_r04.pdf
This is for all Heinrichs Weikamp computers, that use referenced BT/BLE hardware
module from Telit Wireless Solutions (Formerly Stollmann E+V GmbH). The 16 bit
UUID 0xFEFB (or a derived 128 bit UUID starting with 0x0000FEFB is a
clear indication that the OSTC is equipped with this BT/BLE hardware.
Furthermore, most devices equipped with this BT/BLE hardware have BT addresses
starting with 00:80:25:...
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
Diffstat (limited to 'core/qt-ble.h')
-rw-r--r-- | core/qt-ble.h | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/core/qt-ble.h b/core/qt-ble.h index 247f7d64c..34c726bb2 100644 --- a/core/qt-ble.h +++ b/core/qt-ble.h @@ -6,6 +6,11 @@ #include <QLowEnergyController> #include <QEventLoop> +#define HW_OSTC_BLE_DATA_RX 0 +#define HW_OSTC_BLE_DATA_TX 1 +#define HW_OSTC_BLE_CREDITS_RX 2 +#define HW_OSTC_BLE_CREDITS_TX 3 + class BLEObject : public QObject { Q_OBJECT @@ -25,14 +30,22 @@ public slots: void serviceStateChanged(QLowEnergyService::ServiceState s); void characteristcStateChanged(const QLowEnergyCharacteristic &c, const QByteArray &value); void writeCompleted(const QLowEnergyDescriptor &d, const QByteArray &value); - + int setupHwTerminalIo(QList<QLowEnergyCharacteristic>); private: QVector<QLowEnergyService *> services; QLowEnergyController *controller = nullptr; QList<QByteArray> receivedPackets; QEventLoop waitForPacket; + bool isCharacteristicWritten; dc_user_device_t *device; + + QList<QUuid> hwAllCharacteristics = { + "{00000001-0000-1000-8000-008025000000}", // HW_OSTC_BLE_DATA_RX + "{00000002-0000-1000-8000-008025000000}", // HW_OSTC_BLE_DATA_TX + "{00000003-0000-1000-8000-008025000000}", // HW_OSTC_BLE_CREDITS_RX + "{00000004-0000-1000-8000-008025000000}" // HW_OSTC_BLE_CREDITS_TX + }; }; |