| M | |
| make_default_selector, MessageChannel | |
| make_large_msg, MessageFactory | |
| make_large_msg_mval, MessageFactory | |
| make_msg, MessageFactory | |
| make_msg_mval, MessageFactory | |
| make_mval, MessageFactory | |
| make_val, MessageFactory | |
| MAKE_VAL_ATTR_NAME, MessageFactory | |
| make_val_hex_str, MessageFactory | |
| map_enum | |
| MAX_DATAGRAM_SIZE, InetMessageChannel | |
| MAX_MESSAGE_ADR, MessageHeader | |
| MAX_MESSAGE_ID, MessageHeader | |
| MAX_MESSAGE_LEN | |
| MAX_TYPE_NUM | |
| MEMMON_CTRL, StandardTypes | |
| MEMMON_DATA, StandardTypes | |
| Message | |
| Message Channels | |
| MESSAGE_ID_SIZE, MessageHeader | |
| MESSAGE_LEN_SIZE | |
| MESSAGE_TYP_SIZE, Message | |
| MessageChannel | |
| MessageChannelError | |
| MessageFactory | |
| MessageHeader | |
| Messages and Message Processing | |
| MIN_MESSAGE_SIZE | |
| MIN_TYPE_NUM | |
| msg_factory | |
| msg_id, MessageHeader | |
| msg_to_bytes | |
| msg_to_bytes_mval, InmHelper | |
| msg_to_hex, InmHelper | |
| msg_to_hex_mval, InmHelper | |
| N | |
| N_HEADER_BYTES, SerialMessageChannel | |
| NoConv, ValueConversions | |
| NONE, StandardResults | |
| NOT_IMPLEMENTED, StandardResults | |
| NULL, StandardRegisters | |
| O | |
| OK, StandardResults | |
| OnlyWanted, Strictness | |
| open | |
| P | |
| PAIR_FWID, StandardRegisters | |
| PAIR_INDEX, StandardRegisters | |
| PAIR_STDIO, StandardRegisters | |
| PAIR_STDIOERR, StandardRegisters | |
| peek_next_msg_id, MessageChannel | |
| peek_prev_msg_id, MessageChannel | |
| port, SerialMessageChannel | |
| Properties | |
| PROTOCOL_TYPE_NUM, StandardMessage | |
| R | |
| RC, InmHelper | |
| readable, MessageChannel | |
| recv | |
| recv_channels, RoutingMessageChannel | |
| RECV_FAILURE, ResultCode | |
| recv_print, InmHelper | |
| recv_print_file, InmHelper | |
| recv_return_none, InmHelper | |
| RECV_TIMEOUT, ResultCode | |
| Reg, InmHelper | |
| reg_enum_class, MessageFactory | |
| reg_enum_msg_types, MessageFactory | |
| REG_READ, StandardTypes | |
| REG_READ_RES, StandardTypes | |
| REG_RW_EXCH, StandardTypes | |
| REG_TOGGLE, StandardTypes | |
| REG_WR_EXCH, StandardTypes | |
| REG_WRITE, StandardTypes | |
| REGISTER, StandardResults | |
| REGPAIR_READ, StandardTypes | |
| REGPAIR_READ_RES, StandardTypes | |
| REGPAIR_RW_EXCH, StandardTypes | |
| REGPAIR_TOGGLE, StandardTypes | |
| REGPAIR_WR_EXCH, StandardTypes | |
| REGPAIR_WRITE, StandardTypes | |
| relay_messages, RoutingMessageChannel | |
| remove_cc_adr, RoutingMessageChannel | |
| Res, InmHelper | |
| res_enum_class, MessageFactory | |
| res_enum_msg_types, MessageFactory | |
| RESULT, StandardTypes | |
| ResultCode | |
| route, RoutingMessageChannel | |
| RoutingMessageChannel | |
| rtab, RoutingMessageChannel |
If this is true, a default selector object (from the standard library module selectors) will be created for each instance of MessageChannel that isn’t provided with a custom selector at initialization.
make_default_selector = True
Constructs a large INM Message with the specified type and value.
def make_large_msg( self, typ, val, int_size = None )
Constructs a large INM Message with the specified type and multipart value.
def make_large_msg_mval( self, typ, mval, int_size = None )
Constructs an INM Message with the specified type and value.
def make_msg( self, typ, val, int_size = None )
Constructs an INM Message with the specified type and multipart value.
def make_msg_mval( self, typ, mval, int_size = None )
Creates a bytes object containing a multipart INM message value.
def make_mval( self, mval, int_size = None, tlv_type = None )
Creates a bytes object containing an INM message value.
def make_val( self, val, int_size = None, tlv_type = None )
Name of attribute to use for custom conversion of objects into INM message values/payloads.
MAKE_VAL_ATTR_NAME = 'to_inm_val'
If true, strings will be interpreted as sequences of hexadecimal digits (instead of text) when making message values.
self.make_val_hex_str
Searches an enum class for a member with a specified integer value.
def map_enum( enum_class, i, defval = None )
Maximum size of sent UDP datagrams.
MAX_DATAGRAM_SIZE = 0xffff
Largest valid INM node address.
MAX_MESSAGE_ADR = 0xff
Largest valid INM message identifier.
MAX_MESSAGE_ID = 0xffff
Maximum value of the message length field in a large INM message, and thereby also the maximum size in bytes of a large message value field.
MAX_MESSAGE_LEN = 0xffffffff
Maximum supported INM message (value) length.
MAX_MESSAGE_LEN = 0xff - N_HEADER_BYTES
Maximum value of the message length field in a standard INM message, and thereby also the maximum size in bytes of a standard message value field.
MAX_MESSAGE_LEN = 0xff
Largest valid message type identifier for large INM messages.
MAX_TYPE_NUM = 0xff
Largest valid message type identifier for standard INM messages.
MAX_TYPE_NUM = 0x7f
Instances of subclasses of this abstract class represent INM messages.
class Message
Size in bytes of the message identifier field in an INM message header.
MESSAGE_ID_SIZE = 2
Size in bytes of the message length field in a large INM message.
MESSAGE_LEN_SIZE = 4
Size in bytes of the message length field in a standard INM message.
MESSAGE_LEN_SIZE = 1
Size in bytes of the message type identifier field in an INM message.
MESSAGE_TYP_SIZE = 1
Abstract parent class for objects that send and receive INM messages.
class MessageChannel
Exception class for MessageChannels.
class MessageChannelError( Exception )
A configurable factory class for INM messages.
class MessageFactory
Represents the header of an INM message.
class MessageHeader
Minimum size in bytes of a large INM message.
MIN_MESSAGE_SIZE = Message.MESSAGE_TYP_SIZE + MESSAGE_LEN_SIZE
Minimum size in bytes of a standard INM message.
MIN_MESSAGE_SIZE = Message.MESSAGE_TYP_SIZE + MESSAGE_LEN_SIZE
Smallest valid message type identifier for large INM messages.
MIN_TYPE_NUM = 0x80
Smallest valid message type identifier for standard INM messages.
MIN_TYPE_NUM = 0x00
The encapsulated MessageFactory of this InmHelper.
self.msg_factory
The MessageFactory that the MessageChannel uses to create INM Message objects.
self.msg_factory
INM message identifier.
self.msg_id
Constructs an INM message and returns it as a bytes object.
def msg_to_bytes( self, dstadr, typ, val, int_size = None, msg_id = None, srcadr = None, with_header = True )
Converts a Message and MessageHeader to a bytes object containing the message and header in standard binary on-wire format.
def msg_to_bytes( self, msg, header = None )
Constructs an INM message with a multipart message value and returns it as a bytes object.
def msg_to_bytes_mval( self, dstadr, typ, mval, int_size = None, msg_id = None, srcadr = None, with_header = True )
Constructs an INM message and returns it as a list of hex strings.
def msg_to_hex( self, dstadr, typ, val, int_size = None, msg_id = None, srcadr = None, with_header = True )
Constructs an INM message with a multipart message value and returns it as list of hex strings.
def msg_to_hex_mval( self, dstadr, typ, mval, int_size = None, msg_id = None, srcadr = None, with_header = True )
Total size of the header, type and length fields of an INM message.
N_HEADER_BYTES = MessageHeader.HEADER_SIZE + StandardMessage.MIN_MESSAGE_SIZE
Overrides MessageChannel.open.
def open( self )
Opens the encapsulated channel.
def open( self )
Opens the MessageChannel.
def open( self )
Overrides MessageChannel.open.
def open( self )
Overrides MessageChannel.open.
def open( self )
Peeks at the next INM message ID to be auto-generated.
def peek_next_msg_id( self )
Peeks at the most recently auto-generated INM message ID.
def peek_prev_msg_id( self )
Filesystem path of the used serial port device.
self.port
Type identifier reserved for INM protocol messages.
PROTOCOL_TYPE_NUM = MAX_TYPE_NUM
Shorthand alias of ResultCode.
RC = inm.ResultCode
Checks whether the MessageChannel is readable.
def readable( self )
Implements MessageChannel.recv.
def recv( self )
Attempts to receive an INM message.
def recv( self )
Attempts to receive an INM message.
def recv( self )
Implements MessageChannel.recv.
def recv( self )
Implements MessageChannel.recv.
def recv( self )
The receive channel table.
self.recv_channels
If this is True, format_msg_info will be used to print information about each received message on standard output (or the file specified via recv_print_file).
self.recv_print
Target file-like object (compatible with print()) to use for the output generated when recv_print is True.
self.recv_print_file
If this is True, then recv, sendrecv and sendrecv_mval will always return None.
self.recv_return_none
Shorthand alias of StandardRegisters.
Reg = inm.StandardRegisters
Enum class to use for conversion of logical register identifiers.
self.reg_enum_class
Message types to perform register identifier enum conversion on.
self.reg_enum_msg_types
If this is true, routing is applied even to messages where the destination address equals the source address of the local node.
self.relay_messages
Removes the INM address of a CC message destination node from cc_to.
def remove_cc_adr( self, cc_adr )
Shorthand alias of StandardResults.
Res = inm.StandardResults
Enum class to use for conversion of INM result codes.
self.res_enum_class
Message types to perform result code enum conversion on.
self.res_enum_msg_types
Attempts to receive and then route an INM message.
def route( self )
A MessageChannel with message routing functionality.
class RoutingMessageChannel( MessageChannel )
The routing table.
self.rtab