2019-08-22 21:31:02 +02:00
|
|
|
#ifdef ARDUINO_ARCH_ESP8266
|
2019-08-26 21:26:55 +02:00
|
|
|
#include "arduino_platform.h"
|
2019-08-22 21:31:02 +02:00
|
|
|
#include <ESP8266WiFi.h>
|
|
|
|
#include <WiFiUdp.h>
|
|
|
|
|
|
|
|
|
2019-08-26 21:26:55 +02:00
|
|
|
class EspPlatform : public ArduinoPlatform
|
2019-08-22 21:31:02 +02:00
|
|
|
{
|
2019-08-26 21:26:55 +02:00
|
|
|
using ArduinoPlatform::_mulitcastAddr;
|
|
|
|
using ArduinoPlatform::_mulitcastPort;
|
|
|
|
|
|
|
|
public:
|
2019-08-22 21:31:02 +02:00
|
|
|
EspPlatform();
|
2019-09-09 18:19:09 +02:00
|
|
|
EspPlatform( HardwareSerial* s);
|
2019-08-22 21:31:02 +02:00
|
|
|
|
|
|
|
// ip stuff
|
2019-08-26 21:26:55 +02:00
|
|
|
uint32_t currentIpAddress() override;
|
|
|
|
uint32_t currentSubnetMask() override;
|
|
|
|
uint32_t currentDefaultGateway() override;
|
|
|
|
void macAddress(uint8_t* addr) override;
|
2019-08-22 21:31:02 +02:00
|
|
|
|
|
|
|
// basic stuff
|
|
|
|
void restart();
|
|
|
|
|
2018-03-16 00:48:39 +01:00
|
|
|
//multicast
|
2019-08-26 21:26:55 +02:00
|
|
|
void setupMultiCast(uint32_t addr, uint16_t port) override;
|
|
|
|
void closeMultiCast() override;
|
|
|
|
bool sendBytes(uint8_t* buffer, uint16_t len) override;
|
|
|
|
int readBytes(uint8_t* buffer, uint16_t maxLen) override;
|
|
|
|
|
2018-03-16 00:48:39 +01:00
|
|
|
//memory
|
|
|
|
uint8_t* getEepromBuffer(uint16_t size);
|
|
|
|
void commitToEeprom();
|
2019-08-22 21:31:02 +02:00
|
|
|
private:
|
|
|
|
WiFiUDP _udp;
|
|
|
|
};
|
|
|
|
|
2019-09-09 18:19:09 +02:00
|
|
|
#endif
|