pyrtma.core_defs.MessageBase
- class MessageBase[source]
Bases:
Structure
MessageBase base class
This class should be treated as if abstract and not instantiated directly.
Methods
Generate a copy of a message structure
Generate message instance from dictionary
Generate message instance from JSON string
Generate message instance with random values
return copy of raw bytes for ctypes field
hexdump of message
Generate formatted message structure string for pretty printing
Convert message to dictionary
Convert message to json string
Attributes
size
- classmethod from_dict(data)[source]
Generate message instance from dictionary
- Parameters:
data (Dict[str, Any]) – Message dictionary
- Raises:
JSONDecodingError – Unable to decode dictionary
- Return type:
TypeVar
(MB
, bound= MessageBase)
- classmethod from_random()[source]
Generate message instance with random values
- Return type:
TypeVar
(MB
, bound= MessageBase)