Skip to content

Commit

Permalink
NotImplementedError implemented when subtype is None
Browse files Browse the repository at this point in the history
  • Loading branch information
Juan-789 committed Mar 26, 2024
1 parent 0f159d7 commit 08a87a7
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions modules/telemetry/v1/data_block.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,18 +105,8 @@ def parse(block_subtype: DataBlockSubtype, payload: bytes) -> DataBlock:

subtype = SUBTYPE_CLASSES.get(block_subtype)

NONIMPLEMENTED_SUBTYPE_CLASSES: list[DataBlockSubtype] = [
DataBlockSubtype.ACCELERATION,
DataBlockSubtype.ANGULAR_VELOCITY,
DataBlockSubtype.GNSS_LOCATION,
DataBlockSubtype.GNSS_METADATA,
DataBlockSubtype.RESERVED
]

if block_subtype in NONIMPLEMENTED_SUBTYPE_CLASSES:
if subtype is None:
raise NotImplementedError
elif subtype is None:
raise DataBlockUnknownException(f"Unknown data block subtype: {block_subtype} {payload} {payload.hex()}")

return subtype.from_bytes(payload=payload)

Expand Down

0 comments on commit 08a87a7

Please sign in to comment.