mirror of
https://github.com/thelsing/knx.git
synced 2024-12-18 19:08:18 +01:00
rename sendBytes ->sendBytesMultiCast
readBytes -> readBytesMultiCast
This commit is contained in:
parent
d6db6a9673
commit
cd0fdc85b6
@ -55,7 +55,7 @@ void Esp32Platform::closeMultiCast()
|
|||||||
_udp.stop();
|
_udp.stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Esp32Platform::sendBytes(uint8_t * buffer, uint16_t len)
|
bool Esp32Platform::sendBytesMultiCast(uint8_t * buffer, uint16_t len)
|
||||||
{
|
{
|
||||||
//printHex("<- ",buffer, len);
|
//printHex("<- ",buffer, len);
|
||||||
int result = 0;
|
int result = 0;
|
||||||
@ -65,7 +65,7 @@ bool Esp32Platform::sendBytes(uint8_t * buffer, uint16_t len)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
int Esp32Platform::readBytes(uint8_t * buffer, uint16_t maxLen)
|
int Esp32Platform::readBytesMultiCast(uint8_t * buffer, uint16_t maxLen)
|
||||||
{
|
{
|
||||||
int len = _udp.parsePacket();
|
int len = _udp.parsePacket();
|
||||||
if (len == 0)
|
if (len == 0)
|
||||||
|
@ -24,8 +24,8 @@ public:
|
|||||||
//multicast
|
//multicast
|
||||||
void setupMultiCast(uint32_t addr, uint16_t port) override;
|
void setupMultiCast(uint32_t addr, uint16_t port) override;
|
||||||
void closeMultiCast() override;
|
void closeMultiCast() override;
|
||||||
bool sendBytes(uint8_t* buffer, uint16_t len) override;
|
bool sendBytesMultiCast(uint8_t* buffer, uint16_t len) override;
|
||||||
int readBytes(uint8_t* buffer, uint16_t maxLen) override;
|
int readBytesMultiCast(uint8_t* buffer, uint16_t maxLen) override;
|
||||||
|
|
||||||
//memory
|
//memory
|
||||||
uint8_t* getEepromBuffer(uint16_t size);
|
uint8_t* getEepromBuffer(uint16_t size);
|
||||||
|
@ -58,7 +58,7 @@ void EspPlatform::closeMultiCast()
|
|||||||
_udp.stop();
|
_udp.stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EspPlatform::sendBytes(uint8_t * buffer, uint16_t len)
|
bool EspPlatform::sendBytesMultiCast(uint8_t * buffer, uint16_t len)
|
||||||
{
|
{
|
||||||
//printHex("<- ",buffer, len);
|
//printHex("<- ",buffer, len);
|
||||||
int result = 0;
|
int result = 0;
|
||||||
@ -68,7 +68,7 @@ bool EspPlatform::sendBytes(uint8_t * buffer, uint16_t len)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
int EspPlatform::readBytes(uint8_t * buffer, uint16_t maxLen)
|
int EspPlatform::readBytesMultiCast(uint8_t * buffer, uint16_t maxLen)
|
||||||
{
|
{
|
||||||
int len = _udp.parsePacket();
|
int len = _udp.parsePacket();
|
||||||
if (len == 0)
|
if (len == 0)
|
||||||
|
@ -25,8 +25,8 @@ class EspPlatform : public ArduinoPlatform
|
|||||||
//multicast
|
//multicast
|
||||||
void setupMultiCast(uint32_t addr, uint16_t port) override;
|
void setupMultiCast(uint32_t addr, uint16_t port) override;
|
||||||
void closeMultiCast() override;
|
void closeMultiCast() override;
|
||||||
bool sendBytes(uint8_t* buffer, uint16_t len) override;
|
bool sendBytesMultiCast(uint8_t* buffer, uint16_t len) override;
|
||||||
int readBytes(uint8_t* buffer, uint16_t maxLen) override;
|
int readBytesMultiCast(uint8_t* buffer, uint16_t maxLen) override;
|
||||||
|
|
||||||
//memory
|
//memory
|
||||||
uint8_t* getEepromBuffer(uint16_t size);
|
uint8_t* getEepromBuffer(uint16_t size);
|
||||||
|
@ -47,7 +47,7 @@ void IpDataLinkLayer::loop()
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
uint8_t buffer[512];
|
uint8_t buffer[512];
|
||||||
int len = _platform.readBytes(buffer, 512);
|
int len = _platform.readBytesMultiCast(buffer, 512);
|
||||||
if (len <= 0)
|
if (len <= 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -101,5 +101,5 @@ bool IpDataLinkLayer::sendBytes(uint8_t* bytes, uint16_t length)
|
|||||||
if (!_enabled)
|
if (!_enabled)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return _platform.sendBytes(bytes, length);
|
return _platform.sendBytesMultiCast(bytes, length);
|
||||||
}
|
}
|
||||||
|
@ -78,12 +78,12 @@ void Platform::setupMultiCast(uint32_t addr, uint16_t port)
|
|||||||
void Platform::closeMultiCast()
|
void Platform::closeMultiCast()
|
||||||
{}
|
{}
|
||||||
|
|
||||||
bool Platform::sendBytes(uint8_t *buffer, uint16_t len)
|
bool Platform::sendBytesMultiCast(uint8_t *buffer, uint16_t len)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
int Platform::readBytes(uint8_t *buffer, uint16_t maxLen)
|
int Platform::readBytesMultiCast(uint8_t *buffer, uint16_t maxLen)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
@ -27,8 +27,8 @@ class Platform
|
|||||||
//multicast socket
|
//multicast socket
|
||||||
virtual void setupMultiCast(uint32_t addr, uint16_t port);
|
virtual void setupMultiCast(uint32_t addr, uint16_t port);
|
||||||
virtual void closeMultiCast();
|
virtual void closeMultiCast();
|
||||||
virtual bool sendBytes(uint8_t* buffer, uint16_t len);
|
virtual bool sendBytesMultiCast(uint8_t* buffer, uint16_t len);
|
||||||
virtual int readBytes(uint8_t* buffer, uint16_t maxLen);
|
virtual int readBytesMultiCast(uint8_t* buffer, uint16_t maxLen);
|
||||||
|
|
||||||
//UART
|
//UART
|
||||||
virtual void setupUart();
|
virtual void setupUart();
|
||||||
|
@ -145,7 +145,7 @@ void LinuxPlatform::closeMultiCast()
|
|||||||
close(_socketFd);
|
close(_socketFd);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool LinuxPlatform::sendBytes(uint8_t* buffer, uint16_t len)
|
bool LinuxPlatform::sendBytesMultiCast(uint8_t* buffer, uint16_t len)
|
||||||
{
|
{
|
||||||
struct sockaddr_in address = { 0 };
|
struct sockaddr_in address = { 0 };
|
||||||
address.sin_family = AF_INET;
|
address.sin_family = AF_INET;
|
||||||
@ -166,7 +166,7 @@ bool LinuxPlatform::sendBytes(uint8_t* buffer, uint16_t len)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
int LinuxPlatform::readBytes(uint8_t * buffer, uint16_t maxLen)
|
int LinuxPlatform::readBytesMultiCast(uint8_t * buffer, uint16_t maxLen)
|
||||||
{
|
{
|
||||||
uint32_t sin_len;
|
uint32_t sin_len;
|
||||||
struct sockaddr_in sin;
|
struct sockaddr_in sin;
|
||||||
|
@ -29,8 +29,8 @@ public:
|
|||||||
//multicast
|
//multicast
|
||||||
void setupMultiCast(uint32_t addr, uint16_t port) override;
|
void setupMultiCast(uint32_t addr, uint16_t port) override;
|
||||||
void closeMultiCast() override;
|
void closeMultiCast() override;
|
||||||
bool sendBytes(uint8_t* buffer, uint16_t len) override;
|
bool sendBytesMultiCast(uint8_t* buffer, uint16_t len) override;
|
||||||
int readBytes(uint8_t* buffer, uint16_t maxLen) override;
|
int readBytesMultiCast(uint8_t* buffer, uint16_t maxLen) override;
|
||||||
|
|
||||||
//spi
|
//spi
|
||||||
void setupSpi() override;
|
void setupSpi() override;
|
||||||
|
Loading…
Reference in New Issue
Block a user