ESP8266
wl_definitions.h
1 /*
2  wl_definitions.h - Library for Arduino Wifi shield.
3  Copyright (c) 2011-2014 Arduino. All right reserved.
4 
5  This library is free software; you can redistribute it and/or
6  modify it under the terms of the GNU Lesser General Public
7  License as published by the Free Software Foundation; either
8  version 2.1 of the License, or (at your option) any later version.
9 
10  This library is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public
16  License along with this library; if not, write to the Free Software
17  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 */
19 /*
20  * wl_definitions.h
21  *
22  * Created on: Mar 6, 2011
23  * Author: dlafauci
24  */
25 
26 #ifndef WL_DEFINITIONS_H_
27 #define WL_DEFINITIONS_H_
28 
29 // Maximum size of a SSID
30 #define WL_SSID_MAX_LENGTH 32
31 // Length of passphrase. Valid lengths are 8-63.
32 #define WL_WPA_KEY_MAX_LENGTH 63
33 // Length of key in bytes. Valid values are 5 and 13.
34 #define WL_WEP_KEY_MAX_LENGTH 13
35 // Size of a MAC-address or BSSID
36 #define WL_MAC_ADDR_LENGTH 6
37 // Size of a MAC-address or BSSID
38 #define WL_IPV4_LENGTH 4
39 // Maximum size of a SSID list
40 #define WL_NETWORKS_LIST_MAXNUM 10
41 // Maxmium number of socket
42 #define MAX_SOCK_NUM 4
43 // Socket not available constant
44 #define SOCK_NOT_AVAIL 255
45 // Default state value for Wifi state field
46 #define NA_STATE -1
47 //Maximum number of attempts to establish wifi connection
48 #define WL_MAX_ATTEMPT_CONNECTION 10
49 
50 typedef enum {
51  WL_NO_SHIELD = 255, // for compatibility with WiFi Shield library
52  WL_IDLE_STATUS = 0,
53  WL_NO_SSID_AVAIL = 1,
54  WL_SCAN_COMPLETED = 2,
55  WL_CONNECTED = 3,
56  WL_CONNECT_FAILED = 4,
57  WL_CONNECTION_LOST = 5,
58  WL_DISCONNECTED = 6
59 } wl_status_t;
60 
61 /* Encryption modes */
62 enum wl_enc_type { /* Values map to 802.11 encryption suites... */
63  ENC_TYPE_WEP = 5,
64  ENC_TYPE_TKIP = 2,
65  ENC_TYPE_CCMP = 4,
66  /* ... except these two, 7 and 8 are reserved in 802.11-2007 */
67  ENC_TYPE_NONE = 7,
68  ENC_TYPE_AUTO = 8
69 };
70 
71 #if !defined(LWIP_INTERNAL) && !defined(__LWIP_TCP_H__)
72 enum wl_tcp_state {
73  CLOSED = 0,
74  LISTEN = 1,
75  SYN_SENT = 2,
76  SYN_RCVD = 3,
77  ESTABLISHED = 4,
78  FIN_WAIT_1 = 5,
79  FIN_WAIT_2 = 6,
80  CLOSE_WAIT = 7,
81  CLOSING = 8,
82  LAST_ACK = 9,
83  TIME_WAIT = 10
84 };
85 #endif
86 
87 #endif /* WL_DEFINITIONS_H_ */