• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/usr/bin/env python3
2#
3#   Copyright 2016 - Google
4#
5#   Licensed under the Apache License, Version 2.0 (the "License");
6#   you may not use this file except in compliance with the License.
7#   You may obtain a copy of the License at
8#
9#       http://www.apache.org/licenses/LICENSE-2.0
10#
11#   Unless required by applicable law or agreed to in writing, software
12#   distributed under the License is distributed on an "AS IS" BASIS,
13#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14#   See the License for the specific language governing permissions and
15#   limitations under the License.
16
17# Constants for Wifi related events.
18WIFI_CONNECTED = "WifiNetworkConnected"
19WIFI_DISCONNECTED = "WifiNetworkDisconnected"
20SUPPLICANT_CON_CHANGED = "SupplicantConnectionChanged"
21WIFI_STATE_CHANGED = "WifiStateChanged"
22WIFI_FORGET_NW_SUCCESS = "WifiManagerForgetNetworkOnSuccess"
23WIFI_NETWORK_REQUEST_MATCH_CB_ON_MATCH = "WifiManagerNetworkRequestMatchCallbackOnMatch"
24WIFI_NETWORK_REQUEST_MATCH_CB_ON_CONNECT_SUCCESS = "WifiManagerNetworkRequestMatchCallbackOnUserSelectionConnectSuccess"
25WIFI_NETWORK_REQUEST_MATCH_CB_ON_CONNECT_FAILURE = "WifiManagerNetworkRequestMatchCallbackOnUserSelectionConnectFailure"
26WIFI_NETWORK_CB_ON_AVAILABLE = "WifiManagerNetworkCallbackOnAvailable"
27WIFI_NETWORK_CB_ON_UNAVAILABLE = "WifiManagerNetworkCallbackOnUnavailable"
28WIFI_NETWORK_CB_ON_LOST = "WifiManagerNetworkCallbackOnLost"
29WIFI_NETWORK_SUGGESTION_POST_CONNECTION = "WifiNetworkSuggestionPostConnection"
30WIFI_SUBSYSTEM_RESTARTING = "WifiSubsystemRestarting"
31WIFI_SUBSYSTEM_RESTARTED = "WifiSubsystemRestarted"
32
33# These constants will be used by the ACTS wifi tests.
34CONNECT_BY_CONFIG_SUCCESS = 'WifiManagerConnectByConfigOnSuccess'
35CONNECT_BY_NETID_SUCCESS = 'WifiManagerConnectByNetIdOnSuccess'
36
37# Softap related constants
38SOFTAP_CALLBACK_EVENT = "WifiManagerSoftApCallback-"
39# Callback Event for softap state change
40# WifiManagerSoftApCallback-[callbackId]-OnStateChanged
41SOFTAP_STATE_CHANGED = "-OnStateChanged"
42SOFTAP_STATE_CHANGE_CALLBACK_KEY = "State"
43WIFI_AP_DISABLING_STATE = 10
44WIFI_AP_DISABLED_STATE = 11
45WIFI_AP_ENABLING_STATE = 12
46WIFI_AP_ENABLED_STATE = 13
47WIFI_AP_FAILED_STATE = 14
48
49SOFTAP_RANDOMIZATION_NONE = 0
50SOFTAP_RANDOMIZATION_PERSISTENT = 1
51
52# Callback Event for client number change:
53# WifiManagerSoftApCallback-[callbackId]-OnNumClientsChanged
54SOFTAP_NUMBER_CLIENTS_CHANGED_WITH_INFO = "-OnConnectedClientsChangedWithInfo"
55SOFTAP_NUMBER_CLIENTS_CHANGED = "-OnNumClientsChanged"
56SOFTAP_NUMBER_CLIENTS_CALLBACK_KEY = "NumClients"
57SOFTAP_CLIENTS_MACS_CALLBACK_KEY = "MacAddresses"
58# Callback Event for softap info change
59SOFTAP_INFO_CHANGED = "-OnInfoChanged"
60SOFTAP_INFOLIST_CHANGED = "-OnInfoListChanged"
61SOFTAP_INFO_FREQUENCY_CALLBACK_KEY = "frequency"
62SOFTAP_INFO_BANDWIDTH_CALLBACK_KEY = "bandwidth"
63SOFTAP_INFO_WIFISTANDARD_CALLBACK_KEY = "wifiStandard"
64SOFTAP_INFO_AUTO_SHUTDOWN_CALLBACK_KEY = "autoShutdownTimeoutMillis"
65SOFTAP_INFO_BSSID_CALLBACK_KEY = "bssid"
66# Callback Event for softap client blocking
67SOFTAP_BLOCKING_CLIENT_CONNECTING = "-OnBlockedClientConnecting"
68SOFTAP_BLOCKING_CLIENT_REASON_KEY = "BlockedReason"
69SOFTAP_BLOCKING_CLIENT_WIFICLIENT_KEY = "WifiClient"
70SAP_CLIENT_BLOCK_REASON_CODE_BLOCKED_BY_USER = 0
71SAP_CLIENT_BLOCK_REASON_CODE_NO_MORE_STAS = 1
72
73# Callback Event for softap capability
74SOFTAP_CAPABILITY_CHANGED = "-OnCapabilityChanged"
75SOFTAP_CAPABILITY_MAX_SUPPORTED_CLIENTS = "maxSupportedClients"
76SOFTAP_CAPABILITY_24GHZ_SUPPORTED_CHANNEL_LIST = "supported2GHzChannellist"
77SOFTAP_CAPABILITY_5GHZ_SUPPORTED_CHANNEL_LIST = "supported5GHzChannellist"
78SOFTAP_CAPABILITY_6GHZ_SUPPORTED_CHANNEL_LIST = "supported6GHzChannellist"
79SOFTAP_CAPABILITY_60GHZ_SUPPORTED_CHANNEL_LIST = "supported60GHzChannellist"
80SOFTAP_CAPABILITY_FEATURE_ACS = "acsOffloadSupported"
81SOFTAP_CAPABILITY_FEATURE_CLIENT_CONTROL = "clientForceDisconnectSupported"
82SOFTAP_CAPABILITY_FEATURE_WPA3_SAE = "wpa3SaeSupported"
83SOFTAP_CAPABILITY_FEATURE_IEEE80211AX = "ieee80211axSupported"
84SOFTAP_CAPABILITY_FEATURE_24GHZ = "24gSupported"
85SOFTAP_CAPABILITY_FEATURE_5GHZ = "5gSupported"
86SOFTAP_CAPABILITY_FEATURE_6GHZ = "6gSupported"
87SOFTAP_CAPABILITY_FEATURE_60GHZ = "60gSupported"
88
89DEFAULT_SOFTAP_TIMEOUT_S = 600 # 10 minutes
90
91# AP related constants
92AP_MAIN = "main_AP"
93AP_AUX = "aux_AP"
94SSID = "SSID"
95
96# Delay before registering the match callback.
97NETWORK_REQUEST_CB_REGISTER_DELAY_SEC = 2
98
99# Constants for JSONObject representation of CoexUnsafeChannel
100COEX_BAND = "band"
101COEX_BAND_24_GHZ = "24_GHZ"
102COEX_BAND_5_GHZ = "5_GHZ"
103COEX_CHANNEL = "channel"
104COEX_POWER_CAP_DBM = "powerCapDbm"
105
106# Constants for bundle keys for CoexCallback#onCoexUnsafeChannelsChanged
107KEY_COEX_UNSAFE_CHANNELS = "KEY_COEX_UNSAFE_CHANNELS"
108KEY_COEX_RESTRICTIONS = "KEY_COEX_RESTRICTIONS"
109
110# WiFi standards
111WIFI_STANDARD_11AX = 6
112