[Interest] Bluetooth LE: HowTo inspect QBluetoothDeviceInfo::serviceUuids

Oliver Wolff Oliver.Wolff at qt.io
Tue Apr 18 10:26:28 CEST 2017


On 13/04/2017 19:01, ekke wrote:
>
> from QBluetoothDeviceInfo::serviceUuids I'm getting a list of Service 
> UUIDs ( QBluetoothUuid) without connecting to the device and 
> inspecting the Services.
>
> there's per ex:
>
> {0000180d-0000-1000-8000-00805f9b34fb}
>
> and I know this means the device supports
>
>
> HeartRate
>
> 0x180d
>
>
> How can I inspect the QBluetoothUuid to get 0x180d
>
>
> I found some Java code like this:
>
>
> private static int getAssignedNumber(UUID uuid) {
>     // Keep only the significant bits of the UUID
>     return (int) ((uuid.getMostSignificantBits() & 
> 0x0000FFFF00000000L) >> 32);
> }
>
>
> but have no idea HowTo do the same from Qt
>

Hi ekke,

I am not sure I fully understand the problem. If you want to check the 
availability of a heart rate sensor, you can just compare the Uuids with 
QBluetoothUuid(QBluetoothUuid::HeartRate) can't you?
>
>
> thx for hints
>
>
> ekke
>
>
>
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20170418/56bce2ab/attachment.html>


More information about the Interest mailing list