The DataI2CPacket is used for I2C communication and all types which need 3x 8bit values instread of 1x 32bit value all availible instructions are defined in the DataI2CHeader.
More...
|
def | __init__ (self, header, device_address, register_address, read=False, value=0, time=0) |
|
def | __str__ (self) |
|
def | device_address (self) |
| getter method for the 7bit device_address attribute More...
|
|
def | from_bytearray (self, byte_array) |
| constructs a DataI2CPacket from a bytearray More...
|
|
def | read (self) |
| getter method for the 1bit read/write attribute More...
|
|
def | register_address (self) |
| getter method for the 8bit register_address attribute More...
|
|
def | set_device_address (self, value) |
| setter method for the 7bit device address attribute More...
|
|
def | set_header (self, header) |
| setter method for the header attribute More...
|
|
def | set_read (self, value) |
| setter method for the 1bit read/write attribute More...
|
|
def | set_register_address (self, value) |
| setter method for the 8bit register address attribute More...
|
|
def | set_value (self, value) |
| setter method for the value attribute More...
|
|
def | to_bytearray (self) |
| method to convert the packet to a bytearray in the correct format of <header><exec_time><addess+read><value ms/ls> More...
|
|
def | value (self) |
| getter method for the value attribute More...
|
|
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...
|
|
The DataI2CPacket is used for I2C communication and all types which need 3x 8bit values instread of 1x 32bit value all availible instructions are defined in the DataI2CHeader.
Definition at line 179 of file packet.py.
◆ __init__()
def __init__ |
( |
|
self, |
|
|
|
header, |
|
|
|
device_address, |
|
|
|
register_address, |
|
|
|
read = False , |
|
|
|
value = 0 , |
|
|
|
time = 0 |
|
) |
| |
◆ __str__()
◆ device_address()
def device_address |
( |
|
self | ) |
|
getter method for the 7bit device_address attribute
- Returns
- : the device_address of the i2c packet
Definition at line 205 of file packet.py.
◆ from_bytearray()
def from_bytearray |
( |
|
self, |
|
|
|
byte_array |
|
) |
| |
constructs a DataI2CPacket from a bytearray
- Parameters
-
byte_array | 9 byte bytearray to construct the Packet from |
- Returns
- : DataI2CPacket @raise Exception: if package construction fails
Reimplemented from Packet.
Definition at line 271 of file packet.py.
◆ read()
getter method for the 1bit read/write attribute
- Returns
- : the read flag of the i2c packet
Definition at line 199 of file packet.py.
◆ register_address()
def register_address |
( |
|
self | ) |
|
getter method for the 8bit register_address attribute
- Returns
- : the register_address of the i2c packet
Definition at line 211 of file packet.py.
◆ set_device_address()
def set_device_address |
( |
|
self, |
|
|
|
value |
|
) |
| |
setter method for the 7bit device address attribute
- Parameters
-
value | (uint_8) the 7bit device address to be sent to |
Definition at line 236 of file packet.py.
◆ set_header()
def set_header |
( |
|
self, |
|
|
|
header |
|
) |
| |
setter method for the header attribute
- Parameters
-
header | (DataI2CHeader or uint8) the header of the packet |
Reimplemented from Packet.
Definition at line 217 of file packet.py.
◆ set_read()
def set_read |
( |
|
self, |
|
|
|
value |
|
) |
| |
setter method for the 1bit read/write attribute
- Parameters
-
value | (bool) the read flag of the i2c packet |
Definition at line 245 of file packet.py.
◆ set_register_address()
def set_register_address |
( |
|
self, |
|
|
|
value |
|
) |
| |
setter method for the 8bit register address attribute
- Parameters
-
value | (uint_8) the 8bit register address to be sent to |
Definition at line 253 of file packet.py.
◆ set_value()
def set_value |
( |
|
self, |
|
|
|
value |
|
) |
| |
setter method for the value attribute
- Parameters
-
value | (uint_16) the value to be sent |
Definition at line 226 of file packet.py.
◆ to_bytearray()
method to convert the packet to a bytearray in the correct format of <header><exec_time><addess+read><value ms/ls>
- Returns
- : the packet as a bytearray
Reimplemented from Packet.
Definition at line 261 of file packet.py.
◆ value()
getter method for the value attribute
- Returns
- : the value of the packet
Definition at line 193 of file packet.py.
The documentation for this class was generated from the following file: