diff --git a/cores/esp32/MacAddress.cpp b/cores/esp32/MacAddress.cpp index 991fdd5e178..e1a23f5822f 100644 --- a/cores/esp32/MacAddress.cpp +++ b/cores/esp32/MacAddress.cpp @@ -28,6 +28,10 @@ MacAddress::MacAddress(const char *macstr){ fromString(macstr); } +MacAddress::MacAddress(const String &macstr){ + fromString(macstr.c_str()); +} + MacAddress::MacAddress(uint8_t b1, uint8_t b2, uint8_t b3, uint8_t b4, uint8_t b5, uint8_t b6) { _type = MAC6; memset(_mac.bytes, 0, sizeof(_mac.bytes)); diff --git a/cores/esp32/MacAddress.h b/cores/esp32/MacAddress.h index 83ce362a495..1463bc487c5 100644 --- a/cores/esp32/MacAddress.h +++ b/cores/esp32/MacAddress.h @@ -54,6 +54,7 @@ class MacAddress : public Printable { MacAddress(const uint8_t *macbytearray) : MacAddress(MAC6, macbytearray) {} MacAddress(const char *macstr); + MacAddress(const String &macstr); virtual ~MacAddress() {}