Representing Command
- class tgtools.utils.cmdlog.Cmd(command: str, target_id: str = '', response: str = '', success: bool = False, timestamp: str = '')
Representation of a command interaction with a radio: the command itself, target radio, response, success indication, timestamp.
- __init__(command: str, target_id: str = '', response: str = '', success: bool = False, timestamp: str = '')
- Parameters:
command (str) – The command string.
target_id (str) – Designation of the target radio.
response (str) – Copy of the response.
success (bool) – Indication if response is successful.
timestamp (str) – Timestamp sending command.
- as_dict() dict
Convert to dict (response may be truncated).
- Return type:
dict
- command: str
The command string.
- response: str
The radio’s response to the command.
- success: bool
Indication if command executed successfully.
- target_id: str
An arbitrary label identifying the target device (typically IP address and/or radio param_name).
- timestamp: str
Timestamp for when command executed (if not provided, set to instantiation time)