richsmith / sexytopo

The SexyTopo cave surveying app for Android
GNU General Public License v3.0
30 stars 13 forks source link

Instrument connection does not turn off reliably #164

Closed CaverBruce closed 2 years ago

CaverBruce commented 3 years ago

This issue can be replicated when a distoX2 has been connected and successfully used to transmit data. Not particularly important, just a bit messy.

Use menu item Instrument.Connect... Slide the 'connect' slider to off position. image However the distoX2 continues to be connected (as evidenced by the flashing bluetooth icon), even after waiting for some time. This seems to be quite repeatable.

From there on things become a bit random. Sliding the connect slider to on position disconnects bluetooth (stops the icon flashing). Toggling the slider some more seems to get both devices back in sync (reporting the same bluetooth status) eventually.

However if you leave the slider 'off' as initially described...

When the slider says disconnected, none of the instrument functions communicate with the disto (although the disto thinks it is connected). This is acceptable (graceful failure) behaviour.

When the slider says disconnected and measurements are taken by the disto, the bluetooth icon continues to flash for a while, then stops (it realises that it is not in fact connected). Also acceptable (graceful failure) behaviour.

If you avoid trying to disconnect the devices this way, all the other Instrument actions work (laser off, calibration, distoX off, take shot, laser on).

v1.6.0, Samsung Note 3, Android 5

BTW I don't expect I would use this function. I would just turn off the disto!

richsmith commented 2 years ago

I don't think there's any way to tell the disto to disconnect. The switch is only supposed to tell SexyTopo to (dis)connect. Going to close this, as this is working as intended.

There's a bit more control on the bric-4 (maybe the SAP4, can't remember), so if the other device has disconnected, SexyTopo's interface reflects that.