bugfixes for srv3
This commit is contained in:
parent
c12110cbf1
commit
88c4b2a539
@ -16,22 +16,38 @@ LocalDataPoolManager::LocalDataPoolManager(HasLocalDataPoolIF* owner,
|
||||
MessageQueueIF* queueToUse, bool appendValidityBuffer):
|
||||
appendValidityBuffer(appendValidityBuffer) {
|
||||
if(owner == nullptr) {
|
||||
sif::error << "HkManager: Invalid supplied owner!" << std::endl;
|
||||
sif::error << "LocalDataPoolManager::LocalDataPoolManager: "
|
||||
<< "Invalid supplied owner!" << std::endl;
|
||||
return;
|
||||
}
|
||||
this->owner = owner;
|
||||
mutex = MutexFactory::instance()->createMutex();
|
||||
if(mutex == nullptr) {
|
||||
sif::error << "LocalDataPoolManager::LocalDataPoolManager: "
|
||||
"Could not create mutex." << std::endl;
|
||||
}
|
||||
ipcStore = objectManager->get<StorageManagerIF>(objects::IPC_STORE);
|
||||
if(ipcStore == nullptr) {
|
||||
sif::error << "LocalDataPoolManager::LocalDataPoolManager: "
|
||||
"Could not set IPC store." << std::endl;
|
||||
<< "Could not create mutex." << std::endl;
|
||||
}
|
||||
|
||||
hkQueue = queueToUse;
|
||||
}
|
||||
|
||||
LocalDataPoolManager::~LocalDataPoolManager() {}
|
||||
|
||||
ReturnValue_t LocalDataPoolManager::initialize(MessageQueueIF* queueToUse) {
|
||||
if(queueToUse == nullptr) {
|
||||
sif::error << "LocalDataPoolManager::initialize: "
|
||||
<< std::hex << "0x" << owner->getObjectId() << ". Supplied "
|
||||
<< "queue invalid!" << std::dec << std::endl;
|
||||
}
|
||||
hkQueue = queueToUse;
|
||||
|
||||
ipcStore = objectManager->get<StorageManagerIF>(objects::IPC_STORE);
|
||||
if(ipcStore == nullptr) {
|
||||
sif::error << "LocalDataPoolManager::initialize: "
|
||||
<< std::hex << "0x" << owner->getObjectId() << ": Could not "
|
||||
<< "set IPC store." <<std::dec << std::endl;
|
||||
return HasReturnvaluesIF::RETURN_FAILED;
|
||||
}
|
||||
|
||||
|
||||
if(defaultHkDestination != objects::NO_OBJECT) {
|
||||
AcceptsHkPacketsIF* hkPacketReceiver =
|
||||
@ -39,18 +55,13 @@ LocalDataPoolManager::LocalDataPoolManager(HasLocalDataPoolIF* owner,
|
||||
if(hkPacketReceiver != nullptr) {
|
||||
hkDestinationId = hkPacketReceiver->getHkQueue();
|
||||
}
|
||||
else {
|
||||
sif::error << "LocalDataPoolManager::LocalDataPoolManager: "
|
||||
<< "Default HK destination object is invalid!" << std::endl;
|
||||
return HasReturnvaluesIF::RETURN_FAILED;
|
||||
}
|
||||
}
|
||||
|
||||
LocalDataPoolManager::~LocalDataPoolManager() {}
|
||||
|
||||
ReturnValue_t LocalDataPoolManager::initialize(MessageQueueIF* queueToUse) {
|
||||
if(queueToUse == nullptr) {
|
||||
sif::error << "LocalDataPoolManager::initialize: Supplied queue "
|
||||
"invalid!" << std::endl;
|
||||
}
|
||||
hkQueue = queueToUse;
|
||||
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
}
|
||||
|
||||
|
@ -12,6 +12,7 @@ public:
|
||||
objectId(sid.objectId), setId(sid.ownerSetId),
|
||||
reportingEnabled(reportingEnabled), valid(valid),
|
||||
collectionIntervalSeconds(collectionInterval), dataSet(dataSetPtr) {
|
||||
setLinks();
|
||||
}
|
||||
|
||||
ReturnValue_t serialize(uint8_t** buffer, size_t* size,
|
||||
|
@ -177,3 +177,11 @@ LocalPoolDataSetBase* InternalErrorReporter::getDataSetHandle(sid_t sid) {
|
||||
void InternalErrorReporter::setTaskIF(PeriodicTaskIF *task) {
|
||||
this->executingTask = task;
|
||||
}
|
||||
|
||||
ReturnValue_t InternalErrorReporter::initialize() {
|
||||
ReturnValue_t result = poolManager.initialize(commandQueue);
|
||||
if(result != HasReturnvaluesIF::RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
return SystemObject::initialize();
|
||||
}
|
||||
|
@ -45,6 +45,7 @@ public:
|
||||
virtual dur_millis_t getPeriodicOperationFrequency() const override;
|
||||
virtual LocalPoolDataSetBase* getDataSetHandle(sid_t sid) override;
|
||||
|
||||
virtual ReturnValue_t initialize() override;
|
||||
virtual ReturnValue_t performOperation(uint8_t opCode) override;
|
||||
|
||||
virtual void queueMessageNotSent();
|
||||
|
@ -181,7 +181,7 @@ ReturnValue_t Service3Housekeeping::handleReply(const CommandMessage* reply,
|
||||
switch(command) {
|
||||
|
||||
case(HousekeepingMessage::HK_REPORT): {
|
||||
ReturnValue_t result = generateHkReport(reply,
|
||||
ReturnValue_t result = generateHkReply(reply,
|
||||
static_cast<uint8_t>(Subservice::HK_REPORT));
|
||||
if(result != HasReturnvaluesIF::RETURN_OK) {
|
||||
return result;
|
||||
@ -190,7 +190,7 @@ ReturnValue_t Service3Housekeeping::handleReply(const CommandMessage* reply,
|
||||
}
|
||||
|
||||
case(HousekeepingMessage::DIAGNOSTICS_REPORT): {
|
||||
ReturnValue_t result = generateHkReport(reply,
|
||||
ReturnValue_t result = generateHkReply(reply,
|
||||
static_cast<uint8_t>(Subservice::DIAGNOSTICS_REPORT));
|
||||
if(result != HasReturnvaluesIF::RETURN_OK) {
|
||||
return result;
|
||||
@ -198,6 +198,17 @@ ReturnValue_t Service3Housekeeping::handleReply(const CommandMessage* reply,
|
||||
return CommandingServiceBase::EXECUTION_COMPLETE;
|
||||
}
|
||||
|
||||
case(HousekeepingMessage::HK_DEFINITIONS_REPORT): {
|
||||
return generateHkReply(reply, static_cast<uint8_t>(
|
||||
Subservice::HK_DEFINITIONS_REPORT));
|
||||
break;
|
||||
}
|
||||
case(HousekeepingMessage::DIAGNOSTICS_DEFINITION_REPORT): {
|
||||
return generateHkReply(reply, static_cast<uint8_t>(
|
||||
Subservice::DIAGNOSTICS_REPORT));
|
||||
break;
|
||||
}
|
||||
|
||||
case(HousekeepingMessage::HK_REQUEST_SUCCESS): {
|
||||
return CommandingServiceBase::EXECUTION_COMPLETE;
|
||||
}
|
||||
@ -226,13 +237,13 @@ void Service3Housekeeping::handleUnrequestedReply(
|
||||
switch(command) {
|
||||
|
||||
case(HousekeepingMessage::DIAGNOSTICS_REPORT): {
|
||||
result = generateHkReport(reply,
|
||||
result = generateHkReply(reply,
|
||||
static_cast<uint8_t>(Subservice::DIAGNOSTICS_REPORT));
|
||||
break;
|
||||
}
|
||||
|
||||
case(HousekeepingMessage::HK_REPORT): {
|
||||
result = generateHkReport(reply,
|
||||
result = generateHkReply(reply,
|
||||
static_cast<uint8_t>(Subservice::HK_REPORT));
|
||||
break;
|
||||
}
|
||||
@ -254,7 +265,7 @@ MessageQueueId_t Service3Housekeeping::getHkQueue() const {
|
||||
return commandQueue->getId();
|
||||
}
|
||||
|
||||
ReturnValue_t Service3Housekeeping::generateHkReport(
|
||||
ReturnValue_t Service3Housekeeping::generateHkReply(
|
||||
const CommandMessage* hkMessage, uint8_t subserviceId) {
|
||||
store_address_t storeId;
|
||||
|
||||
|
@ -82,7 +82,7 @@ private:
|
||||
ReturnValue_t checkInterfaceAndAcquireMessageQueue(
|
||||
MessageQueueId_t* messageQueueToSet, object_id_t* objectId);
|
||||
|
||||
ReturnValue_t generateHkReport(const CommandMessage* hkMessage,
|
||||
ReturnValue_t generateHkReply(const CommandMessage* hkMessage,
|
||||
uint8_t subserviceId);
|
||||
ReturnValue_t prepareReportingTogglingCommand(CommandMessage* command,
|
||||
object_id_t objectId, bool enableReporting, bool isDiagnostics,
|
||||
|
Loading…
x
Reference in New Issue
Block a user