This commit is contained in:
parent
15716c988b
commit
0cbf28f25c
@ -17,17 +17,17 @@ USE_SCEX_CONF_FILE = True
|
|||||||
|
|
||||||
|
|
||||||
class OpCode:
|
class OpCode:
|
||||||
PING = ["0", "ping"]
|
PING = "ping"
|
||||||
ION_CMD = ["1", "ion"]
|
ION_CMD = "ion"
|
||||||
TEMP_CMD = ["2", "temp"]
|
TEMP_CMD = "temp"
|
||||||
EXP_STATUS_CMD = ["3", "expstatus"]
|
EXP_STATUS_CMD = "expstatus"
|
||||||
|
|
||||||
ONE_CELLS_CMD = ["4", "onecell"]
|
ONE_CELLS_CMD = "onecell"
|
||||||
ALL_CELLS_CMD = ["5", "allcells"]
|
ALL_CELLS_CMD = "allcells"
|
||||||
FRAM = ["6", "fram"]
|
FRAM = "fram"
|
||||||
|
|
||||||
SWITCH_ON = ["7", "on"]
|
SWITCH_ON = "on"
|
||||||
SWITCH_OFF = ["8", "off"]
|
SWITCH_OFF = "off"
|
||||||
|
|
||||||
|
|
||||||
class ActionId(enum.IntEnum):
|
class ActionId(enum.IntEnum):
|
||||||
@ -78,7 +78,7 @@ def add_scex_cmds(defs: TmtcDefinitionWrapper):
|
|||||||
def pack_scex_cmds(p: ServiceProviderParams): # noqa C901
|
def pack_scex_cmds(p: ServiceProviderParams): # noqa C901
|
||||||
op_code = p.op_code
|
op_code = p.op_code
|
||||||
q = p.queue_helper
|
q = p.queue_helper
|
||||||
if op_code in OpCode.SWITCH_ON:
|
if op_code == OpCode.SWITCH_ON:
|
||||||
q.add_log_cmd(Info.SWITCH_ON)
|
q.add_log_cmd(Info.SWITCH_ON)
|
||||||
q.add_pus_tc(
|
q.add_pus_tc(
|
||||||
PusTelecommand(
|
PusTelecommand(
|
||||||
@ -87,7 +87,7 @@ def pack_scex_cmds(p: ServiceProviderParams): # noqa C901
|
|||||||
app_data=pack_mode_data(SCEX_HANDLER_ID, Mode.ON, 0),
|
app_data=pack_mode_data(SCEX_HANDLER_ID, Mode.ON, 0),
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
if op_code in OpCode.SWITCH_OFF:
|
if op_code == OpCode.SWITCH_OFF:
|
||||||
q.add_log_cmd(Info.SWITCH_OFF)
|
q.add_log_cmd(Info.SWITCH_OFF)
|
||||||
q.add_pus_tc(
|
q.add_pus_tc(
|
||||||
PusTelecommand(
|
PusTelecommand(
|
||||||
@ -96,20 +96,20 @@ def pack_scex_cmds(p: ServiceProviderParams): # noqa C901
|
|||||||
app_data=pack_mode_data(SCEX_HANDLER_ID, Mode.OFF, 0),
|
app_data=pack_mode_data(SCEX_HANDLER_ID, Mode.OFF, 0),
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
if op_code in OpCode.PING:
|
if op_code == OpCode.PING:
|
||||||
q.add_log_cmd(Info.PING)
|
q.add_log_cmd(Info.PING)
|
||||||
app_data = bytes([0])
|
app_data = bytes([0])
|
||||||
q.add_pus_tc(create_action_cmd(SCEX_HANDLER_ID, ActionId.PING, app_data))
|
q.add_pus_tc(create_action_cmd(SCEX_HANDLER_ID, ActionId.PING, app_data))
|
||||||
if op_code in OpCode.ION_CMD:
|
if op_code == OpCode.ION_CMD:
|
||||||
q.add_log_cmd(Info.ION_CMD)
|
q.add_log_cmd(Info.ION_CMD)
|
||||||
app_data = bytes([0])
|
app_data = bytes([0])
|
||||||
q.add_pus_tc(create_action_cmd(SCEX_HANDLER_ID, ActionId.ION_CMD, app_data))
|
q.add_pus_tc(create_action_cmd(SCEX_HANDLER_ID, ActionId.ION_CMD, app_data))
|
||||||
if op_code in OpCode.TEMP_CMD:
|
if op_code == OpCode.TEMP_CMD:
|
||||||
q.add_log_cmd(Info.TEMP_CMD)
|
q.add_log_cmd(Info.TEMP_CMD)
|
||||||
app_data = bytes([0])
|
app_data = bytes([0])
|
||||||
q.add_pus_tc(create_action_cmd(SCEX_HANDLER_ID, ActionId.TEMP_CMD, app_data))
|
q.add_pus_tc(create_action_cmd(SCEX_HANDLER_ID, ActionId.TEMP_CMD, app_data))
|
||||||
|
|
||||||
if op_code in OpCode.EXP_STATUS_CMD:
|
if op_code == OpCode.EXP_STATUS_CMD:
|
||||||
q.add_log_cmd(Info.EXP_STATUS_CMD)
|
q.add_log_cmd(Info.EXP_STATUS_CMD)
|
||||||
app_data = bytes([0])
|
app_data = bytes([0])
|
||||||
q.add_pus_tc(
|
q.add_pus_tc(
|
||||||
@ -117,7 +117,7 @@ def pack_scex_cmds(p: ServiceProviderParams): # noqa C901
|
|||||||
)
|
)
|
||||||
|
|
||||||
# one cell
|
# one cell
|
||||||
if op_code in OpCode.ONE_CELLS_CMD:
|
if op_code == OpCode.ONE_CELLS_CMD:
|
||||||
q.add_log_cmd(Info.ONE_CELLS_CMD)
|
q.add_log_cmd(Info.ONE_CELLS_CMD)
|
||||||
app_data = bytearray([0])
|
app_data = bytearray([0])
|
||||||
|
|
||||||
@ -165,7 +165,7 @@ def pack_scex_cmds(p: ServiceProviderParams): # noqa C901
|
|||||||
create_action_cmd(SCEX_HANDLER_ID, ActionId.ONE_CELLS_CMD, app_data)
|
create_action_cmd(SCEX_HANDLER_ID, ActionId.ONE_CELLS_CMD, app_data)
|
||||||
)
|
)
|
||||||
|
|
||||||
if op_code in OpCode.ALL_CELLS_CMD:
|
if op_code == OpCode.ALL_CELLS_CMD:
|
||||||
q.add_log_cmd(Info.ALL_CELLS_CMD)
|
q.add_log_cmd(Info.ALL_CELLS_CMD)
|
||||||
app_data = bytearray([0])
|
app_data = bytearray([0])
|
||||||
|
|
||||||
@ -197,7 +197,7 @@ def pack_scex_cmds(p: ServiceProviderParams): # noqa C901
|
|||||||
create_action_cmd(SCEX_HANDLER_ID, ActionId.ALL_CELLS_CMD, app_data)
|
create_action_cmd(SCEX_HANDLER_ID, ActionId.ALL_CELLS_CMD, app_data)
|
||||||
)
|
)
|
||||||
|
|
||||||
if op_code in OpCode.FRAM:
|
if op_code == OpCode.FRAM:
|
||||||
q.add_log_cmd(Info.FRAM)
|
q.add_log_cmd(Info.FRAM)
|
||||||
app_data = bytes([0])
|
app_data = bytes([0])
|
||||||
q.add_pus_tc(create_action_cmd(SCEX_HANDLER_ID, ActionId.FRAM, app_data))
|
q.add_pus_tc(create_action_cmd(SCEX_HANDLER_ID, ActionId.FRAM, app_data))
|
||||||
|
Loading…
Reference in New Issue
Block a user