Skip to content

Commit f9bb62a

Browse files
authored
Add MacAddress string constructor (#9400)
* Add MacAddress string constructor * Change implementation
1 parent 29ede48 commit f9bb62a

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

Diff for: cores/esp32/MacAddress.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ MacAddress::MacAddress(const char *macstr){
2828
fromString(macstr);
2929
}
3030

31+
MacAddress::MacAddress(const String &macstr){
32+
fromString(macstr.c_str());
33+
}
34+
3135
MacAddress::MacAddress(uint8_t b1, uint8_t b2, uint8_t b3, uint8_t b4, uint8_t b5, uint8_t b6) {
3236
_type = MAC6;
3337
memset(_mac.bytes, 0, sizeof(_mac.bytes));

Diff for: cores/esp32/MacAddress.h

+1
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ class MacAddress : public Printable {
5454
MacAddress(const uint8_t *macbytearray) : MacAddress(MAC6, macbytearray) {}
5555

5656
MacAddress(const char *macstr);
57+
MacAddress(const String &macstr);
5758

5859
virtual ~MacAddress() {}
5960

0 commit comments

Comments
 (0)