summaryrefslogtreecommitdiffstats
path: root/src/rest.c
diff options
context:
space:
mode:
authorOpenGnSys Support Team <soporte-og@soleta.eu>2024-10-31 00:05:42 +0100
committerOpenGnSys Support Team <soporte-og@soleta.eu>2024-10-31 00:37:03 +0100
commit16cc22df3eec0acca53df3178be22f862bf9fa99 (patch)
tree6cf547f442a62d3cdf84a1d8e1051e16cd131497 /src/rest.c
parent2febb50a92adb91e88825a7839c1f055c10ba6cf (diff)
src: place last client command information in struct
just a preparation, no functional changes are intended.
Diffstat (limited to 'src/rest.c')
-rw-r--r--src/rest.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/rest.c b/src/rest.c
index b96cf49..2a8b642 100644
--- a/src/rest.c
+++ b/src/rest.c
@@ -122,7 +122,7 @@ static struct og_client *og_client_find(const char *ip)
static const char *og_client_status(const struct og_client *cli)
{
- switch (cli->last_cmd) {
+ switch (cli->last_cmd.type) {
case OG_CMD_UNSPEC:
break;
default:
@@ -244,7 +244,7 @@ static bool og_client_is_busy(const struct og_client *cli,
case OG_CMD_STOP:
break;
default:
- if (cli->last_cmd != OG_CMD_UNSPEC)
+ if (cli->last_cmd.type != OG_CMD_UNSPEC)
return true;
break;
}
@@ -319,7 +319,7 @@ int og_send_request(enum og_rest_method method, enum og_cmd_type type,
if (send(client_sd, buf, strlen(buf), 0) < 0)
continue;
- cli->last_cmd = type;
+ cli->last_cmd.type = type;
}
json_decref((json_t *)data);
@@ -396,7 +396,7 @@ static int og_json_client_append(json_t *array, struct og_client *client)
}
json_object_set_new(object, "state", state);
json_object_set_new(object, "speed", json_integer(client->speed));
- last_cmd = og_json_client_cmd_result(client->last_cmd_result);
+ last_cmd = og_json_client_cmd_result(client->last_cmd.result);
json_object_set_new(object, "last_cmd", last_cmd);
json_array_append_new(array, object);