Skip to content

Add MacAddress string constructor #9400

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions cores/esp32/MacAddress.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
1 change: 1 addition & 0 deletions cores/esp32/MacAddress.h
Original file line number Diff line number Diff line change
Expand Up @@ -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() {}

Expand Down