Tijl Goens
/
EpaperdisplayII
tempcommit 13/05
Esp8266.h@2:048e163245b7, 2019-05-15 (annotated)
- Committer:
- tijl
- Date:
- Wed May 15 13:39:22 2019 +0000
- Revision:
- 2:048e163245b7
- Parent:
- 1:63664175e603
blub 15/05;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
tijl | 1:63664175e603 | 1 | #ifndef ESP8266_H |
tijl | 1:63664175e603 | 2 | #define ESP8266_H |
tijl | 1:63664175e603 | 3 | |
tijl | 1:63664175e603 | 4 | #include <vector> |
tijl | 1:63664175e603 | 5 | #include <string> |
tijl | 1:63664175e603 | 6 | #include "mbed.h" |
tijl | 1:63664175e603 | 7 | |
tijl | 1:63664175e603 | 8 | class Esp8266 { |
tijl | 1:63664175e603 | 9 | public: |
tijl | 1:63664175e603 | 10 | explicit Esp8266(PinName TX, PinName RX, int BaudRate, PinName ResetPin, PinName ChipSelect); |
tijl | 1:63664175e603 | 11 | void connectToAP(const char* SSID, const char* Password); |
tijl | 2:048e163245b7 | 12 | std::string getRequest(const char* TCPorUDP, const char* Server, int Port, const char* ConnectionString, bool stayAlive); |
tijl | 1:63664175e603 | 13 | void setModuleMode(int Mode); |
tijl | 1:63664175e603 | 14 | std::vector<std::string> processJsonString(std::string response); |
tijl | 1:63664175e603 | 15 | private: |
tijl | 1:63664175e603 | 16 | DigitalOut *rst; |
tijl | 1:63664175e603 | 17 | DigitalOut *cs; |
tijl | 1:63664175e603 | 18 | int baud; |
tijl | 1:63664175e603 | 19 | PinName tx; |
tijl | 1:63664175e603 | 20 | PinName rx; |
tijl | 1:63664175e603 | 21 | ATCmdParser *parser; |
tijl | 1:63664175e603 | 22 | UARTSerial *serial; |
tijl | 1:63664175e603 | 23 | void setupModule(PinName TX, PinName RX, int BaudRate); |
tijl | 1:63664175e603 | 24 | void toggleResetPin(void); |
tijl | 1:63664175e603 | 25 | void closeConnection(void); |
tijl | 1:63664175e603 | 26 | std::string getJsonString(void); |
tijl | 1:63664175e603 | 27 | }; |
tijl | 1:63664175e603 | 28 | |
tijl | 1:63664175e603 | 29 | #endif |