subsurface/libdc

Android without QT bluetooth : stuck on foreach

jribal opened this issue · 5 comments

Hello,

I'm trying to make libsubsurface work with an OSTC Sport + without Qt Bluetooth, using an Android bluetooth system instead.

I managed to set the device to "download mode" but I seem stuck inside the foreach() function.

I have taken example from qtserialbluetooth.cpp to setup the connection and callbacks.

My assumptions:

  1. My device goes to "download mode" with hw_ostc3_read from hw_ostc3.c line 285.
  2. hw_ostc3_read from hw_ostc3.c line 293 should create a call to my "read" event fromdc_custom_cbs_t.
  3. From the read event I should call my bluetooth socket and fill the void *data with whatever was obtain from the device.
  4. Then I should receive something inside my dc_dive_callback_t and start to extract dive information.

I also regularly receive data inside my "write" callback, something that looks like a keep alive for the bluetooth connection.

Are one of my assumptions wrong ?

Thank you for any future reply.

I don't think anyone here has ever tried anything like that.
We quite specifically are using Qt Bluetooth so we DON'T have to deal with the local stacks :-)

Nothing in your assumptions sounds wrong, but I might be missing something.

You can also look at https://github.com/Subsurface-divelog/subsurface/blob/v4.8.5/core/serial_ftdi.c as a example, of how a custom communication can be built.

My guess is that your communication layer fails in foreach because thats the first place where there are more than single byte communication going on, which might cause something to go wrong.

If you share your code it will be easier to spot the issue.

Thank you for your quick answers.

@dirkhh It makes sense if you don't bother with including the complete QT stack, it seems to work well for the subsurface project.

Here are my code and some logs.
libsubsurface c-jni
libsubsurface java-jni
android logs

@glance- In my logs you can see I only have one byte sent everytime, I checked it on Java and C sides.
I looked at serial_ftdi.c and could not spot a big difference with qtserialbluetooth.c.

Hi @jribal ,
Did you managed to read the data on Android with BLE without Qt ?
Do you have a repository ?

Hi @jeanmatthieud,

Sorry for the late response.
No I could not find a way to move forward.

I would be interested to know if you could find a solution.

No repository, It was for a client.