|
| 1 | +// Copyright 2020 Espressif Systems (Shanghai) PTE LTD |
| 2 | +// |
| 3 | +// Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +// you may not use this file except in compliance with the License. |
| 5 | +// You may obtain a copy of the License at |
| 6 | +// |
| 7 | +// http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +// |
| 9 | +// Unless required by applicable law or agreed to in writing, software |
| 10 | +// distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +// See the License for the specific language governing permissions and |
| 13 | +// limitations under the License. |
| 14 | + |
| 15 | +package com.espressif.provision; |
| 16 | + |
| 17 | +/** |
| 18 | + * This class has constants and enums used in library. |
| 19 | + */ |
| 20 | +public class ESPConstants { |
| 21 | + |
| 22 | + public static final String DEFAULT_WIFI_BASE_URL = "192.168.4.1:80"; |
| 23 | + |
| 24 | + public enum TransportType { |
| 25 | + TRANSPORT_BLE, |
| 26 | + TRANSPORT_SOFTAP |
| 27 | + } |
| 28 | + |
| 29 | + public enum SecurityType { |
| 30 | + SECURITY_0, |
| 31 | + SECURITY_1 |
| 32 | + } |
| 33 | + |
| 34 | + public enum ProvisionFailureReason { |
| 35 | + AUTH_FAILED, |
| 36 | + NETWORK_NOT_FOUND, |
| 37 | + DEVICE_DISCONNECTED, |
| 38 | + UNKNOWN |
| 39 | + } |
| 40 | + |
| 41 | + // End point names |
| 42 | + public static final String HANDLER_PROV_SCAN = "prov-scan"; |
| 43 | + public static final String HANDLER_PROTO_VER = "proto-ver"; |
| 44 | + public static final String HANDLER_PROV_SESSION = "prov-session"; |
| 45 | + public static final String HANDLER_PROV_CONFIG = "prov-config"; |
| 46 | + |
| 47 | + // Event types |
| 48 | + public static final short EVENT_DEVICE_CONNECTED = 1; |
| 49 | + public static final short EVENT_DEVICE_CONNECTION_FAILED = 2; |
| 50 | + public static final short EVENT_DEVICE_DISCONNECTED = 3; |
| 51 | + |
| 52 | + // Constants for WiFi Security values (As per proto files) |
| 53 | + public static final short WIFI_OPEN = 0; |
| 54 | + public static final short WIFI_WEP = 1; |
| 55 | + public static final short WIFI_WPA_PSK = 2; |
| 56 | + public static final short WIFI_WPA2_PSK = 3; |
| 57 | + public static final short WIFI_WPA_WPA2_PSK = 4; |
| 58 | + public static final short WIFI_WPA2_ENTERPRISE = 5; |
| 59 | +} |
0 commit comments