Suggested API
CANBus(bus: str)
Constructor
sendMessage(self, msg: CanMessage) -> None
Sends a CAN message
getReceivedMessages(self, message_name: str) -> list[CanMessage]
Returns a list of received CAN messages of the specified type, then clears the list
Utility API (note that all functions are static)
loggedMessages = dict[str, dict[str, list[CanMessage]]]
ser = Serial()
readMessages() -> NoReturn
Will run infinitely in a thread, reading in messages and putting them in the global dictionary loggedMessages, will be started by the test runner, will first create the serial object (ser)
Clear() -> None
Clears loggedMessages, will be run at the start of each test by the test runner
Implementation Notes
- make sure to lock
loggedMessages
- in the UART message format, use a few of the upper bits in the length byte to specify which CAN bus
Suggested API
CANBus(bus: str)Constructor
sendMessage(self, msg: CanMessage) -> NoneSends a CAN message
getReceivedMessages(self, message_name: str) -> list[CanMessage]Returns a list of received CAN messages of the specified type, then clears the list
Utility API (note that all functions are static)
loggedMessages = dict[str, dict[str, list[CanMessage]]]ser = Serial()readMessages() -> NoReturnWill run infinitely in a thread, reading in messages and putting them in the global dictionary loggedMessages, will be started by the test runner, will first create the serial object (ser)
Clear() -> NoneClears loggedMessages, will be run at the start of each test by the test runner
Implementation Notes
loggedMessages