Alex Blasche

Qt Bluetooth and its state of the union

Published Monday June 29th, 2015
11 Comments on Qt Bluetooth and its state of the union
Posted in Qt, Qt Bluetooth

Even though a lot of Qt use cases are about creating user interfaces, Qt provides a diverse set of middle-layer APIs for non-GUI functionality. One of the younger middle-layer APIs in Qt is Qt Bluetooth. From its first release in Qt 5.2 onwards, it has grown and improved in every Qt release.

In light of the forthcoming Qt 5.5 release, I’d like to tell you a bit more about the current status of Qt Bluetooth. It started out as a solution to interact with Bluetooth devices on Linux using Bluez 4.x. At the time, the supported feature set focused on classic Bluetooth development. It targeted the type of profiles and capabilities most commonly encountered by applications:

  • Local Device Control
  • Device & Service Discovery
  • OBEX Push
  • Serial Port Profile for Server & Client

Over time, the number of supported platforms was significantly expanded to cover Android (Qt 5.3), Bluez 5 (Qt 5.4) & OS X (Qt 5.5). Unfortunately, there are no API’s which would permit the implementation of the above features on iOS too.

One of the more recent feature additions is related to Bluetooth Low Energy and Internet of Things. What started as a Technology Preview in Qt 5.4 for Linux quickly became a very important subset of the Qt Bluetooth APIs. The recent explosion of available wearables, health and environment sensors requires Qt to be able to interact with such Bluetooth Smart enabled devices. Qt 5.5 takes this development into account and provides Bluetooth Low Energy support on all existing Qt Bluetooth platforms. In addition, Bluetooth Low Energy on iOS was added too.

Well, what’s missing? I guess my personal list is rather long and some of those items are less visible. Hopefully, we can close the gap towards the last major platform which is not yet supported. A WinRT port is being planned for Qt 5.6. On the Low Energy side of things, Qt Bluetooth should be able to run on Bluetooth Low Energy devices which offer their services to other devices (server role). Better scanning and advertising features, to interact for example with devices adhering to the iBeacon standard, are desirable too.

For the interested mind, the semi-official roadmap for the missing features is QTBUG-31674. I am interested in your feedback. Either drop a comment here or directly in Jira.

Do you like this? Share it
Share on LinkedInGoogle+Share on FacebookTweet about this on Twitter

Posted in Qt, Qt Bluetooth

11 comments

Scorp1us says:

Wonderful. I haven’t needed it yet, but I foresee BT LE (4.0) being a major player in the mobile space. I have many ideas for BT LE tags beyond the basic trackers…

tripzero says:

When is bluez 5.2 going to be supported?

Alex Blasche Alex Blasche says:

Bluez 5.x is supported since Qt 5.4 already.

Ryan says:

What about Windows 7/8?

Alex Blasche Alex Blasche says:

Hopefully we can fill this gap with a WinRT port in 5.6. It is planned but things may change … as always.

Mario Ribeiro says:

Looking forward to see a WinRT implementation. I also think that BLE will play an important role (is already playing?) in the internet of things, too bad high level libraries are still lacking, most I’ve seen are based on BlueZ. Hopefully Qt will change that (event if it’s a framework focused on GUI).
I’ve been using QBluetoothLowEnergy since the tech preview.

Keep up the good work Alex!

Ed says:

I understand OBEX is a protocol that could be implemented in user code space over a RFCOM SPP connection.

Any tips of how OBEX protocol could be implemented on top on Android and iOS?

I cannot seem to find any OBEX code example implementation.

Alex Blasche Alex Blasche says:

There is no classic Bluetooth API on iOS. It cannot be done.

Android might be possible. If you are looking for examples I suggest a look at openobex which covers this use case for Bluez. I haven’t looked at myself but it might be worth a try. Otherwise there is the Object Exchange specification in the Bluetooth spec (not an example but a good start).

Luke says:

Is HFP currently supported on Android? If not, are there any plans to support it?

Alex Blasche Alex Blasche says:

HFP defines the AudioGateway (AG) and Hands-free Unit (HF) role. I don’t see a use case for either in Qt. The AG role is part of every mobile already. The HF role might have a use case for Qt but even so it is coupled with the Audio backend on the platform and Android does not support the role without further hacks.

On Linux, there is little use case for it as Bluez in conjunction with Ofono can cover the use case. It is a platform integration issue in which I see no spot for Qt.

Tim says:

Yeah I would really like the ability to retrieve raw advertising packets, and fine control of the scanning.

By the way you will probably run into this issue:

http://stackoverflow.com/a/23189339/265521

Commenting closed.

Get started today with Qt Download now