handling for bpx cfg set
This commit is contained in:
parent
1702d89576
commit
890a20a078
@ -28,4 +28,15 @@ def pack_bpx_commands(tc_queue: TcQueueT, op_code: str):
|
|||||||
object_id=BPX_HANDLER_ID, action_id=BpxActionIds.RESET_COUNTERS
|
object_id=BPX_HANDLER_ID, action_id=BpxActionIds.RESET_COUNTERS
|
||||||
)
|
)
|
||||||
tc_queue.appendleft(cmd.pack_command_tuple())
|
tc_queue.appendleft(cmd.pack_command_tuple())
|
||||||
|
if op_code in ["2", "cfg"]:
|
||||||
|
tc_queue.appendleft((QueueCommands.PRINT, "Resetting reboot counters"))
|
||||||
|
cmd = generate_action_command(
|
||||||
|
object_id=BPX_HANDLER_ID, action_id=BpxActionIds.GET_CFG
|
||||||
|
)
|
||||||
|
tc_queue.appendleft(cmd.pack_command_tuple())
|
||||||
|
if op_code in ["3", "cfg_hk"]:
|
||||||
|
tc_queue.appendleft((QueueCommands.PRINT, "Requesting BPX Configuration Struct"))
|
||||||
|
sid = make_sid(object_id=BPX_HANDLER_ID, set_id=BpxSetIds.GET_CFG_SET)
|
||||||
|
cmd = generate_one_hk_command(sid=sid, ssc=0)
|
||||||
|
tc_queue.appendleft(cmd.pack_command_tuple())
|
||||||
pass
|
pass
|
||||||
|
@ -6,6 +6,7 @@ import datetime
|
|||||||
from tmtccmd.config.definitions import HkReplyUnpacked
|
from tmtccmd.config.definitions import HkReplyUnpacked
|
||||||
from tmtccmd.tm.service_3_housekeeping import Service3Base
|
from tmtccmd.tm.service_3_housekeeping import Service3Base
|
||||||
from tmtccmd.utility.logger import get_console_logger
|
from tmtccmd.utility.logger import get_console_logger
|
||||||
|
from pus_tc.bpx_batt import BpxSetIds
|
||||||
from pus_tc.syrlinks_hk_handler import SetIds
|
from pus_tc.syrlinks_hk_handler import SetIds
|
||||||
from pus_tc.imtq import ImtqSetIds
|
from pus_tc.imtq import ImtqSetIds
|
||||||
from config.object_ids import (
|
from config.object_ids import (
|
||||||
@ -40,7 +41,7 @@ def handle_user_hk_packet(
|
|||||||
elif object_id == GPS_HANDLER_0_ID or object_id == GPS_HANDLER_1_ID:
|
elif object_id == GPS_HANDLER_0_ID or object_id == GPS_HANDLER_1_ID:
|
||||||
return handle_gps_data(hk_data=hk_data)
|
return handle_gps_data(hk_data=hk_data)
|
||||||
elif object_id == BPX_HANDLER_ID:
|
elif object_id == BPX_HANDLER_ID:
|
||||||
return handle_bpx_hk_data(hk_data=hk_data)
|
return handle_bpx_hk_data(hk_data=hk_data, set_id=set_id)
|
||||||
else:
|
else:
|
||||||
LOGGER.info("Service 3 TM: Parsing for this SID has not been implemented.")
|
LOGGER.info("Service 3 TM: Parsing for this SID has not been implemented.")
|
||||||
return HkReplyUnpacked()
|
return HkReplyUnpacked()
|
||||||
@ -285,9 +286,10 @@ def handle_gps_data(hk_data: bytearray) -> HkReplyUnpacked:
|
|||||||
return reply
|
return reply
|
||||||
|
|
||||||
|
|
||||||
def handle_bpx_hk_data(hk_data: bytes) -> HkReplyUnpacked:
|
def handle_bpx_hk_data(hk_data: bytes, set_id: int) -> HkReplyUnpacked:
|
||||||
LOGGER.info(f"Received BPX data, HK data length {len(hk_data)}")
|
LOGGER.info(f"Received BPX data, HK data length {len(hk_data)}")
|
||||||
reply = HkReplyUnpacked()
|
reply = HkReplyUnpacked()
|
||||||
|
if set_id == BpxSetIds.GET_HK_SET:
|
||||||
charge_current = struct.unpack('!H', hk_data[0:2])[0]
|
charge_current = struct.unpack('!H', hk_data[0:2])[0]
|
||||||
discharge_current = struct.unpack('!H', hk_data[2:4])[0]
|
discharge_current = struct.unpack('!H', hk_data[2:4])[0]
|
||||||
heater_current = struct.unpack('!H', hk_data[4:6])[0]
|
heater_current = struct.unpack('!H', hk_data[4:6])[0]
|
||||||
@ -323,4 +325,19 @@ def handle_bpx_hk_data(hk_data: bytes) -> HkReplyUnpacked:
|
|||||||
boot_cause
|
boot_cause
|
||||||
]
|
]
|
||||||
reply.validity_buffer = hk_data[21:]
|
reply.validity_buffer = hk_data[21:]
|
||||||
|
elif set_id == BpxSetIds.GET_CFG_SET:
|
||||||
|
battheat_mode = hk_data[0]
|
||||||
|
battheat_low = struct.unpack('!b', hk_data[1:2])[0]
|
||||||
|
battheat_high = struct.unpack('!b', hk_data[2:3])[0]
|
||||||
|
reply.header_list = [
|
||||||
|
"Battery Heater Mode",
|
||||||
|
"Battery Heater Low Limit",
|
||||||
|
"Battery Heater High Limit"
|
||||||
|
]
|
||||||
|
reply.content_list = [
|
||||||
|
battheat_mode,
|
||||||
|
battheat_low,
|
||||||
|
battheat_high
|
||||||
|
]
|
||||||
|
reply.validity_buffer = hk_data[3:]
|
||||||
return reply
|
return reply
|
||||||
|
2
tmtccmd
2
tmtccmd
@ -1 +1 @@
|
|||||||
Subproject commit 683ae401c7b4b2503bd91f23c3e069ced1b0db9c
|
Subproject commit 892d13117f0e3c6d598f157668bff9ed6b31574d
|
Loading…
Reference in New Issue
Block a user