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

2017-04-19 Thread ekke
Am 19.04.17 um 10:47 schrieb ekke:
> Am 19.04.17 um 09:45 schrieb Oliver Wolff:
>> ...
>>> now I'm simply comparing found ServiceUUIDs with the full value
>>> {180d--1000-8000-00805f9b34fb}
>>> to detect the Device as a HeartRate Device
>> You don't need to compare to the full value. Comparing to
>> QBluetoothUuid::HeartRate also works (at least it does here). I think
>> if that does not work it's a bug or I am still not understanding the
>> problem at hand.
Oliver,

you're right: QBluetoothUuid::HeartRate also detects the ServiceUUIDs
with the long value
so it's much easier in Qt as in Java ;-)

thx again

ekke
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


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

2017-04-19 Thread ekke
Am 19.04.17 um 09:45 schrieb Oliver Wolff:
> ...
>> now I'm simply comparing found ServiceUUIDs with the full value
>> {180d--1000-8000-00805f9b34fb}
>> to detect the Device as a HeartRate Device
> You don't need to compare to the full value. Comparing to
> QBluetoothUuid::HeartRate also works (at least it does here). I think
> if that does not work it's a bug or I am still not understanding the
> problem at hand.
thx - will try it again - perhaps I did something wrong in an earlier
state of the app

ekke
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


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

2017-04-19 Thread Oliver Wolff



On 18/04/2017 11:12, ekke wrote:

Am 18.04.17 um 10:26 schrieb Oliver Wolff:

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:

{180d--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() & 
0xL) >> 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?

Hi Oliver,

as soon as I connect to the device and discovered Services I can 
compare with QBluetoothUuid::HeartRate (0x180d)


if I only discover the Devices without connecting, most devices 
provide ServiceUUIDs

http://doc.qt.io/qt-5/qbluetoothdeviceinfo.html#serviceUuids
but here the UUID isn't 0x180d for HeartRateService, but 
{180d--1000-8000-00805f9b34fb}


so looking at the ServiceUUIDs I don't have to nonnect to the device 
to know that it supports HeartRate :)


now I'm simply comparing found ServiceUUIDs with the full value
{180d--1000-8000-00805f9b34fb}
to detect the Device as a HeartRate Device
You don't need to compare to the full value. Comparing to 
QBluetoothUuid::HeartRate also works (at least it does here). I think if 
that does not work it's a bug or I am still not understanding the 
problem at hand.


googled and found that there's a (Java) way to get the most 
significant Bits from ServiceUUID to compare with

QBluetoothUuid::HeartRate (0x180d)

would make the example app easier to understand

I'm just finishing a new BT LE Example APP - will be published soon

ekke



___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


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

2017-04-18 Thread ekke
Am 18.04.17 um 10:26 schrieb Oliver Wolff:
> 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:
>>
>> {180d--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() &
>> 0xL) >> 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?
Hi Oliver,

as soon as I connect to the device and discovered Services I can compare
with QBluetoothUuid::HeartRate (0x180d)

if I only discover the Devices without connecting, most devices provide
ServiceUUIDs
http://doc.qt.io/qt-5/qbluetoothdeviceinfo.html#serviceUuids
but here the UUID isn't 0x180d for HeartRateService, but
{180d--1000-8000-00805f9b34fb}

so looking at the ServiceUUIDs I don't have to nonnect to the device to
know that it supports HeartRate :)

now I'm simply comparing found ServiceUUIDs with the full value
{180d--1000-8000-00805f9b34fb}
to detect the Device as a HeartRate Device

googled and found that there's a (Java) way to get the most significant
Bits from ServiceUUID to compare with
QBluetoothUuid::HeartRate (0x180d)

would make the example app easier to understand

I'm just finishing a new BT LE Example APP - will be published soon

ekke

___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


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

2017-04-18 Thread Oliver Wolff

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:

{180d--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() & 
0xL) >> 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@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest