Ticket refs #12476 :Enable/Disable bandsteering via Tr069

This commit is contained in:
imen.bhiri 2017-08-02 10:00:25 +01:00
parent c01b2a1375
commit d89263bee3
2 changed files with 58 additions and 0 deletions

View file

@ -31,6 +31,34 @@ inline int init_se_wifi(struct dmctx *ctx, struct uci_section *s)
return 0;
}
int get_bandsteering_enable(char *refparam, struct dmctx *ctx, char **value)
{
dmuci_get_option_value_string("wireless", "bandsteering", "enabled", value);
return 0;
}
int set_bandsteering_enable(char *refparam, struct dmctx *ctx, int action, char *value)
{
bool b;
switch (action) {
case VALUECHECK:
if (string_to_bool(value, &b))
return FAULT_9007;
return 0;
case VALUESET:
string_to_bool(value, &b);
if (b) {
dmuci_set_value("wireless", "bandsteering", "enabled", "1");
}
else {
dmuci_set_value("wireless", "bandsteering", "enabled", "0");
}
return 0;
}
return 0;
}
int get_wifi_frequency(char *refparam, struct dmctx *ctx, char **value)
{
char *freq;
@ -145,6 +173,7 @@ int entry_method_root_SE_Wifi(struct dmctx *ctx)
{
IF_MATCH(ctx, DMROOT"X_INTENO_SE_Wifi.") {
DMOBJECT(DMROOT"X_INTENO_SE_Wifi.", ctx, "0", 1, NULL, NULL, NULL);
DMPARAM("Bandsteering_Enable", ctx, "1", get_bandsteering_enable, set_bandsteering_enable, "xsd:boolean", 0, 1, UNDEF, NULL);
DMOBJECT(DMROOT"X_INTENO_SE_Wifi.Radio.", ctx, "0", 1, NULL, NULL, NULL);
SUBENTRY(entry_sewifi_radio, ctx);
return 0;

View file

@ -970,6 +970,34 @@ int get_ap_ssid_ref(char *refparam, struct dmctx *ctx, char **value)
*value = "";
return 0;
}
int get_wifi_bandsteering_enable(char *refparam, struct dmctx *ctx, char **value)
{
dmuci_get_option_value_string("wireless", "bandsteering", "enabled", value);
return 0;
}
int set_wifi_bandsteering_enable(char *refparam, struct dmctx *ctx, int action, char *value)
{
bool b;
switch (action) {
case VALUECHECK:
if (string_to_bool(value, &b))
return FAULT_9007;
return 0;
case VALUESET:
string_to_bool(value, &b);
if (b) {
dmuci_set_value("wireless", "bandsteering", "enabled", "1");
}
else {
dmuci_set_value("wireless", "bandsteering", "enabled", "0");
}
return 0;
}
return 0;
}
////////////////ADD DEL OBJ//////////////////////////
int add_wifi_ssid(struct dmctx *ctx, char **new_instance)
{
@ -1051,6 +1079,7 @@ int entry_method_root_Wifi(struct dmctx *ctx)
{
IF_MATCH(ctx, DMROOT"WiFi.") {
DMOBJECT(DMROOT"WiFi.", ctx, "0", 1, NULL, NULL, NULL);
DMPARAM("X_INTENO_SE_Bandsteering_Enable", ctx, "1", get_wifi_bandsteering_enable, set_wifi_bandsteering_enable, "xsd:boolean", 0, 1, UNDEF, NULL);
DMOBJECT(DMROOT"WiFi.Radio.", ctx, "0", 1, NULL, NULL, NULL);
DMOBJECT(DMROOT"WiFi.SSID.", ctx, "1", 1, add_wifi_ssid, delete_wifi_ssid_all, NULL);
DMOBJECT(DMROOT"WiFi.AccessPoint.", ctx, "0", 1, NULL, NULL, NULL);