Commit graph

7 commits

Author SHA1 Message Date
Claudiu Olteanu
8c373f419d Use SPP's uuid to connect to a device on Apple platforms
Use the uuid of the Serial Port Profile service to connect to a remote
Bluetooth device on OS X (and iOS) platforms with a Qt version greater
than 5.5.0.

In the future the same section should be used for BT connectivity on
Linux platforms. Currently there is a problem with the SDP discovery
and it doesn't work as expected.

[Dirk Hohndel: modified OS check for consistency]

Signed-off-by: Claudiu Olteanu <olteanu.claudiu@ymail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-20 05:51:38 -07:00
Claudiu Olteanu
c6c706c28a Use SPP's uuid to connect to a device on Android platform
On Android, a Bluetooth connection to a service cannot be
established using a port. Therefore we use the uuid of the
Serial Port Profile service to connect to the remote BT
device.

Signed-off-by: Claudiu Olteanu <olteanu.claudiu@ymail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-13 15:21:30 -07:00
Dirk Hohndel
33a7e5cd73 Build fix for older Qt5
This breaks for example on Ubuntu Trusty.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-08 10:59:40 -07:00
Dirk Hohndel
fa69a1b7d5 Allow to compile Subsurface with upstream libdivecomputer
This will create an inconsistent build that has some UI features implying
BT support but those will be non-functional. I don't think this is the
right thing to do - either fail to build with a decent message or really
remove the BT support.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-07 21:41:22 -07:00
Dirk Hohndel
b1538c809d Code cleanup
Make precedence of && over || explicit.
Explicitly convert between char * and unsigned char *.
Don't assign potentially negative return code to an unsigend variable.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-06 13:59:14 -07:00
Claudiu Olteanu
14e071e8d8 Add extra logs for custom serial Bluetooth implementation
This patch increases the verbosity level for QtBluetooth API
and add some extra logs for custom serial Bluetooth open method.

The scope of this patch is only for testing.

Signed-off-by: Claudiu Olteanu <olteanu.claudiu@ymail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-06 08:38:12 -07:00
Claudiu Olteanu
198cc41959 Implement the custom Bluetooth serial communication and use it
Create a custom Bluetooth serial communication using the QTBluetooth
API and use it when the Bluetooth download mode is enabled.
First try to connect on RFCOMM channel 1 because this is the default
RFCOMM channel of SPP service for most devices. If this doesn't work
try again on RFCOMM channel number 5 because it could be a Petrel2 device.

Add a fake open function for the custom implementation. This is
used when the selected device is HW OSTC 2N and the Bluetooth
mode is activated, then fake the open call of the serial device.

Signed-off-by: Claudiu Olteanu <olteanu.claudiu@ymail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-06 08:37:42 -07:00