added overload to platform constructors for custom HardwareSerial-object

This commit is contained in:
metaneutrons 2019-08-31 09:58:45 +02:00
parent 5a93bbc91c
commit 4101e15a91
6 changed files with 15 additions and 1 deletions

View File

@ -6,11 +6,14 @@
#include "knx/bits.h"
Esp32Platform::Esp32Platform() : ArduinoPlatform(Serial)
{
}
Esp32Platform::Esp32Platform( HardwareSerial& s) : ArduinoPlatform(s)
{
}
uint32_t Esp32Platform::currentIpAddress()
{
return WiFi.localIP();

View File

@ -11,6 +11,7 @@ class Esp32Platform : public ArduinoPlatform
using ArduinoPlatform::_mulitcastPort;
public:
Esp32Platform();
Esp32Platform( HardwareSerial& s);
// ip stuff
uint32_t currentIpAddress() override;

View File

@ -11,6 +11,10 @@ EspPlatform::EspPlatform() : ArduinoPlatform(Serial)
{
}
EspPlatform::EspPlatform( HardwareSerial& s) : ArduinoPlatform(s)
{
}
uint32_t EspPlatform::currentIpAddress()
{
return WiFi.localIP();

View File

@ -12,6 +12,7 @@ class EspPlatform : public ArduinoPlatform
public:
EspPlatform();
EspPlatform( HardwareSerial& s);
// ip stuff
uint32_t currentIpAddress() override;

View File

@ -10,6 +10,10 @@ SamdPlatform::SamdPlatform() : ArduinoPlatform(Serial1)
{
}
SamdPlatform::SamdPlatform( HardwareSerial& s) : ArduinoPlatform(s)
{
}
void SamdPlatform::restart()
{
SerialDBG.println("restart");

View File

@ -10,6 +10,7 @@ class SamdPlatform : public ArduinoPlatform
{
public:
SamdPlatform();
SamdPlatform( HardwareSerial& s);
void restart();
uint8_t* getEepromBuffer(uint16_t size);