Roger Price
2021-Sep-02 09:50 UTC
[Nut-upsdev] Looking for examples of var TYPE descriptions
On Wed, 1 Sep 2021, Glen Bakeman via Nut-upsdev wrote:> I'm currently trying to understand the implementation of get_type in netget.c, > specifically how more complex variable types (such as ENUMs or RANGEs) are > represented by text. On my own UPS, it doesn't seem to have anything more > complicated than a number or string (or UNKNOWN). > > It looks like it would be theoretically possible for a var to show as enum OR > range AND string OR number, is that true?Have a look at section 4.2.4 GET at http://rogerprice.org/NUT/draft-rprice-ups-management-protocol-05.html#name-get-2 Roger
Glen Bakeman
2021-Sep-02 22:13 UTC
[Nut-upsdev] Looking for examples of var TYPE descriptions
Thank you for the info, Roger. I was going off of the developer guide <https://networkupstools.org/docs/developer-guide.chunked/ar01s09.html> at nut.org which seems pretty close to the one you linked to, at least for the section I'm in right now. I don't think I quite have the answer I'm looking for. To give a little more background, I'm working on a program that, among other things, will parse the variable type(s) that are passed to it from a NUT server. I'd like to understand just how exotic/complicated a variable type can get. If that means ENUMs are just enum and nothing else, great - although from my understanding in the master branch of the nut-ups code, it seems possible that variables can mix and match when the server responds to such a query. I'm hoping someone can maybe provide a few examples of what the most complex variables look like, since I don't seem to have those on my end. Glen On 9/2/2021 2:50 AM, Roger Price wrote:> On Wed, 1 Sep 2021, Glen Bakeman via Nut-upsdev wrote: > >> I'm currently trying to understand the implementation of get_type in >> netget.c, specifically how more complex variable types (such as ENUMs >> or RANGEs) are represented by text. On my own UPS, it doesn't seem to >> have anything more complicated than a number or string (or UNKNOWN). >> >> It looks like it would be theoretically possible for a var to show as >> enum OR range AND string OR number, is that true? > > Have a look at section 4.2.4 GET at > http://rogerprice.org/NUT/draft-rprice-ups-management-protocol-05.html#name-get-2 > > > Roger > > _______________________________________________ > Nut-upsdev mailing list > Nut-upsdev at alioth-lists.debian.net > https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsdev-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://alioth-lists.debian.net/pipermail/nut-upsdev/attachments/20210902/59d6dfcd/attachment.htm>