This commit is contained in:
parent
d82cecbe6e
commit
9711dd9242
@ -26,8 +26,11 @@ class OpCode:
|
||||
ALL_CELLS_CMD = "allcells"
|
||||
FRAM = "fram"
|
||||
|
||||
ON = "on"
|
||||
SWITCH_ON = "on"
|
||||
SWITCH_OFF = "off"
|
||||
OFF = "off"
|
||||
SWITCH_OFF = OFF
|
||||
NORMAL = "normal"
|
||||
|
||||
|
||||
class ActionId(enum.IntEnum):
|
||||
@ -53,6 +56,7 @@ class Info:
|
||||
|
||||
SWITCH_ON = "Switch Scex on"
|
||||
SWITCH_OFF = "Switch Scex off"
|
||||
NORMAL = "Switch SCEX to normal mode"
|
||||
|
||||
|
||||
@tmtc_definitions_provider
|
||||
@ -66,8 +70,9 @@ def add_scex_cmds(defs: TmtcDefinitionWrapper):
|
||||
|
||||
oce.add(keys=OpCode.ALL_CELLS_CMD, info=Info.ALL_CELLS_CMD)
|
||||
oce.add(keys=OpCode.FRAM, info=Info.FRAM)
|
||||
oce.add(keys=OpCode.SWITCH_ON, info=Info.SWITCH_ON)
|
||||
oce.add(keys=OpCode.SWITCH_OFF, info=Info.SWITCH_OFF)
|
||||
oce.add(keys=OpCode.ON, info=Info.SWITCH_ON)
|
||||
oce.add(keys=OpCode.OFF, info=Info.SWITCH_OFF)
|
||||
oce.add(keys=OpCode.NORMAL, info=Info.NORMAL)
|
||||
|
||||
defs.add_service(
|
||||
name=CustomServiceList.SCEX.value, info="SCEX Device", op_code_entry=oce
|
||||
@ -78,7 +83,7 @@ def add_scex_cmds(defs: TmtcDefinitionWrapper):
|
||||
def pack_scex_cmds(p: ServiceProviderParams): # noqa C901
|
||||
op_code = p.op_code
|
||||
q = p.queue_helper
|
||||
if op_code == OpCode.SWITCH_ON:
|
||||
if op_code == OpCode.ON:
|
||||
q.add_log_cmd(Info.SWITCH_ON)
|
||||
q.add_pus_tc(
|
||||
PusTelecommand(
|
||||
@ -87,7 +92,16 @@ def pack_scex_cmds(p: ServiceProviderParams): # noqa C901
|
||||
app_data=pack_mode_data(SCEX_HANDLER_ID, Mode.ON, 0),
|
||||
)
|
||||
)
|
||||
if op_code == OpCode.SWITCH_OFF:
|
||||
if op_code == OpCode.NORMAL:
|
||||
q.add_log_cmd(Info.NORMAL)
|
||||
q.add_pus_tc(
|
||||
PusTelecommand(
|
||||
service=200,
|
||||
subservice=Subservice.TC_MODE_COMMAND,
|
||||
app_data=pack_mode_data(SCEX_HANDLER_ID, Mode.NORMAL, 0),
|
||||
)
|
||||
)
|
||||
if op_code == OpCode.OFF:
|
||||
q.add_log_cmd(Info.SWITCH_OFF)
|
||||
q.add_pus_tc(
|
||||
PusTelecommand(
|
||||
|
Loading…
Reference in New Issue
Block a user