[Nut-upsdev] recent and planned changes
Peter Selinger
selinger at mathstat.dal.ca
Mon Sep 19 16:28:10 UTC 2005
Arnaud wrote:
> 2005/9/17, Charles Lepple <clepple at gmail.com>:
> >
> > On 9/16/05, Peter Selinger <selinger at mathstat.dal.ca> wrote:
> > > Arnaud wrote:
> > > > 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.
>
> this is simply a dumb method to tell the 2nd device found by
> newhidups, whatever the enum order is, that complies to the given
> params (or simply the 2nd UPS found is none params).
Yes, but how would you like to reconnect to a device opened by this
method? I don't think this can be done, as the device may no longer be
the 2nd at reconnect time.
Also, suppose you have 3 devices, and you ask to connect to device #2.
Suppose you cannot open #2, because there is a driver already
attached. Do you then want to fall through to device #3? What if
there's a driver already connected to #1, but not to #2? Do you want
to fall through to #3 in this case (i.e., the 2nd available device),
or do you want to open #2 (i.e., the 2nd overall device)?
I think it is a bad idea to implement such an option. I cannot see how
to do it except as a hack.
I think selecting a device based on the bus ID or bus serial number is
a much better idea, so I'll continue working on that.
-- Peter
More information about the Nut-upsdev
mailing list