Skip to content

Commit 72e39b8

Browse files
committed
fix(MAC): Remove comment + reorder lines
1 parent 8abadb1 commit 72e39b8

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

cores/esp32/MacAddress.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,37 +10,37 @@ MacAddress::MacAddress(MACType mac_type){
1010
memset(_mac.bytes, 0, sizeof(_mac.bytes));
1111
}
1212
MacAddress::MacAddress(MACType mac_type, uint64_t mac) {
13-
_mac.val = mac;
1413
_type = mac_type;
14+
_mac.val = mac;
1515
}
1616

1717
MacAddress::MacAddress(MACType mac_type, const uint8_t *macbytearray) {
18-
// 6-bytes MacAddress only
18+
_type = mac_type;
1919
memset(_mac.bytes, 0, sizeof(_mac.bytes));
20-
if(mac_type == MAC6) {
20+
if(_type == MAC6) {
2121
memcpy(_mac.bytes, macbytearray, 6);
2222
} else {
2323
memcpy(_mac.bytes, macbytearray, 8);
2424
}
25-
_type = mac_type;
2625
}
2726

2827
MacAddress::MacAddress(const char *macstr){
2928
fromString(macstr);
3029
}
3130

3231
MacAddress::MacAddress(uint8_t b1, uint8_t b2, uint8_t b3, uint8_t b4, uint8_t b5, uint8_t b6) {
32+
_type = MAC6;
3333
memset(_mac.bytes, 0, sizeof(_mac.bytes));
3434
_mac.bytes[0] = b1;
3535
_mac.bytes[1] = b2;
3636
_mac.bytes[2] = b3;
3737
_mac.bytes[3] = b4;
3838
_mac.bytes[4] = b5;
3939
_mac.bytes[5] = b6;
40-
_type = MAC6;
4140
}
4241

4342
MacAddress::MacAddress(uint8_t b1, uint8_t b2, uint8_t b3, uint8_t b4, uint8_t b5, uint8_t b6, uint8_t b7, uint8_t b8) {
43+
_type = MAC8;
4444
_mac.bytes[0] = b1;
4545
_mac.bytes[1] = b2;
4646
_mac.bytes[2] = b3;
@@ -49,7 +49,6 @@ MacAddress::MacAddress(uint8_t b1, uint8_t b2, uint8_t b3, uint8_t b4, uint8_t b
4949
_mac.bytes[5] = b6;
5050
_mac.bytes[6] = b7;
5151
_mac.bytes[7] = b8;
52-
_type = MAC8;
5352
}
5453

5554
//Parse user entered string into MAC address

0 commit comments

Comments
 (0)