update notifications working

This commit is contained in:
Robin Müller 2020-10-14 19:52:06 +02:00
parent 5b96161331
commit a9a31308ae
4 changed files with 35 additions and 15 deletions

View File

@ -128,10 +128,10 @@ ReturnValue_t LocalDataPoolManager::performHkOperation() {
continue;
}
if(poolObj->hasChanged()) {
// prepare and send update notification.
toReset = poolObj;
}
toReset = poolObj;
}
else {
LocalPoolDataSetBase* dataSet = owner->getDataSetHandle(
@ -140,12 +140,22 @@ ReturnValue_t LocalDataPoolManager::performHkOperation() {
continue;
}
if(dataSet->hasChanged()) {
// prepare and send update notification
CommandMessage notification;
HousekeepingMessage::setUpdateNotificationSetCommand(
&notification, receiver.dataId.sid);
ReturnValue_t result = hkQueue->sendMessage(
receiver.destinationQueue, &notification);
if(result != HasReturnvaluesIF::RETURN_OK) {
status = result;
}
toReset = dataSet;
}
toReset = dataSet;
}
handleChangeResetLogic(receiver.dataType, receiver.dataId, toReset);
if(toReset != nullptr) {
handleChangeResetLogic(receiver.dataType,
receiver.dataId, toReset);
}
break;
}
case(ReportingType::UPDATE_SNAPSHOT): {
@ -159,8 +169,8 @@ ReturnValue_t LocalDataPoolManager::performHkOperation() {
}
if(poolObj->hasChanged()) {
// prepare and send update snapshot.
toReset = poolObj;
}
toReset = poolObj;
}
else {
LocalPoolDataSetBase* dataSet = owner->getDataSetHandle(
@ -170,10 +180,13 @@ ReturnValue_t LocalDataPoolManager::performHkOperation() {
}
if(dataSet->hasChanged()) {
// prepare and send update snapshot.
toReset = dataSet;
}
toReset = dataSet;
}
handleChangeResetLogic(receiver.dataType, receiver.dataId, toReset);
if(toReset != nullptr) {
handleChangeResetLogic(receiver.dataType,
receiver.dataId, toReset);
}
break;
}
default:
@ -425,6 +438,11 @@ ReturnValue_t LocalDataPoolManager::handleHousekeepingMessage(
dataSet, true);
}
case(HousekeepingMessage::UPDATE_NOTIFICATION_SET): {
owner->handleChangedDatasetOrVariable(sid);
return HasReturnvaluesIF::RETURN_OK;
}
default:
return CommandMessageIF::UNKNOWN_COMMAND;
}

View File

@ -130,12 +130,13 @@ public:
static void setUpdateSnapshotVariableCommand(CommandMessage* command,
lp_id_t localPoolId, store_address_t storeId);
sid_t getUpdateNotificationSetCommand(const CommandMessage* command);
lp_id_t getUpdateNotificationVariableCommand(const CommandMessage* command);
static sid_t getUpdateNotificationSetCommand(const CommandMessage* command);
static lp_id_t getUpdateNotificationVariableCommand(
const CommandMessage* command);
sid_t getUpdateSnapshotSetCommand(const CommandMessage* command,
static sid_t getUpdateSnapshotSetCommand(const CommandMessage* command,
store_address_t* storeId);
lp_id_t getUpdateSnapshotVariableCommand(const CommandMessage* command,
static lp_id_t getUpdateSnapshotVariableCommand(const CommandMessage* command,
store_address_t* storeId);
/** Utility */

View File

@ -12,7 +12,7 @@
void CommandMessageCleaner::clearCommandMessage(CommandMessage* message) {
switch(message->getMessageType()){
case messagetypes::MODE_COMMAND:
case messagetypes::MODE_COMMAND:
ModeMessage::clear(message);
break;
case messagetypes::HEALTH_COMMAND:

View File

@ -249,8 +249,9 @@ void Service3Housekeeping::handleUnrequestedReply(
}
default:
sif::error << "Service3Housekeeping::handleReply: Invalid reply with "
<< "reply command " << command << "!" << std::endl;
sif::error << "Service3Housekeeping::handleUnrequestedReply: Invalid "
<< "reply with " << "reply command " << command << "!"
<< std::endl;
return;
}