@@ -163,12 +163,8 @@ def md5(self, offset, size):
163
163
def mac_addr (self ):
164
164
"""The MAC address burned into the OTP memory of the ESP chip"""
165
165
mac_addr = [0 ] * 6
166
+ mac0 , mac1 , mac2 , mac3 = self ._efuses
166
167
if self ._chipfamily == ESP8266 :
167
- print ([hex (i ) for i in self ._efuses ])
168
- mac0 = self ._efuses [0 ]
169
- mac1 = self ._efuses [1 ]
170
- mac3 = self ._efuses [3 ]
171
-
172
168
if (mac3 != 0 ):
173
169
oui = ((mac3 >> 16 ) & 0xff , (mac3 >> 8 ) & 0xff , mac3 & 0xff )
174
170
elif ((mac1 >> 16 ) & 0xff ) == 0 :
@@ -185,12 +181,12 @@ def mac_addr(self):
185
181
mac_addr [4 ] = mac1 & 0xff
186
182
mac_addr [5 ] = (mac0 >> 24 ) & 0xff
187
183
if self ._chipfamily == ESP32 :
188
- mac_addr [0 ] = self . _efuses [ 2 ] >> 8 & 0xFF
189
- mac_addr [1 ] = self . _efuses [ 2 ] & 0xFF
190
- mac_addr [2 ] = self . _efuses [ 1 ] >> 24 & 0xFF
191
- mac_addr [3 ] = self . _efuses [ 1 ] >> 16 & 0xFF
192
- mac_addr [4 ] = self . _efuses [ 1 ] >> 8 & 0xFF
193
- mac_addr [5 ] = self . _efuses [ 1 ] & 0xFF
184
+ mac_addr [0 ] = mac2 >> 8 & 0xFF
185
+ mac_addr [1 ] = mac2 & 0xFF
186
+ mac_addr [2 ] = mac1 >> 24 & 0xFF
187
+ mac_addr [3 ] = mac1 >> 16 & 0xFF
188
+ mac_addr [4 ] = mac1 >> 8 & 0xFF
189
+ mac_addr [5 ] = mac1 & 0xFF
194
190
return mac_addr
195
191
196
192
@property
0 commit comments