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(); _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)

View File

@ -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);

View File

@ -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)

View File

@ -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);

View File

@ -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);
} }

View File

@ -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;
} }

View File

@ -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();

View File

@ -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;

View File

@ -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;