mirror of
https://dev.iopsys.eu/bbf/bbfdm.git
synced 2025-12-10 07:44:39 +01:00
Device.WiFi.SSID.{i}.MACAddress: read the value from sysfs instead of ubus
This commit is contained in:
parent
8d293b4b3f
commit
7b308da4d7
2 changed files with 4 additions and 15 deletions
|
|
@ -194,14 +194,10 @@ static int set_wlan_ssid(char *refparam, struct dmctx *ctx, void *data, char *in
|
|||
return 0;
|
||||
}
|
||||
|
||||
/*#Device.WiFi.SSID.{i}.MACAddress!UBUS:network.device/status/name,@Name/macaddr*/
|
||||
/*#Device.WiFi.SSID.{i}.MACAddress!SYSFS:/sys/class/net/@Name/address*/
|
||||
static int get_WiFiSSID_MACAddress(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
json_object *res = NULL;
|
||||
dmubus_call("network.device", "status", UBUS_ARGS{{"name", ((struct wifi_ssid_args *)data)->ifname, String}}, 1, &res);
|
||||
DM_ASSERT(res, *value = "");
|
||||
*value = dmjson_get_value(res, 1, "macaddr");
|
||||
return 0;
|
||||
return get_net_device_sysfs(((struct wifi_ssid_args *)data)->ifname, "address", value);
|
||||
}
|
||||
|
||||
/*#Device.WiFi.Radio.{i}.Enable!UCI:wireless/wifi-device,@i-1/disabled*/
|
||||
|
|
|
|||
|
|
@ -33331,15 +33331,8 @@
|
|||
],
|
||||
"mapping": [
|
||||
{
|
||||
"type": "ubus",
|
||||
"ubus": {
|
||||
"object": "network.device",
|
||||
"method": "status",
|
||||
"args": {
|
||||
"name": "@Name"
|
||||
},
|
||||
"key": "macaddr"
|
||||
}
|
||||
"type": "sysfs",
|
||||
"file": "/sys/class/net/@Name/address"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue