WifiCommandUtil

public class WifiCommandUtil
extends Object

java.lang.Object
   ↳ com.android.tradefed.device.WifiCommandUtil


A utility class that can parse wifi command outputs.

Summary

Nested classes

class WifiCommandUtil.ScanResult

Represents a wifi network containing its related info. 

Fields

public static final Pattern BSSID_PATTERN

public static final Pattern LINK_SPEED_PATTERN

public static final Pattern MAC_ADDRESS_PATTERN

public static final Pattern RSSI_PATTERN

public static final Pattern SSID_PATTERN

Public constructors

WifiCommandUtil()

Public methods

static parseScanResults(String input)

Parse the `wifi list-scan-results` command output and returns a list of ScanResults.

static parseWifiInfo(String input)

Parse the 'wifi status' output and returns a map of info about connected wifi network.

static String resolveNetworkType(String flags)

Resolves the network type given the flags returned from list-scan-result cmd.

Fields

BSSID_PATTERN

public static final Pattern BSSID_PATTERN

public static final Pattern LINK_SPEED_PATTERN

MAC_ADDRESS_PATTERN

public static final Pattern MAC_ADDRESS_PATTERN

RSSI_PATTERN

public static final Pattern RSSI_PATTERN

SSID_PATTERN

public static final Pattern SSID_PATTERN

Public constructors

WifiCommandUtil

public WifiCommandUtil ()

Public methods

parseScanResults

public static  parseScanResults (String input)

Parse the `wifi list-scan-results` command output and returns a list of ScanResults.

Parameters
input String: Output of the list-scan-results command to parse.

Returns
List of ScanResults.

parseWifiInfo

public static  parseWifiInfo (String input)

Parse the 'wifi status' output and returns a map of info about connected wifi network.

Parameters
input String: Output of the 'wifi status' command to parse.

Returns
a map of info about the connected network.

resolveNetworkType

public static String resolveNetworkType (String flags)

Resolves the network type given the flags returned from list-scan-result cmd.

Parameters
flags String

Returns
String