ucentral-client: Add discovery metadata to connect payload

Includes contents of /etc/ucentral/discovery.state.json (if present)
in the "discovery" field of the connect message. This allows the
controller to identify how the device discovered its cloud endpoint.

Fixes: WIFI-14966

Signed-off-by: Marek Kwaczynski <marek@shasta.cloud>
This commit is contained in:
Marek Kwaczynski
2025-08-08 12:49:11 +02:00
committed by John Crispin
parent c536f6957b
commit 549e84e5fe

View File

@@ -217,6 +217,14 @@ connect_send(void)
}
blobmsg_close_table(&proto, c);
}
if (!stat("/etc/ucentral/discovery.state.json", &statbuf)) {
c = blobmsg_open_table(&proto, "discovery");
if (!blobmsg_add_json_from_file(&proto, "/etc/ucentral/discovery.state.json")) {
log_send("failed to load discovery state", LOG_ERR);
return;
}
blobmsg_close_table(&proto, c);
}
if (!stat("/tmp/udhcpc-vsi.json", &statbuf)) {
c = blobmsg_open_table(&proto, "udhcpc-vsi");
if (!blobmsg_add_json_from_file(&proto, "/tmp/udhcpc-vsi.json")) {