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"
30
31# These constants will be used by the ACTS wifi tests.
32CONNECT_BY_CONFIG_SUCCESS = 'WifiManagerConnectByConfigOnSuccess'
33CONNECT_BY_NETID_SUCCESS = 'WifiManagerConnectByNetIdOnSuccess'
34
35# Softap related constants
36SOFTAP_CALLBACK_EVENT = "WifiManagerSoftApCallback-"
37# Callback Event for softap state change
38# WifiManagerSoftApCallback-[callbackId]-OnStateChanged
39SOFTAP_STATE_CHANGED = "-OnStateChanged"
40# Cllback Event for client number change:
41# WifiManagerSoftApCallback-[callbackId]-OnNumClientsChanged
42SOFTAP_NUMBER_CLIENTS_CHANGED = "-OnNumClientsChanged"
43SOFTAP_NUMBER_CLIENTS_CALLBACK_KEY = "NumClients"
44SOFTAP_STATE_CHANGE_CALLBACK_KEY = "State"
45WIFI_AP_DISABLING_STATE = 10
46WIFI_AP_DISABLED_STATE = 11
47WIFI_AP_ENABLING_STATE = 12
48WIFI_AP_ENABLED_STATE = 13
49WIFI_AP_FAILED_STATE = 14
50DEFAULT_SOFTAP_TIMEOUT_S = 600 # 10 minutes
51
52
53# AP related constants
54AP_MAIN = "main_AP"
55AP_AUX = "aux_AP"
56SSID = "SSID"
57
58# cnss_diag property related constants
59DEVICES_USING_LEGACY_PROP = ["sailfish", "marlin", "walleye", "taimen", "muskie"]
60CNSS_DIAG_PROP = "persist.vendor.sys.cnss.diag_txt"
61LEGACY_CNSS_DIAG_PROP = "persist.sys.cnss.diag_txt"
62
63# Delay before registering the match callback.
64NETWORK_REQUEST_CB_REGISTER_DELAY_SEC = 2
65