mirror of
https://dev.iopsys.eu/bbf/bbfdm.git
synced 2025-12-10 07:44:39 +01:00
WiFi: fix get/set value of SupportedFrequencyBands and OperatingFrequencyBand parameters
This commit is contained in:
parent
ca77ff8d68
commit
e4f1fd8653
7 changed files with 45 additions and 5 deletions
|
|
@ -106,6 +106,7 @@ int os__get_access_point_associative_device_statistics_retry_count(char *refpara
|
|||
int os__get_access_point_associative_device_statistics_multiple_retry_count(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_radio_max_bit_rate (char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_radio_frequency(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_radio_supported_frequency_bands(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_radio_channel(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_neighboring_wifi_diagnostics_diagnostics_state(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_neighboring_wifi_diagnostics_result_ssid(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
|
|
|
|||
|
|
@ -311,6 +311,19 @@ int os__get_radio_frequency(char *refparam, struct dmctx *ctx, void *data, char
|
|||
return 0;
|
||||
}
|
||||
|
||||
/*#Device.WiFi.Radio.{i}.SupportedFrequencyBands!UBUS:wifi.radio.@Name/status//supp_bands*/
|
||||
int os__get_radio_supported_frequency_bands(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
json_object *res = NULL;
|
||||
char object[32];
|
||||
|
||||
snprintf(object, sizeof(object), "wifi.radio.%s", section_name(((struct wifi_radio_args *)data)->wifi_radio_sec));
|
||||
dmubus_call(object, "status", UBUS_ARGS{}, 0, &res);
|
||||
DM_ASSERT(res, *value = "");
|
||||
*value = dmjson_get_value_array_all(res, DELIMITOR, 1, "supp_bands");
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*#Device.WiFi.Radio.{i}.ChannelsInUse!UCI:wireless/wifi-device,@i-1/channel*/
|
||||
int os__get_radio_channel(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -221,6 +221,11 @@ int os__get_radio_frequency(char *refparam, struct dmctx *ctx, void *data, char
|
|||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_radio_supported_frequency_bands(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_radio_channel(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
|
|
|
|||
|
|
@ -1341,9 +1341,17 @@ static int set_WiFiAccessPointAccounting_Secret(char *refparam, struct dmctx *ct
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int get_radio_supported_frequency_bands(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
static int set_radio_frequency(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
|
||||
{
|
||||
*value = "2.4GHz,5GHz";
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, -1, -1, SupportedFrequencyBands, 2, NULL, 0))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
dmuci_set_value_by_section(((struct wifi_radio_args *)data)->wifi_radio_sec, "hwmode", (!strcmp(value, "5GHz") ? "11a" :"11g"));
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -2275,8 +2283,8 @@ DMLEAF tWiFiRadioParams[] = {
|
|||
{"LowerLayers", &DMWRITE, DMT_STRING, get_WiFiRadio_LowerLayers, set_WiFiRadio_LowerLayers, NULL, NULL, BBFDM_BOTH},
|
||||
{"Name", &DMREAD, DMT_STRING, get_WiFiRadio_Name, NULL, NULL, NULL, BBFDM_BOTH},
|
||||
{"MaxBitRate", &DMREAD, DMT_UNINT, os__get_radio_max_bit_rate, NULL, NULL, NULL, BBFDM_BOTH},
|
||||
{"OperatingFrequencyBand", &DMREAD, DMT_STRING, os__get_radio_frequency, NULL, NULL, NULL, BBFDM_BOTH},
|
||||
{"SupportedFrequencyBands", &DMREAD, DMT_STRING, get_radio_supported_frequency_bands, NULL, NULL, NULL, BBFDM_BOTH},
|
||||
{"OperatingFrequencyBand", &DMWRITE, DMT_STRING, os__get_radio_frequency, set_radio_frequency, NULL, NULL, BBFDM_BOTH},
|
||||
{"SupportedFrequencyBands", &DMREAD, DMT_STRING, os__get_radio_supported_frequency_bands, NULL, NULL, NULL, BBFDM_BOTH},
|
||||
{"SupportedStandards", &DMREAD, DMT_STRING, os__get_radio_supported_standard, NULL, NULL, NULL, BBFDM_BOTH},
|
||||
{"OperatingStandards", &DMWRITE, DMT_STRING, os_get_radio_operating_standard, set_radio_operating_standard, NULL, NULL, BBFDM_BOTH},
|
||||
{"ChannelsInUse", &DMREAD, DMT_STRING, os__get_radio_channel, NULL, NULL, NULL, BBFDM_BOTH},
|
||||
|
|
|
|||
|
|
@ -29232,7 +29232,18 @@
|
|||
"2.4GHz",
|
||||
"5GHz"
|
||||
]
|
||||
}
|
||||
},
|
||||
"mapping": [
|
||||
{
|
||||
"type": "ubus",
|
||||
"ubus": {
|
||||
"object": "wifi.radio.@Name",
|
||||
"method": "status",
|
||||
"args": {},
|
||||
"key": "supp_bands"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"OperatingFrequencyBand": {
|
||||
"type": "string",
|
||||
|
|
|
|||
|
|
@ -57,6 +57,7 @@ char *DTMFMethod[] = {"InBand", "RFC2833", "SIPInfo"};
|
|||
char *ProfileEnable[] = {"Disabled", "Quiescent", "Enabled"};
|
||||
char *SupportedOperatingChannelBandwidth[] = {"20MHz", "40MHz", "80MHz", "160MHZ", "80+80MHz", "Auto"};
|
||||
char *SupportedStandards[] = {"a", "b", "g", "n", "ac", "ax"};
|
||||
char *SupportedFrequencyBands[] = {"2.4GHz", "5GHz"};
|
||||
|
||||
char *PIN[] = {"^\\d{4}|\\d{8}$"};
|
||||
char *DestinationAddress[] = {"^\\d+/\\d+$"};
|
||||
|
|
|
|||
|
|
@ -103,6 +103,7 @@ extern char *IPv4Prefix[];
|
|||
extern char *IPv6Prefix[];
|
||||
extern char *SupportedOperatingChannelBandwidth[];
|
||||
extern char *SupportedStandards[];
|
||||
extern char *SupportedFrequencyBands[];
|
||||
|
||||
#define UPTIME "/proc/uptime"
|
||||
#define DEFAULT_CONFIG_DIR "/etc/config/"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue