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

Peter Selinger selinger at mathstat.dal.ca
Fri Aug 10 20:53:49 UTC 2007

Arjen de Korte wrote:
> Author: adkorte-guest
> Date: Fri Aug 10 20:23:27 2007
> New Revision: 1041
> Log:
> * drivers/usbhid.[ch]:
> - Moved the struct & data for ups.status processing to usbhid.c, since this is only used in there. Subdrivers report the status through text messages, they don't set the status bits directly.
> - Rewrote (flattened) the upsdrv_updateinfo() and hid_ups_walk() functions, so that it is easier to follow/understand what is happening. Also limit the amount of status update to once every upsdrv_updateinfo and not for each status report we get. This is enough, since we don't handle requests from clients when we're talking/listening to the UPS.
> - If the UPS sends reports on the interrupt pipeline, we consider that enough proof that it is still there. At the same time, we assume that it keeps us informed of *all* important status changes, so that doing a HU_WALKMODE_QUICK_UPDATE is redundant then.

This latter assumption is probably not valid in all cases. For
example, since the interrupt value of
UPS.PowerSummary.BelowRemainingCapacityLimit was broken on Belkin, we
decided to go with UPS.BELKINStatus.BELKINBatteryStatus instead, which
is a variable that is *not* sent on the interrupt pipeline. 

In general, not every UPS that uses the interrupt pipeline can be
trusted to send all important values on it. 

-- Peter

> - Added a ups_infoval_set() function that is doing the actual setting of values we got from the UPS. This is convenient, so that if we change something in the way we deal with those, it is all in one location.

More information about the Nut-upsdev mailing list