Some minor tweaks for BPX commands #202
@ -41,17 +41,17 @@ class BpxHeaterModeSelect(enum.IntEnum):
|
|||||||
|
|
||||||
|
|
||||||
class BpxOpCode:
|
class BpxOpCode:
|
||||||
HK = ["0", "hk"]
|
HK = "hk"
|
||||||
OFF = ["off"]
|
OFF = "off"
|
||||||
ON = ["on"]
|
ON = "on"
|
||||||
RST_CFG = "reset_cfg"
|
RST_CFG = "reset_cfg"
|
||||||
SET_CFG = "set_cfg"
|
SET_CFG = "set_cfg"
|
||||||
MAN_HEATER_ON = "man_heater_on"
|
MAN_HEATER_ON = "man_heater_on"
|
||||||
MAN_HEATER_OFF = "man_heater_off"
|
MAN_HEATER_OFF = "man_heater_off"
|
||||||
RST_BOOT_CNT = ["1", "rst_boot_cnt"]
|
RST_BOOT_CNT = "rst_boot_cnt"
|
||||||
REQUEST_CFG = ["2", "cfg"]
|
REQUEST_CFG = "cfg"
|
||||||
REQUEST_CFG_HK = ["3", "cfg_hk"]
|
REQUEST_CFG_HK = "cfg_hk"
|
||||||
REBOOT = ["4", "reboot"]
|
REBOOT = "reboot"
|
||||||
|
|
||||||
|
|
||||||
@tmtc_definitions_provider
|
@tmtc_definitions_provider
|
||||||
@ -61,7 +61,7 @@ def add_bpx_cmd_definitions(defs: TmtcDefinitionWrapper):
|
|||||||
oce.add(keys=BpxOpCode.OFF, info="Off command")
|
oce.add(keys=BpxOpCode.OFF, info="Off command")
|
||||||
oce.add(keys=BpxOpCode.HK, info="Request BPX HK")
|
oce.add(keys=BpxOpCode.HK, info="Request BPX HK")
|
||||||
oce.add(keys=BpxOpCode.RST_BOOT_CNT, info="Reset Boot Count")
|
oce.add(keys=BpxOpCode.RST_BOOT_CNT, info="Reset Boot Count")
|
||||||
oce.add(keys=BpxOpCode.RST_CFG, info="Reset Config")
|
oce.add(keys=BpxOpCode.RST_CFG, info="Reset Config to stored default settings")
|
||||||
oce.add(keys=BpxOpCode.SET_CFG, info="Set BPX configuration")
|
oce.add(keys=BpxOpCode.SET_CFG, info="Set BPX configuration")
|
||||||
oce.add(keys=BpxOpCode.MAN_HEATER_ON, info="Manual heater on")
|
oce.add(keys=BpxOpCode.MAN_HEATER_ON, info="Manual heater on")
|
||||||
oce.add(keys=BpxOpCode.MAN_HEATER_OFF, info="Manual heater off")
|
oce.add(keys=BpxOpCode.MAN_HEATER_OFF, info="Manual heater off")
|
||||||
@ -81,11 +81,11 @@ def add_bpx_cmd_definitions(defs: TmtcDefinitionWrapper):
|
|||||||
def pack_bpx_commands(p: ServiceProviderParams): # noqa C901: Complexity is okay here.
|
def pack_bpx_commands(p: ServiceProviderParams): # noqa C901: Complexity is okay here.
|
||||||
op_code = p.op_code
|
op_code = p.op_code
|
||||||
q = p.queue_helper
|
q = p.queue_helper
|
||||||
if op_code in BpxOpCode.HK:
|
if op_code == BpxOpCode.HK:
|
||||||
q.add_log_cmd("Requesting BPX battery HK set")
|
q.add_log_cmd("Requesting BPX battery HK set")
|
||||||
sid = make_sid(object_id=BPX_HANDLER_ID, set_id=BpxSetId.GET_HK_SET)
|
sid = make_sid(object_id=BPX_HANDLER_ID, set_id=BpxSetId.GET_HK_SET)
|
||||||
q.add_pus_tc(generate_one_hk_command(sid=sid))
|
q.add_pus_tc(generate_one_hk_command(sid=sid))
|
||||||
if op_code in BpxOpCode.OFF:
|
if op_code == BpxOpCode.OFF:
|
||||||
q.add_log_cmd("Off mode")
|
q.add_log_cmd("Off mode")
|
||||||
mode_cmd = pack_mode_data(BPX_HANDLER_ID, Mode.OFF, 0)
|
mode_cmd = pack_mode_data(BPX_HANDLER_ID, Mode.OFF, 0)
|
||||||
q.add_pus_tc(
|
q.add_pus_tc(
|
||||||
@ -95,7 +95,7 @@ def pack_bpx_commands(p: ServiceProviderParams): # noqa C901: Complexity is oka
|
|||||||
app_data=mode_cmd,
|
app_data=mode_cmd,
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
if op_code in BpxOpCode.ON:
|
if op_code == BpxOpCode.ON:
|
||||||
q.add_log_cmd("On mode")
|
q.add_log_cmd("On mode")
|
||||||
mode_cmd = pack_mode_data(BPX_HANDLER_ID, Mode.ON, 0)
|
mode_cmd = pack_mode_data(BPX_HANDLER_ID, Mode.ON, 0)
|
||||||
q.add_pus_tc(
|
q.add_pus_tc(
|
||||||
@ -105,7 +105,7 @@ def pack_bpx_commands(p: ServiceProviderParams): # noqa C901: Complexity is oka
|
|||||||
app_data=mode_cmd,
|
app_data=mode_cmd,
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
if op_code in BpxOpCode.RST_BOOT_CNT:
|
if op_code == BpxOpCode.RST_BOOT_CNT:
|
||||||
q.add_log_cmd("Resetting reboot counters")
|
q.add_log_cmd("Resetting reboot counters")
|
||||||
q.add_pus_tc(
|
q.add_pus_tc(
|
||||||
create_action_cmd(
|
create_action_cmd(
|
||||||
@ -137,16 +137,16 @@ def pack_bpx_commands(p: ServiceProviderParams): # noqa C901: Complexity is oka
|
|||||||
user_data=user_data,
|
user_data=user_data,
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
if op_code in BpxOpCode.REQUEST_CFG:
|
if op_code == BpxOpCode.REQUEST_CFG:
|
||||||
q.add_log_cmd("Requesting configuration struct")
|
q.add_log_cmd("Requesting configuration struct")
|
||||||
q.add_pus_tc(
|
q.add_pus_tc(
|
||||||
create_action_cmd(object_id=BPX_HANDLER_ID, action_id=BpxActionId.GET_CFG)
|
create_action_cmd(object_id=BPX_HANDLER_ID, action_id=BpxActionId.GET_CFG)
|
||||||
)
|
)
|
||||||
if op_code in BpxOpCode.REQUEST_CFG_HK:
|
if op_code == BpxOpCode.REQUEST_CFG_HK:
|
||||||
q.add_log_cmd("Requesting configuration struct HK")
|
q.add_log_cmd("Requesting configuration struct HK")
|
||||||
sid = make_sid(object_id=BPX_HANDLER_ID, set_id=BpxSetId.GET_CFG_SET)
|
sid = make_sid(object_id=BPX_HANDLER_ID, set_id=BpxSetId.GET_CFG_SET)
|
||||||
q.add_pus_tc(generate_one_hk_command(sid=sid))
|
q.add_pus_tc(generate_one_hk_command(sid=sid))
|
||||||
if op_code in BpxOpCode.REBOOT:
|
if op_code == BpxOpCode.REBOOT:
|
||||||
q.add_log_cmd("Rebooting BPX battery")
|
q.add_log_cmd("Rebooting BPX battery")
|
||||||
q.add_pus_tc(
|
q.add_pus_tc(
|
||||||
create_action_cmd(object_id=BPX_HANDLER_ID, action_id=BpxActionId.REBOOT)
|
create_action_cmd(object_id=BPX_HANDLER_ID, action_id=BpxActionId.REBOOT)
|
||||||
|
Loading…
Reference in New Issue
Block a user