Connectino Library
ConnectinoWlan.h
1 // not implemented yet
2 #ifndef ConnectinoWlan_h
3 #define ConnectinoWlan_h
4 
5 #include "ConnectinoModule.h"
6 #include "MODULE.h"
7 #include "StxHwSerial.h"
8 
9 typedef enum {
10  CONNECTINO_WLAN_SECURITY_OPEN = 0x01,
11  CONNECTINO_WLAN_SECURITY_WEP = 0x02,
12  CONNECTINO_WLAN_SECURITY_WPA = 0x03,
13  CONNECTINO_WLAN_SECURITY_WPA2 = 0x04,
14  CONNECTINO_WLAN_SECURITY_WPA2_MIX = 0x05,
15 }CONNECTINO_WLAN_SECURITY_T;
16 
17 typedef enum {
18  CONNECTINO_WLAN_IPMODE_MANUAL = 0x01,
19  CONNECTINO_WLAN_IPMODE_DHCP = 0x02,
20  CONNECTINO_WLAN_IPMODE_AUTO = 0x03,
21 }CONNECTINO_WLAN_IPMODE_T;
22 
31 {
32  public:
37  ConnectinoWlan(StxHwSerial &refSerial);
38 
48  bool moduleCallback(uint8_t subId, uint8_t reqId, uint16_t dataSize, uint8_t *data);
49 
54  uint8_t getModId();
55 
61  bool enable(void);
62 
67  bool disable(void);
68 
78  bool connect(const char *ssid, const char *password, CONNECTINO_WLAN_SECURITY_T security, bool waitConnected);
79 
85  bool disconnect(void);
86 
91  bool isConnected(void);
92 
97  bool openAccessPoint(void);
98 
103  bool closeAccessPoint(void);
104  private:
105  StxHwSerial &StxSerial;
106  bool _reqPending;
107  bool _reqResOk;
108  uint8_t _reqSubId;
109  uint8_t _reqReqId;
110  uint8_t _reqState;
111  uint8_t _reqStatus;
119  bool _state(uint8_t interface, bool set);
120 
130  bool _config(uint8_t interface, const char *ssid, const char *psk, uint8_t security, uint8_t channel);
131 
137  uint8_t _getState(uint8_t interface);
138 
144  uint8_t _getStatus(uint8_t interface);
145 };
146 
147 #endif
uint8_t getModId()
Get the ID of the AJAX module.
Definition: ConnectinoWlan.cpp:169
bool disable(void)
Deactivate the station interface.
Definition: ConnectinoWlan.cpp:225
bool openAccessPoint(void)
Open the AP.
Definition: ConnectinoWlan.cpp:273
ConnectinoWlan(StxHwSerial &refSerial)
WLAN module constructor.
Definition: ConnectinoWlan.cpp:165
WLAN module.
Definition: ConnectinoWlan.h:30
bool disconnect(void)
Disconnect from a WLAN.
Definition: ConnectinoWlan.cpp:259
bool isConnected(void)
Check connection state.
Definition: ConnectinoWlan.cpp:264
bool connect(const char *ssid, const char *password, CONNECTINO_WLAN_SECURITY_T security, bool waitConnected)
Connect to a WLAN.
Definition: ConnectinoWlan.cpp:230
bool closeAccessPoint(void)
Close the AP.
Definition: ConnectinoWlan.cpp:278
bool enable(void)
Activate the station interface.
Definition: ConnectinoWlan.cpp:220
Binuart module.
Definition: ConnectinoModule.h:10
bool moduleCallback(uint8_t subId, uint8_t reqId, uint16_t dataSize, uint8_t *data)
Callback function for serial frames of the NET module.
Definition: ConnectinoWlan.cpp:174