← Back to team overview

ubuntu-phone team mailing list archive

Re: Bluetooth support for app development

 



Op woensdag 4 mei 2016 13:52:32 CEST schreef Pat McGowan <pat.mcgowan@xxxxxxxxxxxxx>:
On Wed, May 4, 2016 at 7:37 AM, Michael Zanetti <
michael.zanetti@xxxxxxxxxxxxx> wrote:



On 04.05.2016 12:16, Konrad Zapalowicz wrote:
> On 05/04, Matthijs wrote:
>> Hi all,
>>
>> My apologies if this has been asked before, but I couldn't find amy
info on
>> it, so here it goes:
>
> No worries :)
>
>> I'm making an app for heartrate measurement with a bluetooth le sensor.
I've
>> been using the Qt bt framework and the app works perfectly on amd64
>> platform, but qt bluetooth is not part of the armhf click chroot. As I
>> understand I should be using bluez rather than Qt for bluetooth, but I
just
>> can not get the app to compile (headers of libbluetooth installed, but
>> cannot link against lbluetooth).
>
> Are you sure that this library is installed? I ask because you mention
> only the headers.

Using QtBluetooth is fine, however, it is indeed not seeded in the
image. For now you can ship those libs yourself in your click package,
but we really should start shipping them in the image.

Pat, Konrad, what's your opinions on that?


qml-module-qtbluetooth is installed since OTA 9 with libqt5bluetooth5
To use this, I should access the bt device from qml right? Or does it also provide the C++ api?




Also note that right now you will only be able to publish any Bluetooth
enabled app in the OpenStore. There are apparmor policies missing for
Bluetooth.

Again, Pat, Konrad, what's the ETA on that? I reported some bugs already
for this with information on what would be required. Think we could put
that on the roadmap for the near future now?


 I will follow up on https://bugs.launchpad.net/bugs/1569582

Pat


>
>> Is there any information available on the steps to take to access a bt
>> device on ubuntu phone, using C++?
>
> As for the BlueZ you must know that the communication is realized using
> the DBus interfaces. The BlueZ is exposing an API that allows the
> clients to pair, connect, etc... You may try to read the Ubuntu System
> Settings sources Bluetooth plugin [1] to get the understanding how this
> is done.

I would not recommend to use the D-Bus interface directly in client
apps, instead, go through QtBluetooth as far as it's possible.

Here you can find some apps that make use of Bluetooth:

* Using QBluetoothSocket for an RFCOMM connection to a smartwatch
https://launchpad.net/rockwork

I have used a similar approach to this. On armhf target the Qt module bluetooth is not found when trying to compile. I'll have a look at providing the libs myself. Thanks for the hint!

* Using QBluetoothDeviceDiscoveryModel and QBluetoothFileTransfer to
find nearby devices and send files to them.
http://bazaar.launchpad.net/~mzanetti/+junk/ubtd/files/head:/shareplugin/

Please let us know about your use cases to collect some experience on
what apps would want to do with Bluetooth.

For now I want to have an app that measures my heartrate from a polar h7 or compatible sensor and gives adio feedback if upper or lower threshold is exceeded.

Another use case would be a 'Torque'-like app for interfacing with an ELM327 based obd2bluetooth connector.

Cheers,
Michael



Thanks for the help so far, it's greatly appreciated,

Cheers,
Matthijs


--
Verzonden via Dekko vanaf mijn Ubuntu-apparaat


Follow ups

References