summaryrefslogtreecommitdiffstats
path: root/core/qt-ble.h
diff options
context:
space:
mode:
authorGravatar Linus Torvalds <torvalds@linux-foundation.org>2018-10-06 11:23:08 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2018-10-08 00:10:29 +0300
commit9e3a22c5220f72fb9b9358dc127808186d3398dd (patch)
treee86dc03a7a59bbb852294ffabbccb6999359ccb2 /core/qt-ble.h
parent9dac90c6bfe6e15f054602ada793fc83bdcb5fd8 (diff)
downloadsubsurface-9e3a22c5220f72fb9b9358dc127808186d3398dd.tar.gz
qt-ble: add 'get_name()' function to expose the BLE name to libdivecomputer
Some divecomputer backends (ok, right now really only the Aqualung i770R and i300C) want to know the bluetooth name of the dive computer they connect to, because the name contains identifying information like the serial number. This just adds the support for that to our Qt BLE code. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'core/qt-ble.h')
-rw-r--r--core/qt-ble.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/core/qt-ble.h b/core/qt-ble.h
index f9600ad19..65e23964a 100644
--- a/core/qt-ble.h
+++ b/core/qt-ble.h
@@ -23,6 +23,7 @@ public:
inline void set_timeout(int value) { timeout = value; }
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);
+ inline const char *get_name() { return device->btname; }
inline QLowEnergyService *preferredService() { return preferred; }
inline int descriptorWritten() { return desc_written; }
@@ -63,6 +64,7 @@ dc_status_t qt_ble_set_timeout(void *io, int timeout);
dc_status_t qt_ble_read(void *io, void* data, size_t size, size_t *actual);
dc_status_t qt_ble_write(void *io, const void* data, size_t size, size_t *actual);
dc_status_t qt_ble_close(void *io);
+const char *qt_ble_get_name(void *io);
}
#endif