knx/src/esp_platform.h

39 lines
928 B
C
Raw Normal View History

2019-08-22 21:31:02 +02:00
#ifdef ARDUINO_ARCH_ESP8266
#include "arduino_platform.h"
2019-08-22 21:31:02 +02:00
#include <ESP8266WiFi.h>
#include <WiFiUdp.h>
#define SerialDBG Serial
class EspPlatform : public ArduinoPlatform
2019-08-22 21:31:02 +02:00
{
using ArduinoPlatform::_mulitcastAddr;
using ArduinoPlatform::_mulitcastPort;
public:
2019-08-22 21:31:02 +02:00
EspPlatform();
EspPlatform( HardwareSerial& s);
2019-08-22 21:31:02 +02:00
// ip stuff
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
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;
};
2018-11-07 00:32:36 +01:00
#endif