LoRa Access Point 1.5.2018
Dependencies: mbed ds3231 SX1276Lib_LoRa_Access_Point
ESP8266.h@5:19b34c4d27a1, 2018-04-30 (annotated)
- Committer:
- lukas_formanek
- Date:
- Mon Apr 30 22:41:48 2018 +0000
- Revision:
- 5:19b34c4d27a1
- Parent:
- 4:e20eb5efd859
- Child:
- 6:1ee035ae2a2c
1.5.2018
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
lukas_formanek | 0:ea088908ad26 | 1 | #ifndef ESP8266_H |
lukas_formanek | 0:ea088908ad26 | 2 | #define ESP8266_H |
lukas_formanek | 0:ea088908ad26 | 3 | |
lukas_formanek | 0:ea088908ad26 | 4 | #include "mbed.h" |
lukas_formanek | 4:e20eb5efd859 | 5 | #include "RFM95W.h" |
lukas_formanek | 1:7543af31b91f | 6 | #include "Board.h" |
lukas_formanek | 0:ea088908ad26 | 7 | #include "HC05.h" |
lukas_formanek | 0:ea088908ad26 | 8 | |
lukas_formanek | 0:ea088908ad26 | 9 | #define BUFFER_SIZE 1024 |
lukas_formanek | 2:0499e1d037a5 | 10 | #define SETTING_SIZE 64 |
lukas_formanek | 0:ea088908ad26 | 11 | |
lukas_formanek | 0:ea088908ad26 | 12 | class ESP8266 |
lukas_formanek | 0:ea088908ad26 | 13 | { |
lukas_formanek | 0:ea088908ad26 | 14 | private: |
lukas_formanek | 0:ea088908ad26 | 15 | Serial wifiUart; |
lukas_formanek | 0:ea088908ad26 | 16 | DigitalInOut wifiReset; |
lukas_formanek | 0:ea088908ad26 | 17 | Timer responseTimer; |
lukas_formanek | 0:ea088908ad26 | 18 | Ticker setTicker; |
lukas_formanek | 0:ea088908ad26 | 19 | char buffer[BUFFER_SIZE]; |
lukas_formanek | 2:0499e1d037a5 | 20 | char serverIpAddress[SETTING_SIZE]; // ip adresa servera, command |
lukas_formanek | 2:0499e1d037a5 | 21 | char wifiSettings[SETTING_SIZE]; // wifi connection |
lukas_formanek | 0:ea088908ad26 | 22 | volatile uint16_t pt; |
lukas_formanek | 0:ea088908ad26 | 23 | char* response; |
lukas_formanek | 0:ea088908ad26 | 24 | volatile bool okResponse; |
lukas_formanek | 0:ea088908ad26 | 25 | volatile bool receiveResponse; |
lukas_formanek | 0:ea088908ad26 | 26 | volatile bool setServerIp; |
lukas_formanek | 0:ea088908ad26 | 27 | volatile bool setWifiSettings; |
lukas_formanek | 5:19b34c4d27a1 | 28 | |
lukas_formanek | 0:ea088908ad26 | 29 | void ClearBuffer(); |
lukas_formanek | 0:ea088908ad26 | 30 | void RxWifiInterrupt(); |
lukas_formanek | 0:ea088908ad26 | 31 | public: |
lukas_formanek | 0:ea088908ad26 | 32 | ESP8266(PinName tx, PinName rx, PinName reset); |
lukas_formanek | 2:0499e1d037a5 | 33 | ESP8266(); |
lukas_formanek | 0:ea088908ad26 | 34 | void Init(); |
lukas_formanek | 0:ea088908ad26 | 35 | void SendCommand(char* command, char* answer ,int timeoutMs); |
lukas_formanek | 0:ea088908ad26 | 36 | void SetIpOfServer(char* command); |
lukas_formanek | 0:ea088908ad26 | 37 | void SetWiFiConnection(char* command); |
lukas_formanek | 0:ea088908ad26 | 38 | void SendMessage(char* message); |
lukas_formanek | 0:ea088908ad26 | 39 | void Test(); |
lukas_formanek | 0:ea088908ad26 | 40 | void CheckSettings(); |
lukas_formanek | 5:19b34c4d27a1 | 41 | void ConfirmReceivedAck(uint8_t from); |
lukas_formanek | 0:ea088908ad26 | 42 | }; |
lukas_formanek | 0:ea088908ad26 | 43 | |
lukas_formanek | 0:ea088908ad26 | 44 | extern ESP8266 wifi; |
lukas_formanek | 0:ea088908ad26 | 45 | |
lukas_formanek | 0:ea088908ad26 | 46 | #endif |