Skip to content

Commit

Permalink
Modify server side publication for variable type
Browse files Browse the repository at this point in the history
ENUM can be either NUMBER or STRING, which was previously not published.

Reference: #267
  • Loading branch information
aquette committed Aug 16, 2016
1 parent 55ad5fd commit 068e61e
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions server/netget.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,13 +142,11 @@ static void get_type(nut_ctype_t *client, const char *upsname, const char *var)
snprintfcat(buf, sizeof(buf), " RW");

if (node->enum_list) {
sendback(client, "%s ENUM\n", buf);
return;
snprintfcat(buf, sizeof(buf), " ENUM");
}

if (node->range_list) {
sendback(client, "%s RANGE\n", buf);
return;
snprintfcat(buf, sizeof(buf), " RANGE");
}

if (node->flags & ST_FLAG_STRING) {
Expand All @@ -159,7 +157,7 @@ static void get_type(nut_ctype_t *client, const char *upsname, const char *var)
/* Any variable that is not string | range | enum is just a simple
* numeric value */

sendback(client, "TYPE %s %s NUMBER\n", upsname, var);
sendback(client, "%s NUMBER\n", buf);
}

static void get_var_server(nut_ctype_t *client, const char *upsname, const char *var)
Expand Down

0 comments on commit 068e61e

Please sign in to comment.