Build 1.0_r1(from source)

android.net.wifi
Class WifiNative

java.lang.Object
  extended by android.net.wifi.WifiNative

public class WifiNative
extends Object

Native calls for sending requests to the supplicant daemon, and for receiving asynchronous events. All methods of the form "xxxxCommand()" must be single-threaded, to avoid requests and responses initiated from multiple threads from being intermingled.

Note that methods whose names are not of the form "xxxCommand()" do not talk to the supplicant daemon.


Field Summary
(package private) static int BLUETOOTH_COEXISTENCE_MODE_DISABLED
           
(package private) static int BLUETOOTH_COEXISTENCE_MODE_ENABLED
           
(package private) static int BLUETOOTH_COEXISTENCE_MODE_SENSE
           
 
Constructor Summary
WifiNative()
           
 
Method Summary
static int addNetworkCommand()
           
static boolean addToBlacklistCommand(String bssid)
           
static boolean clearBlacklistCommand()
           
static void closeSupplicantConnection()
           
static boolean connectToSupplicant()
           
static boolean disableNetworkCommand(int netId)
           
static boolean disconnectCommand()
           
static boolean doDhcpRequest(DhcpInfo results)
           
static boolean enableNetworkCommand(int netId, boolean disableOthers)
           
static String getDhcpError()
           
static String getErrorString(int errorCode)
           
static int getLinkSpeedCommand()
           
static String getMacAddressCommand()
           
static String getNetworkVariableCommand(int netId, String name)
           
static int getRssiCommand()
           
static String listNetworksCommand()
           
static boolean loadDriver()
           
static boolean pingCommand()
           
static boolean reassociateCommand()
           
static boolean reconnectCommand()
           
static boolean reloadConfigCommand()
           
static boolean removeNetworkCommand(int netId)
           
static boolean saveConfigCommand()
           
static boolean scanCommand()
           
static String scanResultsCommand()
           
static boolean setBluetoothCoexistenceModeCommand(int mode)
          Sets the bluetooth coexistence mode.
static boolean setNetworkVariableCommand(int netId, String name, String value)
           
static boolean setPowerModeCommand(int mode)
           
static boolean setScanModeCommand(boolean setActive)
           
static boolean setScanResultHandlingCommand(int mode)
           
static boolean startDriverCommand()
           
static boolean startSupplicant()
           
static String statusCommand()
           
static boolean stopDriverCommand()
           
static boolean stopSupplicant()
           
static boolean unloadDriver()
           
static String waitForEvent()
          Wait for the supplicant to send an event, returning the event string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BLUETOOTH_COEXISTENCE_MODE_ENABLED

static final int BLUETOOTH_COEXISTENCE_MODE_ENABLED
See Also:
Constant Field Values

BLUETOOTH_COEXISTENCE_MODE_DISABLED

static final int BLUETOOTH_COEXISTENCE_MODE_DISABLED
See Also:
Constant Field Values

BLUETOOTH_COEXISTENCE_MODE_SENSE

static final int BLUETOOTH_COEXISTENCE_MODE_SENSE
See Also:
Constant Field Values
Constructor Detail

WifiNative

public WifiNative()
Method Detail

getErrorString

public static String getErrorString(int errorCode)

loadDriver

public static boolean loadDriver()

unloadDriver

public static boolean unloadDriver()

startSupplicant

public static boolean startSupplicant()

stopSupplicant

public static boolean stopSupplicant()

connectToSupplicant

public static boolean connectToSupplicant()

closeSupplicantConnection

public static void closeSupplicantConnection()

pingCommand

public static boolean pingCommand()

scanCommand

public static boolean scanCommand()

setScanModeCommand

public static boolean setScanModeCommand(boolean setActive)

listNetworksCommand

public static String listNetworksCommand()

addNetworkCommand

public static int addNetworkCommand()

setNetworkVariableCommand

public static boolean setNetworkVariableCommand(int netId,
                                                String name,
                                                String value)

getNetworkVariableCommand

public static String getNetworkVariableCommand(int netId,
                                               String name)

removeNetworkCommand

public static boolean removeNetworkCommand(int netId)

enableNetworkCommand

public static boolean enableNetworkCommand(int netId,
                                           boolean disableOthers)

disableNetworkCommand

public static boolean disableNetworkCommand(int netId)

reconnectCommand

public static boolean reconnectCommand()

reassociateCommand

public static boolean reassociateCommand()

disconnectCommand

public static boolean disconnectCommand()

statusCommand

public static String statusCommand()

getRssiCommand

public static int getRssiCommand()

getLinkSpeedCommand

public static int getLinkSpeedCommand()

getMacAddressCommand

public static String getMacAddressCommand()

scanResultsCommand

public static String scanResultsCommand()

startDriverCommand

public static boolean startDriverCommand()

stopDriverCommand

public static boolean stopDriverCommand()

setPowerModeCommand

public static boolean setPowerModeCommand(int mode)

setBluetoothCoexistenceModeCommand

public static boolean setBluetoothCoexistenceModeCommand(int mode)
Sets the bluetooth coexistence mode.

Parameters:
mode - One of BLUETOOTH_COEXISTENCE_MODE_DISABLED, BLUETOOTH_COEXISTENCE_MODE_ENABLED, or BLUETOOTH_COEXISTENCE_MODE_SENSE.
Returns:
Whether the mode was successfully set.

saveConfigCommand

public static boolean saveConfigCommand()

reloadConfigCommand

public static boolean reloadConfigCommand()

setScanResultHandlingCommand

public static boolean setScanResultHandlingCommand(int mode)

addToBlacklistCommand

public static boolean addToBlacklistCommand(String bssid)

clearBlacklistCommand

public static boolean clearBlacklistCommand()

doDhcpRequest

public static boolean doDhcpRequest(DhcpInfo results)

getDhcpError

public static String getDhcpError()

waitForEvent

public static String waitForEvent()
Wait for the supplicant to send an event, returning the event string.

Returns:
the event string sent by the supplicant.

Build 1.0_r1(from source)

Please submit a feedback, bug or feature