LoRa Access Point 1.5.2018

Dependencies:   mbed ds3231 SX1276Lib_LoRa_Access_Point

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