pyrcareworld.side_channel package#
Submodules#
pyrcareworld.side_channel.incoming_message module#
- class pyrcareworld.side_channel.incoming_message.IncomingMessage(buffer: bytes, offset: int = 0)[source]#
Bases:
objectUtility class for reading the message written to a SideChannel. Values must be read in the order they were written.
- read_bool(default_value: bool = False) bool[source]#
Read a boolean value from the message buffer. :param default_value: Default value to use if the end of the message is reached. :return: The value read from the message, or the default value if the end was reached.
- read_float32(default_value: float = 0.0) float[source]#
Read a float value from the message buffer. :param default_value: Default value to use if the end of the message is reached. :return: The value read from the message, or the default value if the end was reached.
- read_float32_list(default_value: List[float] = None) List[float][source]#
Read a list of float values from the message buffer. :param default_value: Default value to use if the end of the message is reached. :return: The value read from the message, or the default value if the end was reached.
pyrcareworld.side_channel.outgoing_message module#
- class pyrcareworld.side_channel.outgoing_message.OutgoingMessage[source]#
Bases:
objectUtility class for forming the message that is written to a SideChannel. All data is written in little-endian format using the struct module.
- write_float32(f: float) None[source]#
Append a float value. It will be truncated to 32-bit precision.