BLE: prefer known recognized services

Yes, yes, we should probably be gathering a list of these.  But this is
a test patch for the Cressi BLE dongle, which has a Nordic UART service
that we should pick.

If we were to have a proper list of known services, we could do that for
the Heinrich Weicamp case above too.  Right now that's another hardcoded
service name.

But let's test this first, and if this works and we end up having a
third case one day, we can make it a real list.

Service number reported by Martin de Weger, and screenshots of his from
the Nordic nRF Connect app show that Nordic calls that service "Nordic
UART service".  Which is a big hint that it is probably - wait for it -
a serial UART service.

Sherlock Holmes has nothing on me.  I can figure out these tough
technical conundrums all day long.

Cc: Martin de Weger <martin@deweger.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
Linus Torvalds 2020-02-17 12:58:19 -08:00
parent 75ad9e5383
commit aa80ecc77e

View file

@ -123,6 +123,11 @@ void BLEObject::addService(const QBluetoothUuid &newService)
} }
} }
// Is it a Nordic UART service?
// If so, throw out any earlier services, we'll pick this one
if (newService == QUuid("{6e400001-b5a3-f393-e0a9-e50e24dcca9e}"))
services.clear();
auto service = controller->createServiceObject(newService, this); auto service = controller->createServiceObject(newService, this);
qDebug() << " .. created service object" << service; qDebug() << " .. created service object" << service;
if (service) { if (service) {