sm_bluesky.common.servers#

Members

AbstractInstrumentServer

Base class for TCP instrument servers.

GeneratorServerShanghaiTech

register_command

Decorator to register a subclass method as an instrument command.

HF2Server

Python class to create a sever that connect to HF2 data server and listen for data request from client.

class sm_bluesky.common.servers.AbstractInstrumentServer(host: str, port: int, ipv6: bool = False)[source]#

Base class for TCP instrument servers.

Handles socket lifecycle, connection management, and buffered command parsing. Subclasses must implement hardware-specific control logic.

start() → None[source]#

Initializes the server, connects hardware, and enters the listening loop.

shutdown(*args: Any) → None[source]#

Stops the server, closes sockets, and disconnects hardware.

abstractmethod connect_hardware() → bool[source]#

Establishes connection to the specific hardware device.

abstractmethod disconnect_hardware() → None[source]#

Disconnect from the hardware device.

sm_bluesky.common.servers.register_command(name: bytes) → Callable[[F], F][source]#

Decorator to register a subclass method as an instrument command.

class sm_bluesky.common.servers.HF2Server(host: str = '', port: int = 7891, hf2_ip: str = '172.23.110.84', hf2_port: int = 8004, api_level: Literal[0, 1, 4, 5, 6] = 6, device_id: str = 'dev4206')[source]#

Python class to create a sever that connect to HF2 data server and listen for data request from client.

connect_hardware() → bool[source]#

Connect to Zurich Instruments HF2 Data Server.

disconnect_hardware() → None[source]#

Disconnect from HF2 and cleanup modules.