Clarified mac address code so that it will be clearer what it contains (static device mac).

This commit is contained in:
Ole Odendahl 2022-10-23 18:51:56 +02:00
parent 100f4046fa
commit e45bb43b84
No known key found for this signature in database
GPG key ID: E31DACC635D3BE01
2 changed files with 8 additions and 3 deletions

View file

@ -38,5 +38,5 @@ with ConnectHelper.session_with_chosen_probe() as session:
target.resume()
mac_converter = MacAddressReader(target)
mac_address = mac_converter.get_mac_address()
print(f'Device MAC Address: {mac_address}')
mac_address = mac_converter.get_static_mac_address()
print(f'Static manufacturer MAC address: {mac_address}')

View file

@ -8,7 +8,12 @@ class MacAddressReader():
def __init__(self, target: Target) -> None:
self.target = target
def get_mac_address(self) -> str:
def get_static_mac_address(self) -> str:
'''
Reads the static mac address assigned by the manufacturer.
This chip property is readonly and may be different from the mac address in the application code.
'''
memory_blocks = self._get_blocks()
return self._convert_blocks(memory_blocks)