[Development] Bluetooth Services problem

Matías Néstor Ares matnares at gmail.com
Tue May 17 11:45:53 CEST 2016


Hello Alex, nice to meet you.

I'm working on an android app right now. The issue is the same in many
devices, (tablets and phones).
I'm using QT 5.6.0 and 5.6.1
using android NDK r10e version (I will update to 11)
Both, I downloaded from http://download.qt.io/snapshots/qt/5.6/

*How do I check the SHA ?*

in both *full* or *minimal* discovery is the same symptom.

inside onServiceDiscovered "service" is undefined.

for example: in the BTscanner example File: scanner.qml the execution of
line :

onServiceDiscovered: console.log("Found new service " +
*service.deviceAddress* + " " + service.deviceName + " " +
service.serviceName);


throw : TypeError: Cannot read property *'deviceAddress'* of undefined


I take a look to the source file
qtconnectivity/src/imports/bluetooth/qdeclarativebluetoothdiscoverymodel.cpp

and I see the emit serviceDiscovered(bs); line is passing a pointer
QDeclarativeBluetoothService *bs = new
QDeclarativeBluetoothService(service, this);

I'm not sure, but maybe, it is relate to other issue i have experienced.
I was using grabToImage in qml to pass an image to a C++ function:
Something like this:

QML:
        var m_status = testIMG.grabToImage(function(imgResult)
        {
             CPPClass.analyzeImage(imgResult.image)
        });

CPP:  (Header File)
        QString analyzeImage(QImage &image);

Previously on Qt 5.5 that was working OK

But after upgrading to Qt 5.6 it stop working.
I changed QString analyzeImage(QImage *&*image); to QString
analyzeImage(QImage image);
and it is working again.
It was broken in linux desktop and android, i have not tested other
platforms yet.
(Obviously I prefer the previous way)

So my hypothesis is: Maybe something related with passing References and
Pointers between C++ and QML is broken.
I really have no time to get my hands deeper in the Qt code to confirm this
hypothesis. But I think the problem may be related somehow.

is there some other information you need? please let me know

Best Regards.


2016-05-17 3:55 GMT-03:00 Alexander Blasche <alexander.blasche at qt.io>:

>
>
> > -----Original Message-----
> > From: Development [mailto:development-
> > bounces+alexander.blasche=qt.io at qt-project.org] On Behalf Of Matías
> Néstor
> > Ares
> > Sent: Sunday, 15 May 2016 9:41
> > To: <development at qt-project.org> <development at qt-project.org>
> > Subject: Re: [Development] Bluetooth Services problem
> >
> > Problem persist in QT 5.6.1
> > some help will be very appreciated !!
>
> What platform are you using QtBluetooth on? (Bluez, Android, iOS and what
> particular version)
> Please state the qtconnectivity SHA that you are using for your 5.6.1
> build!
> Which particular discovery mode triggers the warning (full or minimal)?
> What exactly is printed in your command line when onServiceDiscovered is
> triggered?
>
> --
> Alex
>
> > 2016-05-05 3:34 GMT-03:00 Matías Néstor Ares <matnares at gmail.com
> > <mailto:matnares at gmail.com> >:
> >
> >
> >       Hi Everybody!!
> >
> >       I'm having an issue with bluetooth on QML on android  Qt 5.6.0
> >       I can't even fully test the example:
> >        http://doc.qt.io/qt-5/qtbluetooth-scanner-example.html
> >
> >       trying to access service inside onServiceDiscovered: it gets
> undefined.
> >
> >
> >       as documentation says :  serviceDiscovered(BluetoothService
> service)
> >        serviceDiscovered parameter is "service" but it is undefined...
> >
> >       is it a bug? is there some workaround?
> >
> >       Thanks in advance.
> >
> >       Best regards
> >
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20160517/f571a6f2/attachment.html>


More information about the Development mailing list