On Dec 29, 2020, at 9:54 AM, Shakil Shaikh via Nut-upsuser wrote:
> 
> Are clients therefore supposed to list all possibilities, or split on space 
> to get the flags back?
> 
Clients should split on space. I remember we had a better description of this 
from the protocol perspective, but that description does not seem to be in the 
current documentation (which has a description aimed at driver developers).

This is the code that builds ups.status for the drivers:

https://github.com/networkupstools/nut/blob/v2.7.4/drivers/dstate.c#L850

as suggested in the developer guide:

https://networkupstools.org/docs/developer-guide.chunked/ar01s04.html#_manipulating_the_data

As Roger indicated, upsmon is the canonical example for parsing ups.status.

https://github.com/networkupstools/nut/blob/v2.7.4/clients/upsmon.c#L1474
_______________________________________________
Nut-upsuser mailing list
Nut-upsuser@alioth-lists.debian.net
https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsuser

Reply via email to