LoRa Access Point 1.5.2018
Dependencies: mbed ds3231 SX1276Lib_LoRa_Access_Point
ESP8266.h@10:e62222c46ee9, 2019-03-28 (annotated)
- Committer:
- lukas_formanek
- Date:
- Thu Mar 28 09:55:48 2019 +0000
- Revision:
- 10:e62222c46ee9
- Parent:
- 6:1ee035ae2a2c
- Child:
- 11:376bfcdda0d4
28.3.2019 working SD,RTC
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 | 10:e62222c46ee9 | 8 | //#include "SD.h" |
lukas_formanek | 0:ea088908ad26 | 9 | |
lukas_formanek | 0:ea088908ad26 | 10 | #define BUFFER_SIZE 1024 |
lukas_formanek | 2:0499e1d037a5 | 11 | #define SETTING_SIZE 64 |
lukas_formanek | 0:ea088908ad26 | 12 | |
lukas_formanek | 10:e62222c46ee9 | 13 | |
lukas_formanek | 0:ea088908ad26 | 14 | class ESP8266 |
lukas_formanek | 0:ea088908ad26 | 15 | { |
lukas_formanek | 0:ea088908ad26 | 16 | private: |
lukas_formanek | 0:ea088908ad26 | 17 | Serial wifiUart; |
lukas_formanek | 0:ea088908ad26 | 18 | DigitalInOut wifiReset; |
lukas_formanek | 0:ea088908ad26 | 19 | Timer responseTimer; |
lukas_formanek | 0:ea088908ad26 | 20 | Ticker setTicker; |
lukas_formanek | 0:ea088908ad26 | 21 | char buffer[BUFFER_SIZE]; |
lukas_formanek | 2:0499e1d037a5 | 22 | char serverIpAddress[SETTING_SIZE]; // ip adresa servera, command |
lukas_formanek | 6:1ee035ae2a2c | 23 | char wifiSettings[SETTING_SIZE]; // wifi connection |
lukas_formanek | 0:ea088908ad26 | 24 | volatile uint16_t pt; |
lukas_formanek | 0:ea088908ad26 | 25 | char* response; |
lukas_formanek | 0:ea088908ad26 | 26 | volatile bool okResponse; |
lukas_formanek | 0:ea088908ad26 | 27 | volatile bool receiveResponse; |
lukas_formanek | 0:ea088908ad26 | 28 | volatile bool setServerIp; |
lukas_formanek | 0:ea088908ad26 | 29 | volatile bool setWifiSettings; |
lukas_formanek | 5:19b34c4d27a1 | 30 | |
lukas_formanek | 0:ea088908ad26 | 31 | void ClearBuffer(); |
lukas_formanek | 0:ea088908ad26 | 32 | void RxWifiInterrupt(); |
lukas_formanek | 0:ea088908ad26 | 33 | public: |
lukas_formanek | 0:ea088908ad26 | 34 | ESP8266(PinName tx, PinName rx, PinName reset); |
lukas_formanek | 2:0499e1d037a5 | 35 | ESP8266(); |
lukas_formanek | 0:ea088908ad26 | 36 | void Init(); |
lukas_formanek | 0:ea088908ad26 | 37 | void SendCommand(char* command, char* answer ,int timeoutMs); |
lukas_formanek | 0:ea088908ad26 | 38 | void SetIpOfServer(char* command); |
lukas_formanek | 0:ea088908ad26 | 39 | void SetWiFiConnection(char* command); |
lukas_formanek | 0:ea088908ad26 | 40 | void SendMessage(char* message); |
lukas_formanek | 0:ea088908ad26 | 41 | void Test(); |
lukas_formanek | 0:ea088908ad26 | 42 | void CheckSettings(); |
lukas_formanek | 5:19b34c4d27a1 | 43 | void ConfirmReceivedAck(uint8_t from); |
lukas_formanek | 0:ea088908ad26 | 44 | }; |
lukas_formanek | 0:ea088908ad26 | 45 | |
lukas_formanek | 0:ea088908ad26 | 46 | extern ESP8266 wifi; |
lukas_formanek | 0:ea088908ad26 | 47 | |
lukas_formanek | 0:ea088908ad26 | 48 | #endif |