mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Add support for the new OSTC hardware
In the latest OSTC hardware, the Telit/Stollman bluetooth module has been replaced with a u-Blox Nina B2 bluetooth module. The BLE communication protocol remains roughly the same, except for a few minor differences: - New UUIDs for services and characteristics - Only one common characteristic for Rx and Tx - Credit based flow control is optional - Credit value of 255 corresponds to a disconnect [Dirk Hohndel: small edit to a comment] Signed-off-by: Jef Driesen <jef@libdivecomputer.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
f8c794e11c
commit
3a77d15eef
2 changed files with 32 additions and 18 deletions
|
|
@ -8,10 +8,15 @@
|
|||
#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
|
||||
#define TELIT_DATA_RX 0
|
||||
#define TELIT_DATA_TX 1
|
||||
#define TELIT_CREDITS_RX 2
|
||||
#define TELIT_CREDITS_TX 3
|
||||
|
||||
#define UBLOX_DATA_RX 0
|
||||
#define UBLOX_DATA_TX 0
|
||||
#define UBLOX_CREDITS_RX 1
|
||||
#define UBLOX_CREDITS_TX 1
|
||||
|
||||
class BLEObject : public QObject
|
||||
{
|
||||
|
|
@ -55,11 +60,16 @@ private:
|
|||
unsigned int desc_written = 0;
|
||||
int timeout;
|
||||
|
||||
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
|
||||
QList<QUuid> telit = {
|
||||
"{00000001-0000-1000-8000-008025000000}", // TELIT_DATA_RX
|
||||
"{00000002-0000-1000-8000-008025000000}", // TELIT_DATA_TX
|
||||
"{00000003-0000-1000-8000-008025000000}", // TELIT_CREDITS_RX
|
||||
"{00000004-0000-1000-8000-008025000000}" // TELIT_CREDITS_TX
|
||||
};
|
||||
|
||||
QList<QUuid> ublox = {
|
||||
"{2456e1b9-26e2-8f83-e744-f34f01e9d703}", // UBLOX_DATA_RX, UBLOX_DATA_TX
|
||||
"{2456e1b9-26e2-8f83-e744-f34f01e9d704}" // UBLOX_CREDITS_RX, UBLOX_CREDITS_TX
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue