2019-08-26 13:45:14 +02:00
|
|
|
#ifdef ARDUINO_ARCH_ESP32
|
2019-08-26 21:26:55 +02:00
|
|
|
#include "arduino_platform.h"
|
2019-08-26 13:45:14 +02:00
|
|
|
#include <WiFi.h>
|
|
|
|
#include <WiFiUdp.h>
|
|
|
|
|
|
|
|
|
2019-08-26 21:26:55 +02:00
|
|
|
class Esp32Platform : public ArduinoPlatform
|
2019-08-26 13:45:14 +02:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
Esp32Platform();
|
2021-02-05 15:57:45 +01:00
|
|
|
Esp32Platform(HardwareSerial* s);
|
2019-08-26 13:45:14 +02:00
|
|
|
|
2023-12-25 19:39:05 +01:00
|
|
|
// uart
|
|
|
|
void knxUartPins(int8_t rxPin, int8_t txPin);
|
|
|
|
void setupUart() override;
|
|
|
|
|
2019-08-26 13:45:14 +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-26 13:45:14 +02:00
|
|
|
|
2021-04-12 11:40:56 +02:00
|
|
|
// unique serial number
|
|
|
|
uint32_t uniqueSerialNumber() override;
|
|
|
|
|
2019-08-26 13:45:14 +02:00
|
|
|
// basic stuff
|
|
|
|
void restart();
|
|
|
|
|
|
|
|
//multicast
|
2019-08-26 21:26:55 +02:00
|
|
|
void setupMultiCast(uint32_t addr, uint16_t port) override;
|
|
|
|
void closeMultiCast() override;
|
2019-12-10 22:29:14 +01:00
|
|
|
bool sendBytesMultiCast(uint8_t* buffer, uint16_t len) override;
|
|
|
|
int readBytesMultiCast(uint8_t* buffer, uint16_t maxLen) override;
|
2019-08-26 13:45:14 +02:00
|
|
|
|
2021-06-04 17:23:23 +02:00
|
|
|
//unicast
|
|
|
|
bool sendBytesUniCast(uint32_t addr, uint16_t port, uint8_t* buffer, uint16_t len) override;
|
|
|
|
|
2019-08-26 13:45:14 +02:00
|
|
|
//memory
|
2023-02-13 21:39:30 +01:00
|
|
|
uint8_t* getEepromBuffer(uint32_t size);
|
2019-08-26 13:45:14 +02:00
|
|
|
void commitToEeprom();
|
|
|
|
private:
|
|
|
|
WiFiUDP _udp;
|
2023-12-25 19:39:05 +01:00
|
|
|
int8_t _rxPin = -1;
|
|
|
|
int8_t _txPin = -1;
|
2019-08-26 13:45:14 +02:00
|
|
|
};
|
|
|
|
|
2019-09-09 18:19:09 +02:00
|
|
|
#endif
|