I want to present a design issue for discussion about the USB adapters.

We currently have 3 modes of specifying the USB adpter to use:

-u (which gets the first one)
-u 3 (which gets the 3rd one)
-uall (which gets all)

Marcus wants to add an additional

-u 1:3 which would get the adapter listed by lsusb as

Bus 001 Device 003:  ID 04fa:2490 Dallas Semiconductor DS1490F 2-in-1
Fob, 1-Wire adapter

I thought this was a nice unambiguous extension to the syntax, until I
looked closely at the field representation in the actual library code.

The point is that the Bus number is actually a literal "001" and the
Device either "003" or 3 depending on which field you use from libusb.

The more accurate (and possibly platform independent) way is to
require "001:003" rather than 1:3 but this seems like one of those
annoying "gotchas" if you are entering this at the command line. I
certainly thought 001 and 003 were numbers.

My first thought was to allow both, and assume the text and it's
decimal (?) interpretation are equivalent. On the other hand, if the
only use for the bus:device form is with automated entries from
scripts, keeping everything literal is easier and less ambiguous.

Any opinions?

Paul Alfille

Incidently, this will add an easy way to create usb entries from udev scripts.

------------------------------------------------------------------------------

_______________________________________________
Owfs-developers mailing list
Owfs-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/owfs-developers

Reply via email to