Midnight Sun Firmware
Loading...
Searching...
No Matches
Datagram

Public Member Functions

def __init__ (self, **kwargs)
 
def pack (self)
 
def datagram_type_id (self)
 
def node_ids (self)
 
def data (self)
 
def datagram_type_id (self, value)
 
def node_ids (self, nodes)
 
def data (self, value)
 

Private Member Functions

def _unpack (cls, datagram_bytearray, arbitration_id)
 
def _unpack_nodeids (self, raw_nodes)
 
def _pack_nodeids (self, raw_nodes)
 

Static Private Member Functions

def _check_kwargs (**kwargs)
 
def _convert_from_bytearray (in_bytearray, size)
 
def _convert_to_bytearray (in_value, size)
 

Private Attributes

 _datagram_type_id
 
 _node_ids
 
 _data
 

Detailed Description

Custom CAN-datagram class

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
**  kwargs 
)
Initialize datagram class

Member Function Documentation

◆ _check_kwargs()

def _check_kwargs ( **  kwargs)
staticprivate
This function checks that all args passed in are correct

◆ _convert_from_bytearray()

def _convert_from_bytearray (   in_bytearray,
  size 
)
staticprivate
Helper function to get little endian value from byte array

◆ _convert_to_bytearray()

def _convert_to_bytearray (   in_value,
  size 
)
staticprivate
Helper function to get a little endian byte array from a value

◆ _pack_nodeids()

def _pack_nodeids (   self,
  raw_nodes 
)
private
This function takes in an ordered list and outputs a bytearray of node ids

◆ _unpack()

def _unpack (   cls,
  datagram_bytearray,
  arbitration_id 
)
private
This function returns an instance fo the class by unpacking a bytearray

◆ _unpack_nodeids()

def _unpack_nodeids (   self,
  raw_nodes 
)
private
This function takes in the raw bytearray of node ids and returns an ordered list

◆ data() [1/2]

def data (   self)
This function describe the datagram node ids

◆ data() [2/2]

def data (   self,
  value 
)
This function sets the datagram data

◆ datagram_type_id() [1/2]

def datagram_type_id (   self)
This function describes the datagram id

◆ datagram_type_id() [2/2]

def datagram_type_id (   self,
  value 
)
This function sets the datagram type

◆ node_ids() [1/2]

def node_ids (   self)
This function assigns the datagram id

◆ node_ids() [2/2]

def node_ids (   self,
  nodes 
)
This function sets the datagram node ids

◆ pack()

def pack (   self)
This function packs a new bytearray based on set data

The documentation for this class was generated from the following file: