From 9e3a22c5220f72fb9b9358dc127808186d3398dd Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Sat, 6 Oct 2018 11:23:08 -0700 Subject: 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 --- core/qt-ble.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'core/qt-ble.h') 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 -- cgit v1.2.3-70-g09d2