From d1899ef1816aa7531b142f87d8b9ea91ef4011fd Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Sat, 27 Feb 2021 13:13:12 +0100 Subject: [PATCH] updated hk handling --- pus_tm/tmtcc_pus_hk_handling.py | 22 +++++++++++++++++----- tmtc_core | 2 +- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/pus_tm/tmtcc_pus_hk_handling.py b/pus_tm/tmtcc_pus_hk_handling.py index 73eede3..b1eb4c7 100644 --- a/pus_tm/tmtcc_pus_hk_handling.py +++ b/pus_tm/tmtcc_pus_hk_handling.py @@ -6,21 +6,33 @@ """ from typing import Tuple +from config.tmtcc_object_ids import ObjectIds from tmtc_core.pus_tm.tmtcc_pus_service_3 import Service3Base from tmtc_core.utility.tmtcc_logger import get_logger LOGGER = get_logger() -def handle_user_hk_packet( - object_id: bytearray, hk_data: bytearray, - service3_packet: Service3Base) -> Tuple[list, list, bytearray]: +def handle_user_hk_packet(object_id: ObjectIds, set_id: int, hk_data: bytearray, + service3_packet: Service3Base) -> Tuple[list, list, bytearray, int]: """ This function is called when a Service 3 Housekeeping packet is received. + + Please note that the object IDs should be compared by value because direct comparison of + enumerations does not work in Python. For example use: + + if object_id.value == ObjectIds.TEST_OBJECT.value + + to test equality based on the object ID list. + @param object_id: + @param set_id: @param hk_data: @param service3_packet: - @return: + @return: Expects a tuple, consisting of two lists, a bytearray and an integer + The first list contains the header columns, the second list the list with + the corresponding values. The bytearray is the validity buffer, which is usually appended + at the end of the housekeeping packet. The last value is the number of parameters. """ LOGGER.info("Service3TM: Parsing for this SID has not been implemented.") - return [], [], bytearray() + return [], [], bytearray(), 0 diff --git a/tmtc_core b/tmtc_core index 081cb43..dd623a5 160000 --- a/tmtc_core +++ b/tmtc_core @@ -1 +1 @@ -Subproject commit 081cb43e1d932dd3776363dbdf130edff5d5cc32 +Subproject commit dd623a5ef72c46cdb99334bc7fd166e45bb2dd56