rename sendBytes ->sendBytesMultiCast

readBytes -> readBytesMultiCast
This commit is contained in:
Thomas Kunze 2019-12-10 22:29:14 +01:00
parent d6db6a9673
commit cd0fdc85b6
9 changed files with 18 additions and 18 deletions

View File

@ -55,7 +55,7 @@ void Esp32Platform::closeMultiCast()
_udp.stop();
}
bool Esp32Platform::sendBytes(uint8_t * buffer, uint16_t len)
bool Esp32Platform::sendBytesMultiCast(uint8_t * buffer, uint16_t len)
{
//printHex("<- ",buffer, len);
int result = 0;
@ -65,7 +65,7 @@ bool Esp32Platform::sendBytes(uint8_t * buffer, uint16_t len)
return true;
}
int Esp32Platform::readBytes(uint8_t * buffer, uint16_t maxLen)
int Esp32Platform::readBytesMultiCast(uint8_t * buffer, uint16_t maxLen)
{
int len = _udp.parsePacket();
if (len == 0)

View File

@ -24,8 +24,8 @@ public:
//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;
bool sendBytesMultiCast(uint8_t* buffer, uint16_t len) override;
int readBytesMultiCast(uint8_t* buffer, uint16_t maxLen) override;
//memory
uint8_t* getEepromBuffer(uint16_t size);

View File

@ -58,7 +58,7 @@ void EspPlatform::closeMultiCast()
_udp.stop();
}
bool EspPlatform::sendBytes(uint8_t * buffer, uint16_t len)
bool EspPlatform::sendBytesMultiCast(uint8_t * buffer, uint16_t len)
{
//printHex("<- ",buffer, len);
int result = 0;
@ -68,7 +68,7 @@ bool EspPlatform::sendBytes(uint8_t * buffer, uint16_t len)
return true;
}
int EspPlatform::readBytes(uint8_t * buffer, uint16_t maxLen)
int EspPlatform::readBytesMultiCast(uint8_t * buffer, uint16_t maxLen)
{
int len = _udp.parsePacket();
if (len == 0)

View File

@ -25,8 +25,8 @@ class EspPlatform : public ArduinoPlatform
//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;
bool sendBytesMultiCast(uint8_t* buffer, uint16_t len) override;
int readBytesMultiCast(uint8_t* buffer, uint16_t maxLen) override;
//memory
uint8_t* getEepromBuffer(uint16_t size);

View File

@ -47,7 +47,7 @@ void IpDataLinkLayer::loop()
return;
uint8_t buffer[512];
int len = _platform.readBytes(buffer, 512);
int len = _platform.readBytesMultiCast(buffer, 512);
if (len <= 0)
return;
@ -101,5 +101,5 @@ bool IpDataLinkLayer::sendBytes(uint8_t* bytes, uint16_t length)
if (!_enabled)
return false;
return _platform.sendBytes(bytes, length);
return _platform.sendBytesMultiCast(bytes, length);
}

View File

@ -78,12 +78,12 @@ void Platform::setupMultiCast(uint32_t addr, uint16_t port)
void Platform::closeMultiCast()
{}
bool Platform::sendBytes(uint8_t *buffer, uint16_t len)
bool Platform::sendBytesMultiCast(uint8_t *buffer, uint16_t len)
{
return false;
}
int Platform::readBytes(uint8_t *buffer, uint16_t maxLen)
int Platform::readBytesMultiCast(uint8_t *buffer, uint16_t maxLen)
{
return 0;
}

View File

@ -27,8 +27,8 @@ class Platform
//multicast socket
virtual void setupMultiCast(uint32_t addr, uint16_t port);
virtual void closeMultiCast();
virtual bool sendBytes(uint8_t* buffer, uint16_t len);
virtual int readBytes(uint8_t* buffer, uint16_t maxLen);
virtual bool sendBytesMultiCast(uint8_t* buffer, uint16_t len);
virtual int readBytesMultiCast(uint8_t* buffer, uint16_t maxLen);
//UART
virtual void setupUart();

View File

@ -145,7 +145,7 @@ void LinuxPlatform::closeMultiCast()
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 };
address.sin_family = AF_INET;
@ -166,7 +166,7 @@ bool LinuxPlatform::sendBytes(uint8_t* buffer, uint16_t len)
return true;
}
int LinuxPlatform::readBytes(uint8_t * buffer, uint16_t maxLen)
int LinuxPlatform::readBytesMultiCast(uint8_t * buffer, uint16_t maxLen)
{
uint32_t sin_len;
struct sockaddr_in sin;

View File

@ -29,8 +29,8 @@ public:
//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;
bool sendBytesMultiCast(uint8_t* buffer, uint16_t len) override;
int readBytesMultiCast(uint8_t* buffer, uint16_t maxLen) override;
//spi
void setupSpi() override;