Skip to content
Snippets Groups Projects
Commit 11dfd9ff authored by Anjan Chanda's avatar Anjan Chanda
Browse files

write 'uuid' to wireless interface sections

parent f8d118fc
No related branches found
No related tags found
No related merge requests found
......@@ -30,6 +30,8 @@
#include <wsc.h>
#include <easy/easy.h>
#include "debug.h"
#include "utils.h"
#include "config.h"
......@@ -815,6 +817,34 @@ int uci_apply_m2(struct agent_config *cfg, char *interface_name, char *device,
uci_set_wireless_interface_option(UCI_WIRELESS, UCI_WLAN_IFACE, "ifname",
interface_name, "ieee80211v", "1");
do {
char buf[512] = {0};
char basemacstr[18] = {0};
uint8_t basemac[6] = {0};
//uint8_t uuid[16] = {0};
chrCmd(buf, sizeof(buf), "db -q get hw.board.basemac");
if (buf[0] != '\0' && strlen(buf) == 17)
strncpy(basemacstr, buf, 17);
fprintf(stderr, "basemac: %s\n", basemacstr);
hwaddr_aton(buf, basemac);
memset(buf, 0, sizeof(buf));
chrCmd(buf, sizeof(buf),
"uuidgen -s --namespace @dns --name www.iopsys.eu");
if (buf[0] == '\0' || strlen(buf) != 36) {
fprintf(stderr, "uuidgen error!\n");
//TODO
}
snprintf(buf + 24, 13, "%02x%02x%02x%02x%02x%02x", MAC2STR(basemac));
fprintf(stderr, "UUID: %s\n", buf);
uci_set_wireless_interface_option(UCI_WIRELESS, UCI_WLAN_IFACE, "ifname",
interface_name, "uuid", buf);
} while(0);
if (onboarded)
uci_set_wireless_interface_option(UCI_WIRELESS, UCI_WLAN_IFACE, "ifname",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment