WifiAyudante
public class WifiHelper
extends Object
java.lang.Objeto |
↳ | com.android.tradefed.device.WifiHelper |
Clase de ayuda para manipular servicios wifi en el dispositivo.
Resumen
Constructores públicos |
---|
WifiHelper ( ITestDevice device) |
WifiHelper ( ITestDevice device, String wifiUtilApkPath) |
WifiHelper ( ITestDevice device, String wifiUtilApkPath, boolean doSetup) Constructor alternativo que puede omitir la configuración de la aplicación wifi. |
WifiHelper ( ITestDevice device, String wifiUtilApkPath, boolean doSetup, boolean useV2) Constructor para especificar si se debe utilizar el nuevo asistente wifi v2. |
Métodos públicos |
---|
boolean | addOpenNetwork (String ssid) |
boolean | addOpenNetwork (String ssid, boolean scanSsid) |
boolean | addWpaPskNetwork (String ssid, String psk) |
boolean | addWpaPskNetwork (String ssid, String psk, boolean scanSsid) |
boolean | checkConnectivity (String urlToCheck) |
void | cleanUp () |
boolean | connectToNetwork (String ssid, String psk, String urlToCheck) |
IWifiHelper.WifiConnectionResult | connectToNetwork (String ssid, String psk, String urlToCheck, boolean scanSsid, String defaultType) |
IWifiHelper.WifiConnectionResult | connectToNetwork (String ssid, String psk, String urlToCheck, boolean scanSsid) |
boolean | disableWifi () |
boolean | disconnectFromNetwork () |
boolean | enableWifi () |
static File | extractWifiUtilApk () Método auxiliar para extraer la utilidad wifi apk del classpath |
String | getBSSID () |
String | getIpAddress () |
String | getSSID () |
| getWifiInfo () |
boolean | hasValidIp () |
boolean | isWifiEnabled () |
boolean | removeAllNetworks () |
boolean | startMonitor (long interval, String urlToCheck) |
| stopMonitor () |
boolean | waitForIp (long timeout) |
boolean | waitForWifiDisabled (long timeout) |
boolean | waitForWifiDisabled () |
boolean | waitForWifiEnabled (long timeout) |
boolean | waitForWifiEnabled () |
boolean | waitForWifiState (WifiState... expectedStates) |
Campos
INSTRUMENTACIÓN_PKG
public static final String INSTRUMENTATION_PKG
Constructores públicos
WifiAyudante
public WifiHelper (ITestDevice device)
Parámetros |
---|
device | ITestDevice |
WifiAyudante
public WifiHelper (ITestDevice device,
String wifiUtilApkPath)
Parámetros |
---|
device | ITestDevice |
wifiUtilApkPath | String |
WifiAyudante
public WifiHelper (ITestDevice device,
String wifiUtilApkPath,
boolean doSetup)
Constructor alternativo que puede omitir la configuración de la aplicación wifi.
Parámetros |
---|
device | ITestDevice |
wifiUtilApkPath | String |
doSetup | boolean |
WifiAyudante
public WifiHelper (ITestDevice device,
String wifiUtilApkPath,
boolean doSetup,
boolean useV2)
Constructor para especificar si se debe utilizar el nuevo asistente wifi v2. Las operaciones v2 no necesitan instalar la aplicación wifi util.
Parámetros |
---|
device | ITestDevice |
wifiUtilApkPath | String |
doSetup | boolean |
useV2 | boolean |
Métodos públicos
agregarOpenNetwork
public boolean addOpenNetwork (String ssid)
agregarOpenNetwork
public boolean addOpenNetwork (String ssid,
boolean scanSsid)
Parámetros |
---|
ssid | String |
scanSsid | boolean |
agregar red WpaPsk
public boolean addWpaPskNetwork (String ssid,
String psk)
Parámetros |
---|
ssid | String |
psk | String |
agregar red WpaPsk
public boolean addWpaPskNetwork (String ssid,
String psk,
boolean scanSsid)
Parámetros |
---|
ssid | String |
psk | String |
scanSsid | boolean |
checkConectividad
public boolean checkConnectivity (String urlToCheck)
Parámetros |
---|
urlToCheck | String |
limpiar
public void cleanUp ()
conectarse a la red
public boolean connectToNetwork (String ssid,
String psk,
String urlToCheck)
Parámetros |
---|
ssid | String |
psk | String |
urlToCheck | String |
conectarse a la red
public IWifiHelper.WifiConnectionResult connectToNetwork (String ssid,
String psk,
String urlToCheck,
boolean scanSsid,
String defaultType)
Parámetros |
---|
ssid | String |
psk | String |
urlToCheck | String |
scanSsid | boolean |
defaultType | String |
Devoluciones |
---|
IWifiHelper.WifiConnectionResult | |
conectarse a la red
public IWifiHelper.WifiConnectionResult connectToNetwork (String ssid,
String psk,
String urlToCheck,
boolean scanSsid)
Parámetros |
---|
ssid | String |
psk | String |
urlToCheck | String |
scanSsid | boolean |
Devoluciones |
---|
IWifiHelper.WifiConnectionResult | |
desactivarWifi
public boolean disableWifi ()
desconectarse de la red
public boolean disconnectFromNetwork ()
habilitarWifi
public boolean enableWifi ()
public static File extractWifiUtilApk ()
Método auxiliar para extraer la utilidad wifi apk del classpath
obtenerBSSID
public String getBSSID ()
obtener dirección IP
public String getIpAddress ()
obtenerSSID
public String getSSID ()
obtenerWifiInfo
public getWifiInfo ()
tieneIpValida
public boolean hasValidIp ()
está habilitado para Wifi
public boolean isWifiEnabled ()
eliminar todas las redes
public boolean removeAllNetworks ()
iniciarMonitor
public boolean startMonitor (long interval,
String urlToCheck)
Parámetros |
---|
interval | long |
urlToCheck | String |
detenerMonitor
public stopMonitor ()
esperar por IP
public boolean waitForIp (long timeout)
esperarParaWifiDisabled
public boolean waitForWifiDisabled (long timeout)
esperarParaWifiDisabled
public boolean waitForWifiDisabled ()
esperarParaWifiEnabled
public boolean waitForWifiEnabled (long timeout)
esperarParaWifiEnabled
public boolean waitForWifiEnabled ()
esperar al estado de Wifi
public boolean waitForWifiState (WifiState... expectedStates)
Parámetros |
---|
expectedStates | WifiState |