mirror of
https://dev.iopsys.eu/bbf/bbfdm.git
synced 2026-02-19 02:31:19 +01:00
WiFi: use 'wps_pushbutton' instead of 'wps' to enable/disable wps functionality
This commit is contained in:
parent
c7b1bec206
commit
c05428a48b
2 changed files with 16 additions and 33 deletions
|
|
@ -46564,7 +46564,7 @@
|
|||
"index": "@i-1"
|
||||
},
|
||||
"option": {
|
||||
"name": "wps"
|
||||
"name": "wps_pushbutton"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -46641,7 +46641,7 @@
|
|||
"index": "@i-1"
|
||||
},
|
||||
"option": {
|
||||
"name": "wps"
|
||||
"name": "wps_pushbutton"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -46702,21 +46702,6 @@
|
|||
"Error_Not_Ready",
|
||||
"Error_Timeout",
|
||||
"Error_Other"
|
||||
],
|
||||
"mapping": [
|
||||
{
|
||||
"type": "uci",
|
||||
"uci": {
|
||||
"file": "wireless",
|
||||
"section": {
|
||||
"type": "wifi-iface",
|
||||
"index": "@i-1"
|
||||
},
|
||||
"option": {
|
||||
"name": "wps"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
@ -48263,7 +48248,7 @@
|
|||
"index": "@i-1"
|
||||
},
|
||||
"option": {
|
||||
"name": "wps"
|
||||
"name": "wps_pushbutton"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -48339,7 +48324,7 @@
|
|||
"index": "@i-1"
|
||||
},
|
||||
"option": {
|
||||
"name": "wps"
|
||||
"name": "wps_pushbutton"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -244,7 +244,6 @@ static char *get_security_mode(struct uci_section *section)
|
|||
static void reset_wlan(struct uci_section *s)
|
||||
{
|
||||
dmuci_delete_by_section(s, "wpa_group_rekey", NULL);
|
||||
dmuci_delete_by_section(s, "wps", NULL);
|
||||
dmuci_delete_by_section(s, "key", NULL);
|
||||
dmuci_delete_by_section(s, "key1", NULL);
|
||||
dmuci_delete_by_section(s, "key2", NULL);
|
||||
|
|
@ -1899,7 +1898,7 @@ static void set_security_mode(struct uci_section *section, char *value, bool is_
|
|||
dmuci_set_value_by_section(section, "encryption", "psk2");
|
||||
dmuci_set_value_by_section(section, "key", wpa_key);
|
||||
dmuci_set_value_by_section(section, "wpa_group_rekey", "3600");
|
||||
dmuci_set_value_by_section(section, "wps", "1");
|
||||
dmuci_set_value_by_section(section, "wps_pushbutton", "1");
|
||||
dmuci_set_value_by_section(section, "ieee80211w", "1");
|
||||
|
||||
if (map_ssid_s) dmuci_set_value_by_section(map_ssid_s, "encryption", "psk2");
|
||||
|
|
@ -1914,7 +1913,7 @@ static void set_security_mode(struct uci_section *section, char *value, bool is_
|
|||
dmuci_set_value_by_section(section, "encryption", "psk-mixed");
|
||||
dmuci_set_value_by_section(section, "key", wpa_key);
|
||||
dmuci_set_value_by_section(section, "wpa_group_rekey", "3600");
|
||||
dmuci_set_value_by_section(section, "wps", "1");
|
||||
dmuci_set_value_by_section(section, "wps_pushbutton", "1");
|
||||
|
||||
if (map_ssid_s) dmuci_set_value_by_section(map_ssid_s, "encryption", "psk-mixed");
|
||||
if (map_ssid_s) dmuci_set_value_by_section(map_ssid_s, "key", wpa_key);
|
||||
|
|
@ -2264,10 +2263,10 @@ static int set_WiFiAccessPointSecurity_MFPConfig(char *refparam, struct dmctx *c
|
|||
return 0;
|
||||
}
|
||||
|
||||
/*#Device.WiFi.AccessPoint.{i}.WPS.Enable!UCI:wireless/wifi-iface,@i-1/wps*/
|
||||
/*#Device.WiFi.AccessPoint.{i}.WPS.Enable!UCI:wireless/wifi-iface,@i-1/wps_pushbutton*/
|
||||
static int get_WiFiAccessPointWPS_Enable(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = dmuci_get_value_by_section_fallback_def((((struct wifi_acp_args *)data)->sections)->config_section, "wps", "0");
|
||||
*value = dmuci_get_value_by_section_fallback_def((((struct wifi_acp_args *)data)->sections)->config_section, "wps_pushbutton", "0");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -2282,7 +2281,7 @@ static int set_WiFiAccessPointWPS_Enable(char *refparam, struct dmctx *ctx, void
|
|||
break;
|
||||
case VALUESET:
|
||||
string_to_bool(value, &b);
|
||||
dmuci_set_value_by_section((((struct wifi_acp_args *)data)->sections)->config_section, "wps", b ? "1" : "0");
|
||||
dmuci_set_value_by_section((((struct wifi_acp_args *)data)->sections)->config_section, "wps_pushbutton", b ? "1" : "0");
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
|
|
@ -2367,11 +2366,11 @@ static int set_WiFiAccessPointWPS_ConfigMethodsEnabled(char *refparam, struct dm
|
|||
return 0;
|
||||
}
|
||||
|
||||
/*#Device.WiFi.AccessPoint.{i}.WPS.Status!UCI:wireless/wifi-iface,@i-1/wps*/
|
||||
/*#Device.WiFi.AccessPoint.{i}.WPS.Status!UCI:wireless/wifi-iface,@i-1/wps_pushbutton*/
|
||||
static int get_WiFiAccessPointWPS_Status(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
char *wps_status;
|
||||
dmuci_get_value_by_section_string((((struct wifi_acp_args *)data)->sections)->config_section, "wps", &wps_status);
|
||||
dmuci_get_value_by_section_string((((struct wifi_acp_args *)data)->sections)->config_section, "wps_pushbutton", &wps_status);
|
||||
*value = (wps_status[0] == '1') ? "Configured" : "Disabled";
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -2834,10 +2833,10 @@ static int set_WiFiEndPointProfileSecurity_MFPConfig(char *refparam, struct dmct
|
|||
return 0;
|
||||
}
|
||||
|
||||
/*#Device.WiFi.EndPoint.{i}.WPS.Enable!UCI:wireless/wifi-iface,@i-1/wps*/
|
||||
/*#Device.WiFi.EndPoint.{i}.WPS.Enable!UCI:wireless/wifi-iface,@i-1/wps_pushbutton*/
|
||||
static int get_WiFiEndPointWPS_Enable(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = dmuci_get_value_by_section_fallback_def((((struct wifi_enp_args *)data)->sections)->config_section, "wps", "0");
|
||||
*value = dmuci_get_value_by_section_fallback_def((((struct wifi_enp_args *)data)->sections)->config_section, "wps_pushbutton", "0");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -2852,7 +2851,7 @@ static int set_WiFiEndPointWPS_Enable(char *refparam, struct dmctx *ctx, void *d
|
|||
break;
|
||||
case VALUESET:
|
||||
string_to_bool(value, &b);
|
||||
dmuci_set_value_by_section((((struct wifi_enp_args *)data)->sections)->config_section, "wps", b ? "1" : "0");
|
||||
dmuci_set_value_by_section((((struct wifi_enp_args *)data)->sections)->config_section, "wps_pushbutton", b ? "1" : "0");
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
|
|
@ -2883,11 +2882,11 @@ static int set_WiFiEndPointWPS_ConfigMethodsEnabled(char *refparam, struct dmctx
|
|||
return 0;
|
||||
}
|
||||
|
||||
/*#Device.WiFi.EndPoint.{i}.WPS.Status!UCI:wireless/wifi-iface,@i-1/wps*/
|
||||
/*#Device.WiFi.EndPoint.{i}.WPS.Status!UCI:wireless/wifi-iface,@i-1/wps_pushbutton*/
|
||||
static int get_WiFiEndPointWPS_Status(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
char *wps_status;
|
||||
dmuci_get_value_by_section_string((((struct wifi_enp_args *)data)->sections)->config_section, "wps", &wps_status);
|
||||
dmuci_get_value_by_section_string((((struct wifi_enp_args *)data)->sections)->config_section, "wps_pushbutton", &wps_status);
|
||||
*value = (wps_status[0] == '1') ? "Configured" : "Disabled";
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -5908,7 +5907,6 @@ static int operate_WiFiAccessPointSecurity_Reset(char *refparam, struct dmctx *c
|
|||
{
|
||||
dmuci_set_value_by_section((((struct wifi_acp_args *)data)->sections)->config_section, "encryption", "psk");
|
||||
dmuci_set_value_by_section((((struct wifi_acp_args *)data)->sections)->config_section, "key", get_default_wpa_key());
|
||||
dmuci_set_value_by_section((((struct wifi_acp_args *)data)->sections)->config_section, "wps", "1");
|
||||
dmuci_set_value_by_section((((struct wifi_acp_args *)data)->sections)->config_section, "wps_pushbutton", "1");
|
||||
|
||||
return CMD_SUCCESS;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue