pyrtma.core_defs.MDF_MODULE_READY

class MDF_MODULE_READY[source]

Bases: MessageData

Methods

copy

Generate a copy of a message structure

from_dict

Generate message instance from dictionary

from_json

Generate message instance from JSON string

from_random

Generate message instance with random values

get_field_raw

return copy of raw bytes for ctypes field

hexdump

hexdump of message

pretty_print

Generate formatted message structure string for pretty printing

to_dict

Convert message to dictionary

to_json

Convert message to json string

Attributes

pid

Validator for 32-bit integers

size

type_def

type_hash

type_id

type_name

type_size

type_source

classmethod copy(m)

Generate a copy of a message structure

Parameters:

m (TypeVar(MB, bound= MessageBase)) – Message structure to copy

Return type:

TypeVar(MB, bound= MessageBase)

classmethod from_dict(data)

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_json(s)

Generate message instance from JSON string

Parameters:

s (str) – Message JSON string

Return type:

TypeVar(MB, bound= MessageBase)

classmethod from_random()

Generate message instance with random values

Return type:

TypeVar(MB, bound= MessageBase)

get_field_raw(name)

return copy of raw bytes for ctypes field

Parameters:

name (str) – Message fieldname

Raises:

KeyError – Invalid fieldname

Returns:

Copy of message field data bytes

Return type:

bytes

hexdump(length=16, sep=' ')

hexdump of message

Parameters:
  • length (int, optional) – Row length. Defaults to 16.

  • sep (str, optional) – Separator for non-printable ascii chars. Defaults to ” “.

pretty_print(add_tabs=0)

Generate formatted message structure string for pretty printing

Parameters:

add_tabs (int, optional) – Indentation level, used for recursively calling. Defaults to 0.

Returns:

Formatted string

Return type:

str

to_dict()

Convert message to dictionary

Returns:

Message dictionary

Return type:

Dict[str, Any]

to_json(minify=False, **kwargs)

Convert message to json string

Parameters:
  • minify (bool, optional) – Flag to minify (compact format). Defaults to False.

  • json.dumps (kwargs for) –

Returns:

json string

Return type:

str