[GSoC] Week 4 (Native Bluetooth support)

Claudiu Olteanu olteanu.vasilica.claudiu at gmail.com
Sun Jun 21 12:09:52 PDT 2015


Hi there,

In the first part of the week I wanted to integrate the
functionalities from my prototype to Subsurface project.
Therefore I added a dialog widget to the *DownloadFromDCWidget*
where an user has the possibility to:
- turn on/off his local Bluetooth device
- see some information about the local device
- scan for remote devices
- pair/unpair
- select a device and save its address for the *DownloadThread*

Next I tried to make the *libdivecomputer* project to accept
callbacks to custom functions used for serial communication.
Here [1] you can find how the new structure looks. I am not
sure if this is the best way to do it. If you have other
suggestions please let me know.
For the moment I choose to have the same functions signatures
as the ones from native serial implementation [2] to avoid some
modifications.

I created a new method [3] which can be used to open a device and
pass a reference to a custom implementation of a *dc_serial_t*
structure and I modified the *hw_ostc* and *hw_otsc3*
implementations [4] to use the new structure.

I created a method [5] which can be used to initialize the native
serial implementation and to initialize a *dc_serial_t* instance.
This was used in the old device opening method [6] for backwards
compatibility.
I already tested the serial native implementation with my HW OSTCs
device and it still works.

I didn't start to make changes on other families of devices because
I want to know if you agree with this modifications and if you
have other ideas on how I can improve them.

In the end I started to implement the serial communication using the
QtBluetooth API [7] and I am still working on it.

In the next week I want to finish the data transfer implementation
and to test it.

Cheers,
Claudiu

[1] -
https://github.com/claudiuolteanu/libdc/blob/Subsurface-testing/include/libdivecomputer/custom_serial.h
[2] -
https://github.com/claudiuolteanu/libdc/blob/Subsurface-testing/src/serial.h
[3] -
https://github.com/claudiuolteanu/libdc/blob/Subsurface-testing/src/device.c#L177-201
[4] -
https://github.com/claudiuolteanu/libdc/commit/960f9d1a3904c17668369694ea196a5f4a66fd88
[5] -
https://github.com/claudiuolteanu/libdc/blob/Subsurface-testing/src/custom_serial.c#L47-80
[6] -
https://github.com/claudiuolteanu/libdc/blob/Subsurface-testing/src/hw_ostc3.c#L272-278
[7] -
https://github.com/claudiuolteanu/subsurface/blob/master/qtserialbluetooth.cpp
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20150621/9263e360/attachment.html>


More information about the subsurface mailing list