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>
This commit is contained in:
Linus Torvalds 2018-10-06 11:23:08 -07:00 committed by Dirk Hohndel
parent 9dac90c6bf
commit 9e3a22c522
5 changed files with 11 additions and 1 deletions

View file

@ -70,6 +70,7 @@ void DownloadThread::run()
auto internalData = m_data->internalData();
internalData->descriptor = descriptorLookup[m_data->vendor() + m_data->product()];
internalData->download_table = &downloadTable;
internalData->btname = strdup(m_data->devBluetoothName().toUtf8());
#if defined(Q_OS_ANDROID)
// on Android we either use BT, a USB device, or we download via FTDI cable
if (!internalData->bluetooth_mode && (same_string(internalData->devname, "FTDI") || same_string(internalData->devname, "")))