add tmtccmd client program
This commit is contained in:
3
fsrc-example/pyclient/.gitignore
vendored
3
fsrc-example/pyclient/.gitignore
vendored
@@ -1 +1,4 @@
|
||||
/venv
|
||||
/log
|
||||
/.idea/*
|
||||
!/.idea/runConfigurations
|
||||
|
||||
@@ -47,7 +47,7 @@ from tmtccmd.util.tmtc_printer import FsfwTmTcPrinter
|
||||
|
||||
LOGGER = get_console_logger()
|
||||
|
||||
EXAMPLE_PUS_APID = 0xEF
|
||||
EXAMPLE_PUS_APID = 0x02
|
||||
|
||||
|
||||
class SatRsConfigHook(TmTcCfgHookBase):
|
||||
@@ -113,10 +113,10 @@ class PusHandler(SpecificApidHandlerBase):
|
||||
def handle_tm(self, packet: bytes, _user_args: any):
|
||||
try:
|
||||
tm_packet = PusTelemetry.unpack(packet)
|
||||
except ValueError:
|
||||
except ValueError as e:
|
||||
LOGGER.warning("Could not generate PUS TM object from raw data")
|
||||
LOGGER.warning(f"Raw Packet: [{packet.hex(sep=',')}], REPR: {packet!r}")
|
||||
return
|
||||
raise e
|
||||
service = tm_packet.service
|
||||
dedicated_handler = False
|
||||
if service == 1:
|
||||
@@ -263,7 +263,10 @@ def main():
|
||||
elif state.request == BackendRequest.DELAY_LISTENER:
|
||||
time.sleep(0.8)
|
||||
elif state.request == BackendRequest.DELAY_CUSTOM:
|
||||
time.sleep(state.next_delay)
|
||||
if state.next_delay.total_seconds() <= 0.4:
|
||||
time.sleep(state.next_delay.total_seconds())
|
||||
else:
|
||||
time.sleep(0.4)
|
||||
elif state.request == BackendRequest.CALL_NEXT:
|
||||
pass
|
||||
except KeyboardInterrupt:
|
||||
|
||||
1
fsrc-example/pyclient/seqcnt.txt
Normal file
1
fsrc-example/pyclient/seqcnt.txt
Normal file
@@ -0,0 +1 @@
|
||||
30
|
||||
6
fsrc-example/pyclient/tmtc_conf.json
Normal file
6
fsrc-example/pyclient/tmtc_conf.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"com_if": "udp",
|
||||
"tcpip_udp_ip_addr": "127.0.0.1",
|
||||
"tcpip_udp_port": 7301,
|
||||
"tcpip_udp_recv_max_size": 1500
|
||||
}
|
||||
Reference in New Issue
Block a user