<div dir="ltr"><div>Hi there,</div><div><br></div><div>In the first part of the week I wanted to integrate the </div><div>functionalities from my prototype to Subsurface project. </div><div>Therefore I added a dialog widget to the <b>DownloadFromDCWidget</b> </div><div>where an user has the possibility to:</div><div>- turn on/off his local Bluetooth device</div><div>- see some information about the local device</div><div>- scan for remote devices</div><div>- pair/unpair</div><div>- select a device and save its address for the <b>DownloadThread</b></div><div><br></div><div>Next I tried to make the <i>libdivecomputer</i> project to accept </div><div>callbacks to custom functions used for serial communication.</div><div>Here [1] you can find how the new structure looks. I am not </div><div>sure if this is the best way to do it. If you have other </div><div>suggestions please let me know.</div><div>For the moment I choose to have the same functions signatures </div><div>as the ones from native serial implementation [2] to avoid some </div><div>modifications.</div><div><br></div><div>I created a new method [3] which can be used to open a device and </div><div>pass a reference to a custom implementation of a <i><b>dc_serial_t</b></i> </div><div>structure and I modified the <i>hw_ostc</i> and <i>hw_otsc3</i> </div><div>implementations [4] to use the new structure.</div><div><br></div><div>I created a method [5] which can be used to initialize the native </div><div>serial implementation and to initialize a <b>dc_serial_t</b> instance.</div><div>This was used in the old device opening method [6] for backwards </div><div>compatibility.</div><div>I already tested the serial native implementation with my HW OSTCs </div><div>device and it still works.</div><div><br></div><div>I didn't start to make changes on other families of devices because </div><div>I want to know if you agree with this modifications and if you </div><div>have other ideas on how I can improve them.</div><div><br></div><div>In the end I started to implement the serial communication using the </div><div>QtBluetooth API [7] and I am still working on it.</div><div><br></div><div>In the next week I want to finish the data transfer implementation </div><div>and to test it.</div><div><br></div><div>Cheers,</div><div>Claudiu</div><div><br></div><div>[1] - <a href="https://github.com/claudiuolteanu/libdc/blob/Subsurface-testing/include/libdivecomputer/custom_serial.h">https://github.com/claudiuolteanu/libdc/blob/Subsurface-testing/include/libdivecomputer/custom_serial.h</a></div><div>[2] - <a href="https://github.com/claudiuolteanu/libdc/blob/Subsurface-testing/src/serial.h">https://github.com/claudiuolteanu/libdc/blob/Subsurface-testing/src/serial.h</a></div><div>[3] - <a href="https://github.com/claudiuolteanu/libdc/blob/Subsurface-testing/src/device.c#L177-201">https://github.com/claudiuolteanu/libdc/blob/Subsurface-testing/src/device.c#L177-201</a></div><div>[4] - <a href="https://github.com/claudiuolteanu/libdc/commit/960f9d1a3904c17668369694ea196a5f4a66fd88">https://github.com/claudiuolteanu/libdc/commit/960f9d1a3904c17668369694ea196a5f4a66fd88</a></div><div>[5] - <a href="https://github.com/claudiuolteanu/libdc/blob/Subsurface-testing/src/custom_serial.c#L47-80">https://github.com/claudiuolteanu/libdc/blob/Subsurface-testing/src/custom_serial.c#L47-80</a></div><div>[6] - <a href="https://github.com/claudiuolteanu/libdc/blob/Subsurface-testing/src/hw_ostc3.c#L272-278">https://github.com/claudiuolteanu/libdc/blob/Subsurface-testing/src/hw_ostc3.c#L272-278</a></div><div>[7] - <a href="https://github.com/claudiuolteanu/subsurface/blob/master/qtserialbluetooth.cpp">https://github.com/claudiuolteanu/subsurface/blob/master/qtserialbluetooth.cpp</a></div></div>