Add MacAddress string constructor (#9400)
* Add MacAddress string constructor * Change implementation
This commit is contained in:
parent
29ede4826c
commit
f9bb62a91f
2 changed files with 5 additions and 0 deletions
|
|
@ -28,6 +28,10 @@ MacAddress::MacAddress(const char *macstr){
|
||||||
fromString(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) {
|
MacAddress::MacAddress(uint8_t b1, uint8_t b2, uint8_t b3, uint8_t b4, uint8_t b5, uint8_t b6) {
|
||||||
_type = MAC6;
|
_type = MAC6;
|
||||||
memset(_mac.bytes, 0, sizeof(_mac.bytes));
|
memset(_mac.bytes, 0, sizeof(_mac.bytes));
|
||||||
|
|
|
||||||
|
|
@ -54,6 +54,7 @@ public:
|
||||||
MacAddress(const uint8_t *macbytearray) : MacAddress(MAC6, macbytearray) {}
|
MacAddress(const uint8_t *macbytearray) : MacAddress(MAC6, macbytearray) {}
|
||||||
|
|
||||||
MacAddress(const char *macstr);
|
MacAddress(const char *macstr);
|
||||||
|
MacAddress(const String &macstr);
|
||||||
|
|
||||||
virtual ~MacAddress() {}
|
virtual ~MacAddress() {}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue