Skip to content

Commit e66818c

Browse files
committed
py: remove BitBoxBase functionality
1 parent 0c3cd91 commit e66818c

File tree

12 files changed

+27
-1350
lines changed

12 files changed

+27
-1350
lines changed

py/bitbox02/bitbox02/bitboxbase/__init__.py

Lines changed: 0 additions & 19 deletions
This file was deleted.

py/bitbox02/bitbox02/bitboxbase/bitboxbase.py

Lines changed: 0 additions & 91 deletions
This file was deleted.

py/bitbox02/bitbox02/bitboxbase/py.typed

Whitespace-only changes.

py/bitbox02/bitbox02/communication/bitbox_api_protocol.py

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,6 @@ class Platform(enum.Enum):
168168
""" Available hardware platforms """
169169

170170
BITBOX02 = "bitbox02"
171-
BITBOXBASE = "bitboxbase"
172171

173172

174173
class BitBox02Edition(enum.Enum):
@@ -178,12 +177,6 @@ class BitBox02Edition(enum.Enum):
178177
BTCONLY = "btconly"
179178

180179

181-
class BitBoxBaseEdition(enum.Enum):
182-
""" Editions for the BitBoxBase platform """
183-
184-
STANDARD = "standard"
185-
186-
187180
class Bitbox02Exception(Exception):
188181
def __init__(self, code: int, message: str):
189182
self.code = code
@@ -549,7 +542,7 @@ def __init__(
549542
self.version.major, self.version.minor, self.version.patch, build=self.version.build
550543
)
551544

552-
# raises exceptions if the library is out of date, does not check BitBoxBase
545+
# raises exceptions if the library is out of date
553546
self._check_max_version()
554547

555548
self._bitbox_protocol: BitBoxProtocol
@@ -668,13 +661,11 @@ def reboot(
668661
return True
669662

670663
@staticmethod
671-
def get_info(
672-
transport: TransportLayer
673-
) -> Tuple[str, Platform, Union[BitBox02Edition, BitBoxBaseEdition], bool]:
664+
def get_info(transport: TransportLayer) -> Tuple[str, Platform, Union[BitBox02Edition], bool]:
674665
"""
675666
Returns (version, platform, edition, unlocked).
676667
This is useful to get the version of the firmware when a usb descriptor is not available
677-
(BitBoxBase, via BitBoxBridge, etc.).
668+
(via BitBoxBridge, etc.).
678669
This call does not use a versioned BitBoxProtocol for communication, as the version is not
679670
available (this call is used to get the version), so it must work for all firmware versions.
680671
"""
@@ -688,11 +679,11 @@ def get_info(
688679
platform = {0x00: Platform.BITBOX02}[platform_byte]
689680

690681
edition_byte, response = response[0], response[1:]
691-
edition: Union[BitBox02Edition, BitBoxBaseEdition]
682+
edition: Union[BitBox02Edition]
692683
if platform == Platform.BITBOX02:
693684
edition = {0x00: BitBox02Edition.MULTI, 0x01: BitBox02Edition.BTCONLY}[edition_byte]
694685
else:
695-
edition = {0x00: BitBoxBaseEdition.STANDARD}[edition_byte]
686+
raise Exception("Unknown platform: {}".format(platform))
696687

697688
unlocked_byte = response[0]
698689
unlocked = {0x00: False, 0x01: True}[unlocked_byte]
@@ -701,7 +692,7 @@ def get_info(
701692
def check_min_version(self) -> None:
702693
"""
703694
Raises FirmwareVersionOutdatedException if the device has an older firmware version than
704-
required and the minimum required version. A check for the BitBoxBase is not implemented.
695+
required and the minimum required version.
705696
"""
706697
if self.edition == BitBox02Edition.MULTI:
707698
if self.version < MIN_SUPPORTED_BITBOX02_MULTI_FIRMWARE_VERSION:
@@ -721,7 +712,6 @@ def _check_max_version(self) -> None:
721712
"""
722713
Raises LibraryVersionOutdatedException if the device has an firmware which is too new
723714
(major version increased).
724-
A check for the BitBoxBase is not implemented.
725715
"""
726716
if self.edition == BitBox02Edition.MULTI:
727717
if self.version >= MIN_UNSUPPORTED_BITBOX02_MULTI_FIRMWARE_VERSION:

0 commit comments

Comments
 (0)