Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
minor formatting adjustment for consitency reasons
  • Loading branch information
mdabrowski1990 committed Oct 19, 2023
1 parent 73f8787 commit 241aa35
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 16 deletions.
3 changes: 1 addition & 2 deletions uds/can/addressing_information.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,7 @@ def validate_packet_ai(cls,
can_id=can_id,
target_address=target_address,
source_address=source_address,
address_extension=address_extension
)
address_extension=address_extension)

@classmethod
def validate_ai_data_bytes(cls, addressing_format: CanAddressingFormatAlias, ai_data_bytes: RawBytes) -> None:
Expand Down
3 changes: 1 addition & 2 deletions uds/can/extended_addressing_information.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,4 @@ def validate_packet_ai(cls,
can_id=can_id, # type: ignore
target_address=target_address,
source_address=source_address,
address_extension=address_extension
)
address_extension=address_extension)
9 changes: 3 additions & 6 deletions uds/can/mixed_addressing_information.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,7 @@ def validate_packet_ai(cls,
can_id=can_id, # type: ignore
target_address=target_address,
source_address=source_address,
address_extension=address_extension
)
address_extension=address_extension)


class Mixed29BitCanAddressingInformation(AbstractCanAddressingInformation):
Expand Down Expand Up @@ -116,8 +115,7 @@ def validate_packet_ai(cls,
can_id=encoded_can_id,
target_address=target_address,
source_address=source_address,
address_extension=address_extension
)
address_extension=address_extension)
decoded_info = CanIdHandler.decode_mixed_addressed_29bit_can_id(can_id)
if addressing_type != decoded_info[CanIdHandler.ADDRESSING_TYPE_NAME]: # type: ignore
raise InconsistentArgumentsError(f"Provided value of CAN ID is not compatible with Addressing Type."
Expand All @@ -134,5 +132,4 @@ def validate_packet_ai(cls,
can_id=can_id,
target_address=decoded_info[CanIdHandler.TARGET_ADDRESS_NAME], # type: ignore
source_address=decoded_info[CanIdHandler.SOURCE_ADDRESS_NAME], # type: ignore
address_extension=address_extension
)
address_extension=address_extension)
9 changes: 3 additions & 6 deletions uds/can/normal_addressing_information.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,7 @@ def validate_packet_ai(cls,
can_id=can_id, # type: ignore
target_address=target_address,
source_address=source_address,
address_extension=address_extension
)
address_extension=address_extension)


class NormalFixedCanAddressingInformation(AbstractCanAddressingInformation):
Expand Down Expand Up @@ -118,8 +117,7 @@ def validate_packet_ai(cls,
can_id=encoded_can_id,
target_address=target_address,
source_address=source_address,
address_extension=address_extension
)
address_extension=address_extension)
decoded_info = CanIdHandler.decode_normal_fixed_addressed_can_id(can_id)
if addressing_type != decoded_info[CanIdHandler.ADDRESSING_TYPE_NAME]: # type: ignore
raise InconsistentArgumentsError(f"Provided value of CAN ID is not compatible with Addressing Type."
Expand All @@ -136,5 +134,4 @@ def validate_packet_ai(cls,
can_id=can_id,
target_address=decoded_info[CanIdHandler.TARGET_ADDRESS_NAME], # type: ignore
source_address=decoded_info[CanIdHandler.SOURCE_ADDRESS_NAME], # type: ignore
address_extension=address_extension
)
address_extension=address_extension)

0 comments on commit 241aa35

Please sign in to comment.