device autoprobing and changig bluetooth handling

Lutz Vieweg lvml at 5t9.de
Mon Mar 4 10:02:08 PST 2013


On 03/03/2013 12:59 AM, Dirk Hohndel wrote:
> On Mar 2, 2013, at 3:24 PM, Jan Schubert wrote:
>> for us in here but for "normal" divers this is something as explaining
>> rebreathers to Linus :-).
>
> Careful - we just ordered the Rebreather course manuals :-)

Hmmm... I guess I'll never understand what makes rebreathers so
attractive to some people that they are willing to take the
about 6 times higher risk for fatal incidents (based on BSAC statistics)
in comparison to open circuit diving.  But back on topic..:

> no, I will not allow Subsurface to send random commands to random
> ports in the hopes that maybe there's a dive computer on the other end.

This is indeed the only reasonable approach.

> One thing I could be talked into is something like this
> - tell the user to connect the DC and put it in download mode
> - check if there is exactly ONE usb-serial device we can see
> - use that device

I think one even better approach to "safe autodetecting" would
be the following:

- Ask user to make sure the DC is _not_ connected.
- Enumerate/memorize all existing devices.
- Ask user to connect the DC, and if applicable, to tell the
   DC to "enter data transfer mode"
- Have the user confirm he did the above.
- Wait some seconds.
- Enumerate all existing devices. "diff" with enumeration
   before DC connect.

-> Assume DC is "the most recently connected device", if any.

Regards,

Lutz Vieweg



More information about the subsurface mailing list