LoRa Access Point 1.5.2018

Dependencies:   mbed ds3231 SX1276Lib_LoRa_Access_Point

Committer:
lukas_formanek
Date:
Wed Apr 18 20:33:15 2018 +0000
Revision:
0:ea088908ad26
Child:
1:7543af31b91f
18.4.2018

Who changed what in which revision?

UserRevisionLine numberNew 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 0:ea088908ad26 5 #include "HC05.h"
lukas_formanek 0:ea088908ad26 6
lukas_formanek 0:ea088908ad26 7 #define BAUDRATE 115200
lukas_formanek 0:ea088908ad26 8 #define BUFFER_SIZE 1024
lukas_formanek 0:ea088908ad26 9
lukas_formanek 0:ea088908ad26 10 class ESP8266
lukas_formanek 0:ea088908ad26 11 {
lukas_formanek 0:ea088908ad26 12 private:
lukas_formanek 0:ea088908ad26 13 Serial wifiUart;
lukas_formanek 0:ea088908ad26 14 DigitalInOut wifiReset;
lukas_formanek 0:ea088908ad26 15 Timer responseTimer;
lukas_formanek 0:ea088908ad26 16 Ticker setTicker;
lukas_formanek 0:ea088908ad26 17 char buffer[BUFFER_SIZE];
lukas_formanek 0:ea088908ad26 18 char serverIpAddress[64]; // ip adresa servera, command
lukas_formanek 0:ea088908ad26 19 char wifiSettings[64]; // wifi connection
lukas_formanek 0:ea088908ad26 20 volatile uint16_t pt;
lukas_formanek 0:ea088908ad26 21 char* response;
lukas_formanek 0:ea088908ad26 22 volatile bool okResponse;
lukas_formanek 0:ea088908ad26 23 volatile bool receiveResponse;
lukas_formanek 0:ea088908ad26 24 volatile bool setServerIp;
lukas_formanek 0:ea088908ad26 25 volatile bool setWifiSettings;
lukas_formanek 0:ea088908ad26 26
lukas_formanek 0:ea088908ad26 27 void ClearBuffer();
lukas_formanek 0:ea088908ad26 28 void RxWifiInterrupt();
lukas_formanek 0:ea088908ad26 29 public:
lukas_formanek 0:ea088908ad26 30 ESP8266(PinName tx, PinName rx, PinName reset);
lukas_formanek 0:ea088908ad26 31 ESP8266();
lukas_formanek 0:ea088908ad26 32 void Init();
lukas_formanek 0:ea088908ad26 33 void SendCommand(char* command, char* answer ,int timeoutMs);
lukas_formanek 0:ea088908ad26 34 void SetIpOfServer(char* command);
lukas_formanek 0:ea088908ad26 35 void SetWiFiConnection(char* command);
lukas_formanek 0:ea088908ad26 36 void SendMessage(char* message);
lukas_formanek 0:ea088908ad26 37 void Test();
lukas_formanek 0:ea088908ad26 38 void CheckSettings();
lukas_formanek 0:ea088908ad26 39 };
lukas_formanek 0:ea088908ad26 40
lukas_formanek 0:ea088908ad26 41 extern ESP8266 wifi;
lukas_formanek 0:ea088908ad26 42
lukas_formanek 0:ea088908ad26 43 #endif