senxor.interface.tcpip_serial
TCPIPInterface(device)
Bases: SerialInterfaceBase
is_connected
property
data_ready
property
(Optional) Whether the data is ready to be read.
OP_TIMEOUT = 3
class-attribute
OP_RETRY_TIMES = 1
class-attribute
OP_RETRY_INTERVAL = 0.1
class-attribute
logger = get_logger().bind(name=(device.name))
instance-attribute
transport = self.TRANSPORT_CLASS(device)
instance-attribute
processor = SerialAckProcessor(self.transport, self.logger)
instance-attribute
TRANSPORT_CLASS = TCPIPTransport
class-attribute
instance-attribute
device
property
open()
close()
bind_state(state)
Receive the latest device state snapshot from Senxor.
read(timeout=None)
read_reg(reg)
read_regs(regs)
write_reg(reg, value)
write_regs(regs)
hard_reset()
(Optional) Hard reset the device.
This operation is optional and may not be supported by all devices.
This method should not automatically re-open the connection to the device.
Returns:
| Type | Description |
|---|---|
None
|
|
Raises:
| Type | Description |
|---|---|
NotImplementedError
|
If the device does not support hard reset. |
list_devices()
classmethod
TCPIPPort(host, port)
Bases: IDevice