MockServer¶
- class lsst.ts.m2com.MockServer(host: str, port_command: int = 50000, port_telemetry: int = 50001, timeout_in_second: float = 0.05, log: Logger | None = None, is_csc: bool = True)¶
Bases:
object
Mock server of M2.
Parameters¶
- host
str
IP address for this server; typically “LOCALHOST_IPV4” for IP4 or “LOCALHOST_IPV6” for IP6.
- port_command
int
, optional IP port for the command server. (the default is 50000)
- port_telemetry
int
, optional IP port for the telemetry server. (the default is 50001)
- timeout_in_second
float
, optional Read timeout in second. (the default is 0.05)
- log
logging.Logger
or None, optional A logger. If None, a logger will be instantiated. (the default is None)
- is_csc
bool
, optional Is called by the commandable SAL component (CSC) or not. (the default is True)
Attributes¶
- log
logging.Logger
A logger.
- model
MockModel
Mock model to simulate the M2 hardware behavior.
- server_command
tcpip.OneClientServer
Command server.
- server_telemetry
tcpip.OneClientServer
Telemetry server.
- timeout_in_second
float
Read timeout in second.
Attributes Summary
Methods Summary
The command and telemetry sockets are connected or not.
close
()Cancel the tasks and close the connections.
start
()Start the command and telemetry TCP/IP servers.
Attributes Documentation
- PERIOD_TELEMETRY_IN_SECOND = 0.05¶
Methods Documentation
- are_servers_connected() bool ¶
The command and telemetry sockets are connected or not.
Returns¶
bool
True if servers are connected. Else, False.
- async close() None ¶
Cancel the tasks and close the connections.
Note: this function is safe to call even though there is no connection.
- async start() None ¶
Start the command and telemetry TCP/IP servers.
- host