Communication Package
- tmtccmd.com.tcpip_utils.load_tcpip_address_from_toml(tcpip_type: TcpIpType, toml_cfg_path: str) EthAddr | None
- tmtccmd.com.tcpip_utils.load_tcpip_address_json(tcpip_type: TcpIpType, json_cfg_path: str) EthAddr | None
- tmtccmd.com.tcpip_utils.prompt_ip_address(type_str: str) EthAddr
Prompt a valid IP address from the user
- tmtccmd.com.ser_utils.determine_baud_rate(cfg_path: str) int | None
Determine baud rate. Tries to read from JSON first. If the baud rate is not contained in the config JSON, prompt it from user instead with the option to store value in JSON file.
- Returns:
Determined baud rate
- tmtccmd.com.ser_utils.determine_com_port(cfg_path: str) str | None
Determine serial port. Tries to read from JSON first. If the serial port is not contained in the config JSON, prompt it from user instead with the option to store value in JSON file.
- Returns:
Determined serial port
- tmtccmd.com.ser_utils.find_com_port_from_hint(hint: str) tuple[bool, str]
Find a COM port based on a hint string
Dummy Virtual Communication Interface. Currently serves to use the TMTC program without needing external hardware or an extra socket
- class tmtccmd.com.dummy.DummyHandler
Bases:
object- generate_reply_package()
Generate a reply package. Currently, this only generates a reply for a ping telecommand.
- class tmtccmd.com.dummy.DummyInterface
Bases:
ComInterface- close(args: Any | None = None) None
Closes the ComIF and releases any held resources (for example a Communication Port).
- Returns:
- initialize(args: Any | None = None) None
Perform initializations step which can not be done in constructor or which require returnvalues.
- is_open() bool
Can be used to check whether the communication interface is open. This is useful if opening a COM interface takes a longer time and is non-blocking
- open(args: Any | None = None) None
Opens the communication interface to allow communication.
- Returns:
- packets_available(parameters: Any = 0) int
Poll whether packets are available.
- Parameters:
parameters – Can be an arbitrary parameter.
- Raises:
ReceptionDecodeError – If the underlying COM interface uses encoding and decoding when determining the number of available packets, this exception can be thrown on decoding errors.
- Returns:
Number of packets available.
- receive(parameters: Any = 0) list[bytes]
Returns a list of received packets. The child class can use a separate thread to poll for the packets or use some other mechanism and container like a deque to store packets to be returned here.
- Parameters:
parameters
- Raises:
ReceptionDecodeError – If the underlying COM interface uses encoding and decoding and the decoding fails, this exception will be returned.
- Returns: