help needed: Android devices and FTDI dive computers

Dirk Hohndel dirk at hohndel.org
Wed Aug 8 13:41:11 PDT 2018


On Wed, Aug 08, 2018 at 12:30:44PM -0700, Linus Torvalds wrote:
> On Wed, Aug 8, 2018 at 12:07 PM Dirk Hohndel <dirk at hohndel.org> wrote:
> >
> > I believe that to be wrong. As you see in the screenshot posted here,
> > there's a name from a database, and a name as reported from the device.
> > Clearly the name "Smartinterface" is not what came from some database for
> > Vendor ID 0403 - as that is FTDI.
> 
> So the USB spec does have the _possibility_ of USB devices returning
> strings. But you generally shouldn't rely on them either, because many
> don't, or they are "fake".
> 
> See
> 
>     https://www.beyondlogic.org/usbnutshell/usb5.shtml#StringDescriptors

Yes, that matches my recollection.

> for some commentary about the string descriptors. Note the "human
> readable information and are optional".

To recap my point... my goal is to build a mapping that says "if we see
this string for the first time, we happen to know that it's a good guess
that this is the following device or at least following vendor" and to
populate the combo boxes accordingly.

And your idea that you suggested to then remember what the user actually
used will make this even better.

Nothing I am proposing implies that we /rely/ on this information or that
the user can'r override it in case it's wrong. I'm simply saying "hey, if
someone plugs in an OSTC 3 and if we see "HeinrichsWeikamp OSTC 3" as name
then we really can make this easier for the user by automatically picking
the right settings.

> But if you care, the strings the Suunto returns are
> 
>    Suunto
>    Suunto Sports Instrument

Thanks. So if we see this the first time, it seems reasonable to populate
the Vendor combobox with Suunto and leave the product empty. And if you
then select "Vyper Air" and download from it, we could remember that and
offer this by default the next time we see this cable (or a cable that
identifies itself like this). This means for the user with two different
Suunto computers we will potentially pre-populate the wrong product. But
they can always simply correct that.

> But again, the vendor ID/device ID is the actually _identifying_ data.
> And not all devices will even have the string data at all.

Correct. I'm ok with that. What I'm wondering is if some dive computers
might report the FTDI vendor ID but have a custom string that helps us to
a more educated guess. And maybe this will all turn out to be wrong or
useless in most cases. But I think it's worth collecting data and trying
to figure out if there is value there...

> (Although it's possible that in practice, the dive computer interfaces
> end up having them, although they might be fairly random).

That's what I'm trying to find out :-)

/D



More information about the subsurface mailing list