[Nut-upsuser] Random output of a LIST ENUM command ?

Charles Lepple clepple at gmail.com
Sat Jun 19 20:33:28 BST 2021

On Jun 19, 2021, at 10:25 AM, Roger Price wrote:
> The ENUM entries are not in ascending order.  Does this mean that the output is in random order?, or is there some other logic?

Similar to the LIST RANGE email, I don't have a good citation for this, but my understanding is that this was intended to mirror the order that an UPS uses for its settings (i.e. 0 in the UPS-specific protocol is 103, 1 is 100, etc). In this case, the items are ordered from most sensitive to low-voltage transients, to least sensitive.

The current implementation adds ENUM items to the end of a list, and that list is traversed in the same order each time.

drivers/apcsmart-old.c seems to indicate that the APC protocol has a command to advance the setting to the next in order (similar to what a front panel button would do), but the driver probably doesn't care about the order of the items in the state/dstate data structures.

> _______________________________________________
> Nut-upsuser mailing list
> Nut-upsuser at alioth-lists.debian.net
> https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsuser

More information about the Nut-upsuser mailing list