[Nut-upsdev] [nut-commits] svn commit r1072 - in trunk: . drivers

Peter Selinger selinger at mathstat.dal.ca
Wed Aug 22 21:18:07 UTC 2007


Arjen de Korte wrote:

> - HIDOpenDevice() will now handle closing the device on reload if
> needed, so that HIDCloseDevice() can now really close it and free
> the allocated memory for report buffer and parsed report descriptor.

If I remember correctly, the old behavior on "reopen" was to keep the
previous report descriptor, and try to find a device that matches the
previously seen device exactly. This was never perfect:

1) it's not always possible to identify the device uniquely, when
   there are two identical devices (and not all models include a
   serial number),

2) we never re-read the report descriptor, and therefore never
   compared that it was identical to the previous one,

3) there was at least one report of a device that looked different at
   reconnection time (didn't show the vendor + product strings), and
   therefore couldn't be matched.

Perhaps a better behaviour for "reconnect" is to connect to any
eligible UPS, even if it's not precisely the same one as the
disconnected one, and then simply re-load and re-parse all the
data. 

In other words, reconnect is exactly the same as connecting the first
time. If people have more than one UPS, and they care which is which,
they anyway have to specify the vendorid or productid or whatever, to
make it unique.

-- Peter




More information about the Nut-upsdev mailing list