service 8 checksum reply

This commit is contained in:
Jakob Meier
2021-12-24 07:32:35 +01:00
parent 3a71176c56
commit 58ec3c6640
4 changed files with 80 additions and 3 deletions

View File

@ -4,6 +4,10 @@ from config.object_ids import *
from pus_tc.imtq import ImtqActionIds
from pus_tc.ploc_mpsoc import PlocReplyIds
from pus_tc.ploc_supervisor import SupvActionIds
from pus_tc.star_tracker import StarTrackerActionIds
from tmtccmd.utility.logger import get_console_logger
LOGGER = get_console_logger()
def user_analyze_service_8_data(
@ -35,6 +39,8 @@ def user_analyze_service_8_data(
return handle_ploc_replies(action_id, custom_data)
elif object_id == PLOC_SUPV_ID:
return handle_supervisor_replies(action_id, custom_data)
elif object_id == STAR_TRACKER_ID:
return handle_startracker_replies(action_id, custom_data)
else:
header_list = []
content_list = []
@ -68,3 +74,17 @@ def handle_supervisor_replies(action_id: int, custom_data: bytearray) -> Tuple[l
header_list = ['MRAM Dump']
content_list = [custom_data[:len(custom_data)]]
return header_list, content_list
def handle_startracker_replies(action_id: int, custom_data: bytearray) -> Tuple[list, list]:
header_list = []
content_list = []
if action_id == StarTrackerActionIds.CHECKSUM:
if len(custom_data) != 5:
LOGGER.warning("Star tracker reply has invalid length {0}".format(len(custom_data)))
return header_list, content_list
header_list = ['Checksum', 'Checksum valid']
print(custom_data[4])
checksum_valid_flag = custom_data[4] >> 8
content_list = ['0x' + custom_data[:4].hex(), checksum_valid_flag]
return header_list, content_list