mirror of
https://github.com/Telecominfraproject/wlan-ucentral-client.git
synced 2026-01-27 02:23:32 +00:00
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:
committed by
John Crispin
parent
c536f6957b
commit
549e84e5fe
8
proto.c
8
proto.c
@@ -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")) {
|
||||
|
||||
Reference in New Issue
Block a user