uC chip interface arduino  0.9.0
A interface for async and neuromrphic IC testing
Loading...
Searching...
No Matches
Packet Class Reference

Packet class to be used as a base class for all packets acting as an interface. More...

Inheritance diagram for Packet:

Public Member Functions

def __init__ (self)
 
def check_and_log (self)
 check_and_log logs the packet if the header is in the logging lists More...
 
def from_bytearray (cls, byte_array)
 method to construct a packet from a bytearray depending on the header the correct packet type is returned More...
 
def header (self)
 getter method for the header attribute More...
 
def set_exec_time (self, time)
 setter method for the execution time attribute More...
 
def set_header (self, header)
 setter method for the header attribute More...
 
def time (self)
 getter method for the time attribute More...
 
def to_bytearray (self)
 placeholder for converting the package to a bytearray More...
 

Detailed Description

Packet class to be used as a base class for all packets acting as an interface.

it contains the static method from_bytearray to construct a packet from a bytearray and chooses the correct packet type depending on the header

Definition at line 24 of file packet.py.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self)

Reimplemented in ConfigPacket, DataI2CPacket, ErrorPacket, PinPacket, and Data32bitPacket.

Definition at line 30 of file packet.py.

Member Function Documentation

◆ check_and_log()

def check_and_log (   self)

check_and_log logs the packet if the header is in the logging lists

Definition at line 114 of file packet.py.

◆ from_bytearray()

def from_bytearray (   cls,
  byte_array 
)

method to construct a packet from a bytearray depending on the header the correct packet type is returned

Parameters
byte_array(bytearray) the bytearray to construct the packet from
Returns
: the constructed packet of the coresponing sub type

Reimplemented in Data32bitPacket, DataI2CPacket, PinPacket, ConfigPacket, and ErrorPacket.

Definition at line 36 of file packet.py.

◆ header()

def header (   self)

getter method for the header attribute

    :return: the header of the packet
    :rtype: EnumInt entry or int

Definition at line 75 of file packet.py.

◆ set_exec_time()

def set_exec_time (   self,
  time 
)

setter method for the execution time attribute

Parameters
time(uint_32) the time of execution of the packet

Definition at line 99 of file packet.py.

◆ set_header()

def set_header (   self,
  header 
)

setter method for the header attribute

Parameters
header(byte/uint_8) the header of the packet

Reimplemented in Data32bitPacket, DataI2CPacket, PinPacket, ConfigPacket, and ErrorPacket.

Definition at line 90 of file packet.py.

◆ time()

def time (   self)

getter method for the time attribute

    :return: the time of execution of the packet
    :rtype: EnumInt entry or int

Definition at line 82 of file packet.py.

◆ to_bytearray()

def to_bytearray (   self)

placeholder for converting the package to a bytearray

Returns
: the packet as a bytearray

Reimplemented in Data32bitPacket, DataI2CPacket, PinPacket, ConfigPacket, and ErrorPacket.

Definition at line 108 of file packet.py.


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