Cleaned up and rebased "libdivecomputer-NG" branch

Dirk Hohndel dirk at hohndel.org
Wed Apr 25 16:08:33 PDT 2018


On Wed, Apr 25, 2018 at 01:50:46PM -0700, Dirk Hohndel wrote:
> 
> > On Apr 25, 2018, at 1:34 PM, Dirk Hohndel <dirk at hohndel.org> wrote:
> >> or similar. But it _would_ be good to test that this actually makes
> >> Petrel 2 work with rfcomm. Because it's certainly possible that there
> >> is something else wrong with rfcomm.
> > 
> > Right now I'm testing.
> > 
> > (1) BT-only Petrel and Android: works
> >    - but if you cancel on the Petrel (which makes it shut down its BT
> >      stack) then Subsurface-mobile gets confused. It keeps sitting in the
> >      download screen, Cancel doesn't work, and I can't get it to show me
> >      the dives that it has downloaded so far.
> > (2) dual stack Petrel 2 and Android:
> >    - RF Connect claims this is an LE only device
> >    - whatever I try, it refuses to pair / connect / bond
> >    I know that this Petrel 2 has connected to this Android phone before,
> >    so this is yet another of these "what the heck is going on" situations.
> >    Next I'll remove the battery and reboot the phone, but I'm running out
> >    of ideas how to make this work.
> 
> And after rebooting everything I finally got it connected.
> Subsurface sees it both as LE and classic device. I tried downloading
> via both protocols and in both cases got "Dive computer transport
> not supported". So we must be doing something wrong there.
> I'll add more debugging output to see what I can figure out.

With a bunch more debugging code added (and a rewritten function to report
the supported transports), here are the logs from the attempts with BLE
and with BT to connect to my Petrel 2 / dual stack:


"10.440: DCDownloadThread started for Petrel 2 on LE:00:13:43:0D:2B:30"
Starting download from  BT
Starting the thread 0
"10.441: dc_descriptor_get_transports"
"10.441: SERIAL BT BLE "
"10.442: get_supported_transports returns"
"10.442: BLE "
Creating Android Central/Client support for BTLE
qt_ble_open( 00:13:43:0D:2B:30 )
Connection updated: error: QLowEnergyController::Error(NoError) oldState: QLowEnergyController::ControllerState(ConnectingState) newState: QLowEnergyController::ControllerState(ConnectedState)
"LocalDeviceBroadcastReceiver::onReceive() - event: android.bluetooth.device.action.ACL_CONNECTED"
connected to the controller for device 00:13:43:0D:2B:30
  .. discovering services
Service discovery initiated
 .. done discovering services
failed to find suitable service on 00:13:43:0D:2B:30
Deleting BLE object
"34.311: Failed to find suitable service on '00:13:43:0D:2B:30'"
Finishing the thread Unable to open %s %s (%s) dives downloaded 0
Finishing the thread Unable to open %s %s (%s) dives downloaded 0
"34.313: Unsupported operation"
no new dives downloaded
"34.315: DCDownloadThread finished"
"LocalDeviceBroadcastReceiver::onReceive() - event: android.bluetooth.device.action.ACL_DISCONNECTED"

[...]


"8.657: DCDownloadThread started for Petrel 2 on 00:13:43:06:75:62"
Starting download from  BT
Starting the thread 0
"8.659: dc_descriptor_get_transports"
"8.659: SERIAL BT BLE "
"8.659: get_supported_transports returns"
"8.659: BT BLE "
connecting to Uuid "{00001101-0000-1000-8000-00805f9b34fb}"
connectToService() "00:13:43:06:75:62" "{00001101-0000-1000-8000-00805f9b34fb}"
Connnecting via insecure rfcomm
Connecting socket
The connection step took more than expected. Wait another 20 seconds
Falling back to reverse uuid workaround.
Workaround failed
Failed to connect to device  00:13:43:06:75:62 . Device state  QBluetoothSocket::UnconnectedState . Error:  QBluetoothSocket::ServiceNotFoundError
Creating Android Central/Client support for BTLE
qt_ble_open( 00:13:43:06:75:62 )
timeout while trying to connect to the controller  00:13:43:06:75:62
"26.247: Timeout while trying to connect to 00:13:43:06:75:62"
Finishing the thread Unable to open %s %s (%s) dives downloaded 0
"26.252: Unsupported operation"
no new dives downloaded
"26.289: DCDownloadThread finished"

Any idea what to poke at next?

/D


More information about the subsurface mailing list