From 1b6759020aafce39adfbf4e99870f7e8552378b1 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Sun, 13 Jun 2021 12:38:24 +0200 Subject: [PATCH] added getter function --- tmtcpacket/pus/TcPacketBase.cpp | 4 ++++ tmtcpacket/pus/TcPacketBase.h | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/tmtcpacket/pus/TcPacketBase.cpp b/tmtcpacket/pus/TcPacketBase.cpp index ca3e2a99..50130c83 100644 --- a/tmtcpacket/pus/TcPacketBase.cpp +++ b/tmtcpacket/pus/TcPacketBase.cpp @@ -23,6 +23,10 @@ uint8_t TcPacketBase::getSubService() { return tcData->dataField.service_subtype; } +uint8_t TcPacketBase::getSourceId() { + return tcData->dataField.source_id; +} + uint8_t TcPacketBase::getAcknowledgeFlags() { return tcData->dataField.version_type_ack & 0b00001111; } diff --git a/tmtcpacket/pus/TcPacketBase.h b/tmtcpacket/pus/TcPacketBase.h index 582a2214..f5073eba 100644 --- a/tmtcpacket/pus/TcPacketBase.h +++ b/tmtcpacket/pus/TcPacketBase.h @@ -108,6 +108,13 @@ public: * @return The packet's PUS Service Subtype. */ uint8_t getSubService(); + /** + * The source ID can be used to have an additional identifier, e.g. for different ground + * station. + * @return + */ + uint8_t getSourceId(); + /** * This is a getter for a pointer to the packet's Application data. *