From d7ee5a2229b104b6fbd32c58bd80aa255afe09a8 Mon Sep 17 00:00:00 2001 From: Irini Kosmidou Date: Tue, 21 Jun 2022 18:15:17 +0200 Subject: [PATCH] tmtc scex continue --- pus_tc/devs/scex.py | 34 +++++++++++++++++++++++++++++++++- tmtccmd | 2 +- 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/pus_tc/devs/scex.py b/pus_tc/devs/scex.py index ac90371..464faff 100644 --- a/pus_tc/devs/scex.py +++ b/pus_tc/devs/scex.py @@ -13,6 +13,7 @@ class OpCodes: class ActionIds(enum.IntEnum): PING = 7 + ION_CMD = 4 class Info: @@ -24,6 +25,13 @@ def add_scex_cmds(cmd_dict: ServiceOpCodeDictT): add_op_code_entry( op_code_dict=op_code_dict, keys=OpCodes.PING, info=Info.PING ) + + # ion + op_code_dict = dict() + add_op_code_entry( + op_code_dict=op_code_dict, keys=OpCodes.ION, info=Info.ION + ) + add_service_op_code_entry( srv_op_code_dict=cmd_dict, name=CustomServiceList.SCEX.value, @@ -32,11 +40,35 @@ def add_scex_cmds(cmd_dict: ServiceOpCodeDictT): ) +""" + #in app_data + app_data.extend(struct.pack("!H", first_dac)) + append_16_bit_val(packet=packet, val=CFG.exp_cfg.first_dac[cn]) + append_16_bit_val(packet=packet, val=CFG.exp_cfg.last_dac[cn]) + append_16_bit_val(packet=packet, val=CFG.exp_cfg.res_switch1[cn]) + append_16_bit_val(packet=packet, val=CFG.exp_cfg.res_switch2[cn]) + + packet.append(CFG.exp_cfg.dac_weight1[cn]) + packet.append(CFG.exp_cfg.dac_weight2[cn]) + packet.append(CFG.exp_cfg.dac_weight3[cn]) +""" def pack_scex_cmds(tc_queue: TcQueueT, op_code: str): if op_code in OpCodes.PING: tc_queue.appendleft((QueueCommands.PRINT, Info.PING)) app_data = bytes([0]) command = generate_action_command(SCEX_HANDLER_ID, ActionIds.PING, app_data) tc_queue.appendleft(command.pack_command_tuple()) + if op_code in OpCodes.ION: + tc_queue.appendleft((QueueCommands.PRINT, Info.ION)) + app_data = bytes([0]) + command = generate_action_command(SCEX_HANDLER_ID, ActionIds.ION, app_data) + tc_queue.appendleft(command.pack_command_tuple()) - pass + # one cell + if op_code in OpCodes.ION: + tc_queue.appendleft((QueueCommands.PRINT, Info.ION)) + app_data = bytearray([0]) + #todo cell number + app_data.extend(struct.pack("!H", first_dac)) #aus json holen + command = generate_action_command(SCEX_HANDLER_ID, ActionIds.ION, app_data) + tc_queue.appendleft(command.pack_command_tuple()) \ No newline at end of file diff --git a/tmtccmd b/tmtccmd index f87032a..b8e86dd 160000 --- a/tmtccmd +++ b/tmtccmd @@ -1 +1 @@ -Subproject commit f87032a2d15076641dee71da22752613ce5355dd +Subproject commit b8e86ddd7cdecf1348f60d9fff08964493a93356