[Nut-upsdev] recent and planned changes

Peter Selinger selinger at mathstat.dal.ca
Sat Sep 17 03:17:35 UTC 2005


Arnaud Quette wrote:
> 
> > * The regular expression matching module on the regex_branch is now
> > complete. It works great for me. Give it a try. With "-D -D", you'll see 
> > sufficient debug messages to see what's being opened and what is
> > being matched. Please let me know when I should go ahead and merge
> > these changes into the main Development branch.
> 
> 
> I've not had time to dig this yet (some Debian and MGE things to deal with), 
> but there would be some points missing:
> - Index. This is a param to differentiate 2 devices with exactly the same 
> info (ie same VID/ PID, no serial, ...). Then you could say "the 2nd device 
> with VID xxxx and PID yyyy"

I don't think this will work. There is no fixed meaning to "2nd
device". The devices could be enumerated by libusb in any order.

> - an interesting notion that was introduced by Dave Brownell (linux USB 
> hacker) is the "physical path" (stable ids, which don't change unless usb 
> topology morphs). For more info, search for HIDIOCGPHYS in hidups.
> I find this interesting, but I'm not sure it has been ported...

As per Charles' post, this is probably not possible with the current
backend. The best I could probably do is offer a "bus" option. As far
as I can tell (in Linux), while device numbers are assigned randomly,
busses are physical, e.g. 001, 002, etc correspond to particular fixed
physical USB ports on my computer. (However, I don't know how "fixed"
they really are - perhaps this depends on the order in which they are
discovered during booting?) So if someone really owns several
indistinguishable UPS devices, they might be able to plug them into
different physical ports and use the bus number to match the devices.

I am working on adding support for this. It's somewhat subtle: if the
user didn't specify a bus, then reopening should not try to match the
same bus number as before. But if the user did specify a bus, then
reopening should. The way I intend to solve this problem is by letting
reopen match the exact Vendor/Product/Serial/VendorID/ProductID
information of the device (but not the Bus), and in addition, matching
the original regular expressions (again) on reopening a device.

-- Peter




More information about the Nut-upsdev mailing list