Can Exceptions¶
- 
Exceptions.CanCheck.check_binary_can_data(binary_data)[source]¶
- Description
- Can data are expected as binary string of length 64 bits. 
- Parameters
- binary_data (str) – Binary data. 
- Raises
- TypeError – Binary data are not a str. 
- ValueError – Binary data do not have size of 64 bits. 
 
 
- 
Exceptions.CanCheck.check_can_id(can_id)[source]¶
- Description
- Can id is expected to be HEX string of max len 8. 
- Parameters
- can_id (str) – Can id in hex format. 
- Raises
- TypeError – Can_id is not a hex string. 
- ValueError – Can_id is hex string longer then 8. 
 
 
- 
Exceptions.CanCheck.check_endian(endian)[source]¶
- Description
- Endian is expected as “L” or “B” of type str. 
- Parameters
- endian (str) – Little or Big endian. 
- Raises
- TypeError – Endian is not a str. 
- ValueError – Endian is not a “L” or “B”. 
 
 
- 
Exceptions.CanCheck.check_group_id(group_id)[source]¶
- Description
- Group id is expected to by of type int. 
- Parameters
- group_id (int) – Group ID in UI. 
- Raises
- TypeError – Group id is not an integer. 
- ValueError – Group id is not in range 0 - 20. 
 
 
- 
Exceptions.CanCheck.check_length(length)[source]¶
- Description
- Length is expected to by of type int in range of 1 - 63. 
- Parameters
- length (int) – Data length in can msg. 
- Raises
- TypeError – Length bit is not an integer. 
- ValueError – Length is not in range 1 - 63. 
 
 
- 
Exceptions.CanCheck.check_multiplier(multiplier)[source]¶
- Description
- Multiplier is expected to by of type float or int. - Cannot be equal to 0. 
- Parameters
- Raises
- TypeError – Multiplier is not an integer or float. 
- ValueError – Multiplier is equal to 0. 
 
 
- 
Exceptions.CanCheck.check_raw_data(raw_data)[source]¶
- Description
- Raw data are expected to be of type byte array of length 12. 
- Parameters
- raw_data (bytearray) – Raw data (received from external device). 
- Raises
- TypeError – Raw data are not a byte array. 
- ValueError – Raw data are not 12 bytes long. 
 
 
- 
Exceptions.CanCheck.check_start_bit(start_bit)[source]¶
- Description
- Start bit is expected to be of type int in range of 0 - 63. 
- Parameters
- start_bit (int) – Data start bit in can msg. 
- Raises
- TypeError – Start bit is not an integer. 
- ValueError – Start bit is not in range 0 - 63. 
 
 
- 
Exceptions.CanCheck.check_widget_id(widget_id)[source]¶
- Description
- Widget id is expected to by of type int. 
- Parameters
- widget_id (int) – Widget id in display group of UI. 
- Raises
- TypeError – Widget id is not an integer. 
- ValueError – Widget id is not in range 1 - 50.