pyscenario.client

IFSEI Telnet Client Module.

This module contains the IFSEITelnetClient class, a custom TelnetClient for handling communication with IFSEI devices over Telnet. It manages the connection, sending, and receiving of data, and handles connection loss gracefully.

Classes

IFSEITelnetClient(queue_manager, ...)

Custom TelnetClient for handling IFSEI device communication.

Documentation

class pyscenario.client.IFSEITelnetClient(queue_manager: QueueManager, on_connection_lost_callback: Callable[[], None] | None, *args: tuple, **kwds: Any)[source]

Bases: TelnetClient

Custom TelnetClient for handling IFSEI device communication.

This client handles the connection, sending, and receiving of data to and from an IFSEI device over a Telnet connection. It manages tasks for sending and receiving data, and can handle connection loss gracefully.

protocol

The communication protocol (TCP/UDP).

Type:

Protocol

task_manager

Manager for send and receive tasks.

Type:

TaskManager

queue_manager

Manager for send and receive queues.

Type:

QueueManager

send_delay

Delay between sending commands.

Type:

float

shell

Shell function to run asynchronously.

Type:

Callable

on_connection_lost_callback

Callback when connection is lost.

Type:

Callable | None

Initialize the IFSEITelnetClient.

Parameters:
  • queue_manager (QueueManager) – Manager for send and receive queues.

  • on_connection_lost_callback (Callable | None) – Callback when connection is lost.

  • *args (tuple) – Additional arguments for the TelnetClient.

  • **kwds (Any) – Additional keyword arguments for the TelnetClient.

__init__(queue_manager: QueueManager, on_connection_lost_callback: Callable[[], None] | None, *args: tuple, **kwds: Any) None[source]

Initialize the IFSEITelnetClient.

Parameters:
  • queue_manager (QueueManager) – Manager for send and receive queues.

  • on_connection_lost_callback (Callable | None) – Callback when connection is lost.

  • *args (tuple) – Additional arguments for the TelnetClient.

  • **kwds (Any) – Additional keyword arguments for the TelnetClient.

connection_lost(exc: None | Exception, /) None[source]

Handle connection loss.

Parameters:

exc (None | Exception) – Exception that caused the connection loss.

async async_close() None[source]

Disconnect from the IFSEI device.

__annotations__ = {}