CommandManager Module#
SPDX-FileCopyrightText: 2024 DESY and the Constellation authors SPDX-License-Identifier: EUPL-1.2
This module provides classes for managing CSCP requests/replies within Constellation Satellites.
- class core.commandmanager.CommandReceiver(name: str, cmd_port: int, **kwds: Any)#
Bases:
BaseSatelliteFrame
Class for handling incoming CSCP requests.
Commands will call specific methods of the inheriting class which should have the following signature:
def COMMAND(self, request: CSCP1Message) -> (str, any, dict):
The expected return values are: - reply message (string) - payload (any) - map (dictionary) (e.g. for meta information)
Inheriting classes need to decorate such command methods with ‘@cscp_requestable’ to make them callable through CSCP requests.
If a method
def _COMMAND_is_allowed(self, request: CSCP1Message) -> bool:
exists, it will be called first to determine whether the command is currently allowed or not.
- get_commands(_request: CSCP1Message | None = None) Tuple[str, dict[str, str], None] #
Return all commands supported by the Satellite.
No payload argument.
This will include all methods with the @cscp_requestable decorator. The doc string of the function will be used to derive the summary and payload argument description for each command by using the first and the second line of the doc string, respectively (not counting empty lines).