Skip to content

Commit

Permalink
Prefer NUMBER to NUMERIC for variable type
Browse files Browse the repository at this point in the history
As per discussion on the Github pull request, NUMBER would be more suitable than
NUMERIC
  • Loading branch information
aquette committed Mar 3, 2016
1 parent 52e9957 commit 42b79c5
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions clients/upsrw.c
Expand Up @@ -366,8 +366,8 @@ static void do_type(const char *varname)

}

if (!strcasecmp(answer[i], "NUMERIC")) {
printf("Type: NUMERIC\n");
if (!strcasecmp(answer[i], "NUMBER")) {
printf("Type: NUMBER\n");
return;
}

Expand Down
2 changes: 1 addition & 1 deletion docs/net-protocol.txt
Expand Up @@ -133,7 +133,7 @@ Response:
- 'ENUM': an enumerated type, which supports a few specific values
- 'STRING:n': this is a string of maximum length n
- 'RANGE': this is an numeric, either integer or float, comprised in the range (see LIST RANGE)
- 'NUMERIC': this is a simple numeric value, either integer or float
- 'NUMBER': this is a simple numeric value, either integer or float

ENUM, STRING and RANGE are usually associated with RW, but not always.
The default <type>, when omitted, is numeric, so either integer or float. Each
Expand Down
2 changes: 1 addition & 1 deletion server/netget.c
Expand Up @@ -159,7 +159,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 NUMERIC\n", upsname, var);
sendback(client, "TYPE %s %s NUMBER\n", upsname, var);
}

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

0 comments on commit 42b79c5

Please sign in to comment.