mirror of
https://github.com/thelsing/knx.git
synced 2024-12-18 19:08:18 +01:00
parent
2450c1c458
commit
59d1b67d6c
@ -92,6 +92,18 @@ int Esp32Platform::readBytesMultiCast(uint8_t * buffer, uint16_t maxLen)
|
||||
return len;
|
||||
}
|
||||
|
||||
bool Esp32Platform::sendBytesUniCast(uint32_t addr, uint16_t port, uint8_t* buffer, uint16_t len)
|
||||
{
|
||||
IPAddress ucastaddr(htonl(addr));
|
||||
println("sendBytesUniCast endPacket fail");
|
||||
if(_udp.beginPacket(ucastaddr, port) == 1) {
|
||||
_udp.write(buffer, len);
|
||||
if(_udp.endPacket() == 0) println("sendBytesUniCast endPacket fail");
|
||||
}
|
||||
else println("sendBytesUniCast beginPacket fail");
|
||||
return true;
|
||||
}
|
||||
|
||||
uint8_t * Esp32Platform::getEepromBuffer(uint16_t size)
|
||||
{
|
||||
EEPROM.begin(size);
|
||||
|
@ -28,6 +28,9 @@ public:
|
||||
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();
|
||||
|
@ -92,6 +92,18 @@ int EspPlatform::readBytesMultiCast(uint8_t * buffer, uint16_t maxLen)
|
||||
return len;
|
||||
}
|
||||
|
||||
bool EspPlatform::sendBytesUniCast(uint32_t addr, uint16_t port, uint8_t* buffer, uint16_t len)
|
||||
{
|
||||
IPAddress ucastaddr(htonl(addr));
|
||||
println("sendBytesUniCast endPacket fail");
|
||||
if(_udp.beginPacket(ucastaddr, port) == 1) {
|
||||
_udp.write(buffer, len);
|
||||
if(_udp.endPacket() == 0) println("sendBytesUniCast endPacket fail");
|
||||
}
|
||||
else println("sendBytesUniCast beginPacket fail");
|
||||
return true;
|
||||
}
|
||||
|
||||
uint8_t * EspPlatform::getEepromBuffer(uint16_t size)
|
||||
{
|
||||
EEPROM.begin(size);
|
||||
|
@ -28,6 +28,9 @@ class EspPlatform : public ArduinoPlatform
|
||||
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();
|
||||
|
Loading…
Reference in New Issue
Block a user