send time stampers properly now
This commit is contained in:
parent
f591b9793c
commit
234ccdf764
@ -10,7 +10,8 @@
|
||||
Service1TelecommandVerification::Service1TelecommandVerification(object_id_t objectId,
|
||||
uint16_t apid, uint8_t serviceId,
|
||||
object_id_t targetDestination,
|
||||
uint16_t messageQueueDepth)
|
||||
uint16_t messageQueueDepth,
|
||||
TimeStamperIF* timeStamper)
|
||||
: SystemObject(objectId),
|
||||
apid(apid),
|
||||
serviceId(serviceId),
|
||||
@ -119,6 +120,14 @@ ReturnValue_t Service1TelecommandVerification::initialize() {
|
||||
}
|
||||
storeHelper.setTmStore(*tmStore);
|
||||
}
|
||||
if(timeStamper == nullptr) {
|
||||
timeStamper = ObjectManager::instance()->get<TimeStamperIF>(objects::TIME_STAMPER);
|
||||
if(timeStamper == nullptr) {
|
||||
return ObjectManagerIF::CHILD_INIT_FAILED;
|
||||
}
|
||||
} else {
|
||||
}
|
||||
storeHelper.setTimeStamper(*timeStamper);
|
||||
|
||||
sendHelper.setMsgQueue(*tmQueue);
|
||||
if (errReporter == nullptr) {
|
||||
|
@ -47,7 +47,8 @@ class Service1TelecommandVerification : public AcceptsVerifyMessageIF,
|
||||
static const uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::PUS_SERVICE_1;
|
||||
|
||||
Service1TelecommandVerification(object_id_t objectId, uint16_t apid, uint8_t serviceId,
|
||||
object_id_t targetDestination, uint16_t messageQueueDepth);
|
||||
object_id_t targetDestination, uint16_t messageQueueDepth,
|
||||
TimeStamperIF* timeStamper = nullptr);
|
||||
~Service1TelecommandVerification() override;
|
||||
|
||||
/**
|
||||
@ -87,6 +88,7 @@ class Service1TelecommandVerification : public AcceptsVerifyMessageIF,
|
||||
TmStoreHelper storeHelper;
|
||||
TmStoreAndSendWrapper tmHelper;
|
||||
InternalErrorReporterIF* errReporter = nullptr;
|
||||
TimeStamperIF* timeStamper = nullptr;
|
||||
StorageManagerIF* tmStore = nullptr;
|
||||
MessageQueueIF* tmQueue = nullptr;
|
||||
|
||||
|
@ -60,9 +60,8 @@ ReturnValue_t PusTmReader::parseData(bool crcCheck) {
|
||||
size_t currentOffset = SpacePacketReader::getHeaderLen();
|
||||
pointers.secHeaderStart = pointers.spHeaderStart + currentOffset;
|
||||
currentOffset += PusTmIF::MIN_SEC_HEADER_LEN;
|
||||
size_t minTimestampLen = spReader.getBufSize() - currentOffset;
|
||||
result = timeReader->readTimeStamp(pointers.secHeaderStart + PusTmIF::MIN_SEC_HEADER_LEN,
|
||||
minTimestampLen);
|
||||
size_t minTimestampLen = spReader.getFullPacketLen() - currentOffset;
|
||||
result = timeReader->readTimeStamp(pointers.spHeaderStart + currentOffset, minTimestampLen);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
|
@ -104,11 +104,12 @@ ReturnValue_t CommandingServiceBase::initialize() {
|
||||
// This avoids duplicate calculation of the CRC16
|
||||
tmStoreHelper.disableCrcCalculation();
|
||||
if (tmTimeStamper == nullptr) {
|
||||
auto timerStamper = ObjectManager::instance()->get<TimeStamperIF>(objects::TIME_STAMPER);
|
||||
if (timerStamper != nullptr) {
|
||||
tmStoreHelper.setTimeStamper(*timerStamper);
|
||||
tmTimeStamper = ObjectManager::instance()->get<TimeStamperIF>(objects::TIME_STAMPER);
|
||||
if (tmTimeStamper == nullptr) {
|
||||
return ObjectManagerIF::CHILD_INIT_FAILED;
|
||||
}
|
||||
}
|
||||
tmStoreHelper.setTimeStamper(*tmTimeStamper);
|
||||
|
||||
if (errReporter == nullptr) {
|
||||
errReporter =
|
||||
|
Loading…
Reference in New Issue
Block a user