* commit '7fcf81e3a4ac036f23d818d9d5a8eba4387b9b96': Fix stop supplicant api
This commit is contained in:
commit
b1e73538da
2 changed files with 11 additions and 2 deletions
|
@ -55,7 +55,7 @@ int wifi_start_supplicant(int p2pSupported);
|
|||
*
|
||||
* @return 0 on success, < 0 on failure.
|
||||
*/
|
||||
int wifi_stop_supplicant();
|
||||
int wifi_stop_supplicant(int p2pSupported);
|
||||
|
||||
/**
|
||||
* Open a connection to supplicant on interface
|
||||
|
|
11
wifi/wifi.c
11
wifi/wifi.c
|
@ -604,11 +604,19 @@ int wifi_start_supplicant(int p2p_supported)
|
|||
return -1;
|
||||
}
|
||||
|
||||
int wifi_stop_supplicant()
|
||||
int wifi_stop_supplicant(int p2p_supported)
|
||||
{
|
||||
char supp_status[PROPERTY_VALUE_MAX] = {'\0'};
|
||||
int count = 50; /* wait at most 5 seconds for completion */
|
||||
|
||||
if (p2p_supported) {
|
||||
strcpy(supplicant_name, P2P_SUPPLICANT_NAME);
|
||||
strcpy(supplicant_prop_name, P2P_PROP_NAME);
|
||||
} else {
|
||||
strcpy(supplicant_name, SUPPLICANT_NAME);
|
||||
strcpy(supplicant_prop_name, SUPP_PROP_NAME);
|
||||
}
|
||||
|
||||
/* Check whether supplicant already stopped */
|
||||
if (property_get(supplicant_prop_name, supp_status, NULL)
|
||||
&& strcmp(supp_status, "stopped") == 0) {
|
||||
|
@ -625,6 +633,7 @@ int wifi_stop_supplicant()
|
|||
}
|
||||
usleep(100000);
|
||||
}
|
||||
ALOGE("Failed to stop supplicant");
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue