device autoprobing and changig bluetooth handling

Dirk Hohndel dirk at hohndel.org
Mon Mar 4 10:17:53 PST 2013


Lutz Vieweg <lvml at 5t9.de> writes:

> 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..:

I said we ordered the manuals, not that we are going to dive them
necessarily... :-)

>> 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.

That's certainly a much better approach.

Care to implement it?

/D


More information about the subsurface mailing list