Android: connect to BT via uuid instead of port

We remember the offered service uuids as we detect the device and then
try the first one - likely this needs to be fixed / tuned to pick the
right one if multiple uuids are offered.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2017-05-30 17:50:31 -07:00
parent 782caf5fa6
commit 286bac6d30
2 changed files with 23 additions and 0 deletions

View file

@ -204,11 +204,15 @@ void QMLManager::mergeLocalRepo()
}
#if BT_SUPPORT
extern void addBtUuid(QBluetoothUuid uuid);
void QMLManager::btDeviceDiscovered(const QBluetoothDeviceInfo &device)
{
QString newDevice = device.name();
QList<QBluetoothUuid> serviceUuids = device.serviceUuids();
foreach (QBluetoothUuid id, serviceUuids) {
addBtUuid(id);
qDebug() << id.toByteArray();
}
appendTextToLog("Found new device " + newDevice + " (" + device.address().toString() + ")");