[ALPS08244456][rdkb][common][hal][Add the action to get wps_state for wifi_getRadioVapInfoMap and change the wifi_getApWpsState default behavior]
[Root cause analysis]
1. The wifi_getRadioVapInfoMap miss the action to get wps_state.
2. In wifi_getApWpsState, if the iface name is not got, will return Return_Error, lead the wifi_getRadioVapInfoMap failed to get other iface information.
[Solution]
1. Add the wifi_getApWpsState in wifi_getRadioVapInfoMap to get wps_state.
2. Change the default action for wifi_getApWpsState to set state equal to disabled, and the function return Return_OK while get iface name error.
Feature: conn_wifi_connect
Change-Id: I0b1b4564d681677134bd4e22e2a54baa4b8e3e0b
diff --git a/src/wifi/wifi_hal.c b/src/wifi/wifi_hal.c
index d6e9969..7e13de2 100644
--- a/src/wifi/wifi_hal.c
+++ b/src/wifi/wifi_hal.c
@@ -7097,19 +7097,19 @@
{
char interface_name[16] = {0};
char buf[MAX_BUF_SIZE] = {0}, cmd[MAX_CMD_SIZE] = {0}, *value;
+
+ *output_bool=FALSE;
if(!output_bool)
return RETURN_ERR;
if (wifi_GetInterfaceName(apIndex, interface_name) != RETURN_OK)
- return RETURN_ERR;
+ return RETURN_OK;
sprintf(cmd,"hostapd_cli -i %s get_config | grep wps_state | cut -d '=' -f2", interface_name);
_syscmd(cmd, buf, sizeof(buf));
if(strstr(buf, "configured"))
*output_bool=TRUE;
- else
- *output_bool=FALSE;
return RETURN_OK;
-}
+}
//Device.WiFi.AccessPoint.{i}.WPS.Enable
// sets the WPS enable enviornment variable for this ap to the value of enableValue, 1==enabled, 0==disabled
@@ -12774,6 +12774,15 @@
return RETURN_ERR;
}
map->vap_array[i].u.bss_info.mcast2ucast = enabled;
+
+ ret = wifi_getApWpsEnable(vap_index, &enabled);
+ if (ret != RETURN_OK) {
+ fprintf(stderr, "%s: wifi_getApWpsEnable\n", __func__);
+ return RETURN_ERR;
+ }
+
+ map->vap_array[i].u.bss_info.wps.enable = enabled;
+
map->num_vaps++;
// TODO: wps, noack
}