Skip to content
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

Add flash_mac_address option #89

Merged
merged 1 commit into from
Jun 17, 2024
Merged
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
18 changes: 18 additions & 0 deletions boards_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,22 @@ class UsbConfig(BaseModel):
network: NetworkConfig = NetworkConfig()
usb: UsbConfig = UsbConfig()

class MacAddressGeneratingMethod(str, Enum):
last_serial_number_digits = "last_serial_number_digits"

class FlashMacAddressConfig(BaseModel):
generating_method: MacAddressGeneratingMethod
""" Method used to generate the MAC address. """

prefix: str
""" MAC address prefix to be used for all generated MAC addresses. """

prefix_bits: int
""" Number of bits to be used from the prefix. """

serial_number_digits: Optional[int]
""" Number of digits to be used from the serial number. """

class Options(BaseModel):
bootloader: BootloaderType
bootloader_config: Optional[BootloaderConfig] = None
Expand Down Expand Up @@ -165,6 +181,8 @@ class Options(BaseModel):
cameras: List[BasicCameraInfo] = []
"""List of cameras on board. (If specified this camera config is preferred over board_options for testing)"""

flash_mac_address: Optional[FlashMacAddressConfig] = None
""" Configuration for generating MAC addresses during flashing. """

class EepromData(BaseModel):
boardConf: Optional[str] = None
Expand Down
Loading