public final class WifiEvents extends Object
The parameters include Wi-Fi broadcasting status and common Wi-Fi parameters.
| 限定符和类型 | 字段 | 说明 |
|---|---|---|
static int |
BAND_INVALID |
Indicates an invalid Wi-Fi channel or value.
|
static int |
BAND_WIDTH_160MHZ |
Indicates 160MHz channel bandwidth.
|
static int |
BAND_WIDTH_20MHZ |
Indicates 20MHz channel bandwidth.
|
static int |
BAND_WIDTH_40MHZ |
Indicates 40MHz channel bandwidth.
|
static int |
BAND_WIDTH_80MHZ |
Indicates 80MHz channel bandwidth.
|
static int |
BAND_WIDTH_80MHZ_PLUS |
Indicates 80MHZ + 80MHZ channel bandwidth.
|
static int |
BAND_WIFI_2G |
Indicates a 2.4 GHz Wi-Fi channel.
|
static int |
BAND_WIFI_5G |
Indicates a 5 GHz Wi-Fi channel.
|
static String |
EVENT_ACTIVE_STATE |
Indicates the
action of a common event about the Wi-Fi state, such as enabled and disabled. |
static String |
EVENT_CONN_STATE |
Indicates the
action of a common event that the Wi-Fi connection state has changed. |
static String |
EVENT_HOTSPOT_STATE |
Indicates the
action of a common event about the Wi-Fi hotspot state, such as enabled or disabled. |
static String |
EVENT_HOTSPOT_STATION_JOIN |
Indicates the
action of a common event that a client has joined the Wi-Fi hotspot of the
current device. |
static String |
EVENT_HOTSPOT_STATION_LEAVE |
Indicates the
action of a common event that a client has dropped connection to the Wi-Fi hotspot of
the current device. |
static String |
EVENT_P2P_CONN_STATE_CHANGED |
Indicates the event that the state of the Wi-Fi P2P connection has changed.
|
static String |
EVENT_P2P_CURRENT_DEVICE_STATE_CHANGED |
Indicates the event that the state of the current device has changed.
|
static String |
EVENT_P2P_DEVICES_CHANGED |
Indicates the event that the state of peer devices has changed.
|
static String |
EVENT_P2P_DEVICES_DISCOVERY_STATE |
Indicates the event that the state of Wi-Fi P2P discovery has changed.
|
static String |
EVENT_P2P_STATE_CHANGED |
Indicates the event that the state of Wi-Fi P2P has changed.
|
static String |
EVENT_RSSI_VALUE |
Indicates the
action of a common event that the Wi-Fi signal strength (RSSI) has changed. |
static String |
EVENT_SCAN_STATE |
Indicates the
action of a common event that the Wi-Fi access point has been scanned and proven to
be available. |
static String |
PARAM_ACTIVE_STATE |
Indicates the Wi-Fi state (enabled or disabled) after a state change.
|
static String |
PARAM_CONN_STATE |
Indicates the Wi-Fi state after a status change (connected or disconnected).
|
static String |
PARAM_HOTSPOT_STATE |
Indicates the Wi-Fi hotspot state (enabled or disabled) after a state change.
|
static String |
PARAM_P2P_DISCOVERY |
Indicates the state of Wi-Fi P2P discovery.
|
static String |
PARAM_P2P_STATE_CHANGED |
Indicates the Wi-Fi P2P state.
|
static String |
PARAM_RSSI_VALUE |
Indicates the RSSI value after an RSSI change.
|
static String |
PARAM_SCAN_STATE |
Indicates the scanning status (successful or failed) after a Wi-Fi scanning ends.
|
static int |
PEERS_P2P_DISCOVERY_OFF |
Indicates that Wi-Fi P2P discovery is disabled.
|
static int |
PEERS_P2P_DISCOVERY_ON |
Indicates that Wi-Fi P2P discovery is enabled.
|
static int |
STATE_ACTIVATING |
Indicates that Wi-Fi is currently being enabled.
|
static int |
STATE_ACTIVE |
Indicates that Wi-Fi is enabled.
|
static int |
STATE_CONNECTED |
Indicates that the Wi-Fi is connected.
|
static int |
STATE_DEACTIVATING |
Indicates that Wi-Fi is currently being disabled.
|
static int |
STATE_DISCONNECTED |
Indicates that the Wi-Fi is disconnected.
|
static int |
STATE_HOTSPOT_ACTIVATING |
Indicates that the Wi-Fi hotspot is currently being enabled.
|
static int |
STATE_HOTSPOT_ACTIVE |
Indicates that the Wi-Fi hotspot is enabled.
|
static int |
STATE_HOTSPOT_DEACTIVATING |
Indicates that the Wi-Fi hotspot is currently being disabled.
|
static int |
STATE_HOTSPOT_INACTIVE |
Indicates that the Wi-Fi hotspot is disabled.
|
static int |
STATE_INACTIVE |
Indicates that Wi-Fi is disabled.
|
static int |
STATE_P2P_OFF |
Indicates that Wi-Fi P2P is disabled.
|
static int |
STATE_P2P_ON |
Indicates that Wi-Fi P2P is enabled.
|
static int |
STATE_SCAN_FAIL |
Indicates that a Wi-Fi scanning fails.
|
static int |
STATE_SCAN_SUCCESS |
Indicates that a Wi-Fi scanning succeeds.
|
| 构造器 | 说明 |
|---|---|
WifiEvents() |
public static final int BAND_INVALID
A Wi-Fi channel should be either a 2.4 GHz channel BAND_WIFI_2G
or a 5 GHz channel BAND_WIFI_5G.
public static final int BAND_WIDTH_160MHZ
public static final int BAND_WIDTH_20MHZ
public static final int BAND_WIDTH_40MHZ
public static final int BAND_WIDTH_80MHZ
public static final int BAND_WIDTH_80MHZ_PLUS
public static final int BAND_WIFI_2G
public static final int BAND_WIFI_5G
public static final String EVENT_ACTIVE_STATE
action of a common event about the Wi-Fi state, such as enabled and disabled.
You can register this common event to listen for Wi-Fi state changes.
In this common event sent to you, the PARAM_ACTIVE_STATE key
of the IntentParams key-value pair carries specific information about the Wi-Fi state change, and
the value can be STATE_ACTIVE (Wi-Fi disabled) or
STATE_INACTIVE (Wi-Fi enabled).
PARAM_ACTIVE_STATE,
STATE_ACTIVE,
STATE_INACTIVE,
常量字段值public static final String EVENT_CONN_STATE
action of a common event that the Wi-Fi connection state has changed.
You can register this common event to listen for Wi-Fi connection state changes.
In this common event sent to you, the PARAM_CONN_STATE key
of the IntentParams key-value pair carries specific information about the Wi-Fi connection state
change, and the value can be STATE_DISCONNECTED (Wi-Fi disconnected)
or STATE_CONNECTED (Wi-Fi connected).
PARAM_CONN_STATE,
STATE_DISCONNECTED,
STATE_CONNECTED,
常量字段值public static final String EVENT_HOTSPOT_STATE
action of a common event about the Wi-Fi hotspot state, such as enabled or disabled.
You can register this common event to listen for Wi-Fi hotspot state changes.
In this common event sent to you, the PARAM_HOTSPOT_STATE key
of the IntentParams key-value pair carries specific information about the Wi-Fi hotspot state change,
and the value can be STATE_HOTSPOT_INACTIVE (Wi-Fi hotspot disabled)
or STATE_HOTSPOT_ACTIVE (Wi-Fi hotspot enabled).
PARAM_HOTSPOT_STATE,
STATE_HOTSPOT_INACTIVE,
STATE_HOTSPOT_ACTIVE,
常量字段值public static final String EVENT_HOTSPOT_STATION_JOIN
action of a common event that a client has joined the Wi-Fi hotspot of the
current device. You can register this common event to listen for information about the clients joining
your hotspot.
In this common event sent to you, the keys of the IntentParams key-value pair carry the
following information:
To subscribe to this common event, your application must have the
ohos.permission.GET_WIFI_INFO permission.
public static final String EVENT_HOTSPOT_STATION_LEAVE
action of a common event that a client has dropped connection to the Wi-Fi hotspot of
the current device. You can register this common event to listen for information about the clients
leaving your hotspot.
In this common event sent to you, the keys of the IntentParams key-value pair carry the
following information:
To subscribe to this common event, your application must have the
ohos.permission.GET_WIFI_INFO permission.
public static final String EVENT_P2P_CONN_STATE_CHANGED
When receiving a broadcast of a Wi-Fi P2P information change,
you can call WifiP2pController.requestP2pInfo(int, WifiP2pCallback)
to request the Wi-Fi P2P information.
public static final String EVENT_P2P_CURRENT_DEVICE_STATE_CHANGED
When receiving a broadcast of a state change for the current device,
you can call WifiP2pController.requestP2pInfo(int, WifiP2pCallback)
to request information about the current device.
public static final String EVENT_P2P_DEVICES_CHANGED
When receiving a broadcast of a change in the peer device list,
you can call WifiP2pController.requestP2pInfo(int, WifiP2pCallback)
to request information about the peer device list.
public static final String EVENT_P2P_DEVICES_DISCOVERY_STATE
In this event, the PARAM_P2P_DISCOVERY key of the IntentParams key-value pair
carries information about the Wi-Fi P2P discovery state after the change,
and the value can be PEERS_P2P_DISCOVERY_OFF (Wi-Fi P2P discovery is disabled)
or PEERS_P2P_DISCOVERY_ON (Wi-Fi P2P discovery is enabled).
PARAM_P2P_DISCOVERY,
PEERS_P2P_DISCOVERY_OFF,
PEERS_P2P_DISCOVERY_ON,
常量字段值public static final String EVENT_P2P_STATE_CHANGED
In this event, the PARAM_P2P_STATE_CHANGED key of the IntentParams
key-value pair carries information about the Wi-Fi P2P state change,
and the value can be STATE_P2P_OFF (Wi-Fi P2P is disabled)
or STATE_P2P_ON (Wi-Fi P2P is enabled).
PARAM_P2P_STATE_CHANGED,
STATE_P2P_OFF,
STATE_P2P_ON,
常量字段值public static final String EVENT_RSSI_VALUE
action of a common event that the Wi-Fi signal strength (RSSI) has changed.
You can register this common event to listen for Wi-Fi RSSI changes of the connected network.
In this common event sent to you, the PARAM_RSSI_VALUE key
of the IntentParams key-value pair is associated with a specific value of the new RSSI.
To subscribe to this common event, your application must have the
ohos.permission.GET_WIFI_INFO permission.
PARAM_RSSI_VALUE,
常量字段值public static final String EVENT_SCAN_STATE
action of a common event that the Wi-Fi access point has been scanned and proven to
be available. You can register this common event to listen for the Wi-Fi scanning result.
In this common event sent to you, the PARAM_SCAN_STATE key
of the IntentParams key-value pair carries specific information about the Wi-Fi scanning result,
and the value can be STATE_SCAN_FAIL (scanning failed) or
STATE_SCAN_SUCCESS (scanning succeeded).
To subscribe to this common event, your application must have the
ohos.permission.LOCATION permission.
PARAM_SCAN_STATE,
STATE_SCAN_FAIL,
STATE_SCAN_SUCCESS,
常量字段值public static final String PARAM_ACTIVE_STATE
The value can be STATE_ACTIVE (Wi-Fi disabled) or
STATE_INACTIVE (Wi-Fi enabled).
public static final String PARAM_CONN_STATE
The value can be STATE_DISCONNECTED (Wi-Fi disconnected)
or STATE_CONNECTED (Wi-Fi connected).
public static final String PARAM_HOTSPOT_STATE
The value can be STATE_HOTSPOT_INACTIVE (Wi-Fi hotspot disabled)
or STATE_HOTSPOT_ACTIVE (Wi-Fi hotspot enabled).
public static final String PARAM_P2P_DISCOVERY
The value can be PEERS_P2P_DISCOVERY_OFF (Wi-Fi P2P discovery is disabled)
or PEERS_P2P_DISCOVERY_ON (Wi-Fi P2P discovery is enabled).
PEERS_P2P_DISCOVERY_OFF,
PEERS_P2P_DISCOVERY_ON,
常量字段值public static final String PARAM_P2P_STATE_CHANGED
The value can be STATE_P2P_OFF (Wi-Fi P2P is disabled)
or STATE_P2P_ON (Wi-Fi P2P is enabled).
STATE_P2P_OFF,
STATE_P2P_ON,
常量字段值public static final String PARAM_RSSI_VALUE
public static final String PARAM_SCAN_STATE
the value can be STATE_SCAN_FAIL (scanning failed) or
STATE_SCAN_SUCCESS (scanning succeeded).
public static final int PEERS_P2P_DISCOVERY_OFF
public static final int PEERS_P2P_DISCOVERY_ON
public static final int STATE_ACTIVATING
public static final int STATE_ACTIVE
public static final int STATE_CONNECTED
public static final int STATE_DEACTIVATING
public static final int STATE_DISCONNECTED
public static final int STATE_HOTSPOT_ACTIVATING
public static final int STATE_HOTSPOT_ACTIVE
public static final int STATE_HOTSPOT_DEACTIVATING
public static final int STATE_HOTSPOT_INACTIVE
public static final int STATE_INACTIVE
public static final int STATE_P2P_OFF
public static final int STATE_P2P_ON
public static final int STATE_SCAN_FAIL
public static final int STATE_SCAN_SUCCESS