2020-06-12 15:28:35 +02:00
|
|
|
|
|
|
|
#ifndef WifiInterface_h
|
|
|
|
#define WifiInterface_h
|
|
|
|
#include "DCCEXParser.h"
|
2020-06-13 10:36:10 +02:00
|
|
|
#include "MemStream.h"
|
2020-06-13 16:53:46 +02:00
|
|
|
#include <Arduino.h>
|
|
|
|
#include <avr/pgmspace.h>
|
2020-06-12 15:28:35 +02:00
|
|
|
|
|
|
|
class WifiInterface {
|
|
|
|
|
|
|
|
public:
|
2020-06-28 11:21:27 +02:00
|
|
|
static void setup(Stream & wifiStream, const __FlashStringHelper* SSSid, const __FlashStringHelper* password, int port);
|
|
|
|
static void loop(Stream & wifiStream);
|
2020-06-12 15:28:35 +02:00
|
|
|
|
|
|
|
private:
|
2020-06-28 11:21:27 +02:00
|
|
|
|
2020-06-13 10:36:10 +02:00
|
|
|
static DCCEXParser parser;
|
2020-06-28 11:21:27 +02:00
|
|
|
static bool setup2(Stream & wifiStream, const __FlashStringHelper* SSSid, const __FlashStringHelper* password, int port);
|
2020-06-29 12:37:05 +02:00
|
|
|
static bool checkForOK(Stream & wifiStream, const unsigned int timeout, const char* waitfor, bool echo);
|
|
|
|
static bool isHTML();
|
2020-06-12 15:28:35 +02:00
|
|
|
static bool connected;
|
2020-06-13 10:36:10 +02:00
|
|
|
static byte loopstate;
|
|
|
|
static int datalength;
|
|
|
|
static int connectionId;
|
2020-06-28 13:45:31 +02:00
|
|
|
static const byte MAX_WIFI_BUFFER=250;
|
2020-06-13 10:36:10 +02:00
|
|
|
static byte buffer[MAX_WIFI_BUFFER];
|
|
|
|
static MemStream streamer;
|
2020-06-12 15:28:35 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|