mirror of
https://github.com/thelsing/knx.git
synced 2024-12-18 19:08:18 +01:00
59d1b67d6c
for ESP8266 and ESP32
44 lines
1.1 KiB
C++
44 lines
1.1 KiB
C++
#ifdef ARDUINO_ARCH_ESP8266
|
|
#include "arduino_platform.h"
|
|
#include <ESP8266WiFi.h>
|
|
#include <WiFiUdp.h>
|
|
|
|
|
|
class EspPlatform : public ArduinoPlatform
|
|
{
|
|
public:
|
|
EspPlatform();
|
|
EspPlatform(HardwareSerial* s);
|
|
|
|
// ip stuff
|
|
uint32_t currentIpAddress() override;
|
|
uint32_t currentSubnetMask() override;
|
|
uint32_t currentDefaultGateway() override;
|
|
void macAddress(uint8_t* addr) override;
|
|
|
|
// unique serial number
|
|
uint32_t uniqueSerialNumber() override;
|
|
|
|
// basic stuff
|
|
void restart();
|
|
|
|
//multicast
|
|
void setupMultiCast(uint32_t addr, uint16_t port) override;
|
|
void closeMultiCast() override;
|
|
bool sendBytesMultiCast(uint8_t* buffer, uint16_t len) override;
|
|
int readBytesMultiCast(uint8_t* buffer, uint16_t maxLen) override;
|
|
|
|
//unicast
|
|
bool sendBytesUniCast(uint32_t addr, uint16_t port, uint8_t* buffer, uint16_t len) override;
|
|
|
|
//memory
|
|
uint8_t* getEepromBuffer(uint16_t size);
|
|
void commitToEeprom();
|
|
private:
|
|
WiFiUDP _udp;
|
|
uint32_t _multicastAddr;
|
|
uint16_t _multicastPort;
|
|
};
|
|
|
|
#endif
|