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,11 +128,11 @@ ReturnValue_t LocalDataPoolManager::performHkOperation() {
continue; continue;
} }
if(poolObj->hasChanged()) { if(poolObj->hasChanged()) {
// prepare and send update notification. // prepare and send update notification.
}
toReset = poolObj; toReset = poolObj;
} }
}
else { else {
LocalPoolDataSetBase* dataSet = owner->getDataSetHandle( LocalPoolDataSetBase* dataSet = owner->getDataSetHandle(
receiver.dataId.sid); receiver.dataId.sid);
@ -140,12 +140,22 @@ ReturnValue_t LocalDataPoolManager::performHkOperation() {
continue; continue;
} }
if(dataSet->hasChanged()) { if(dataSet->hasChanged()) {
// prepare and send update notification // 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; break;
} }
case(ReportingType::UPDATE_SNAPSHOT): { case(ReportingType::UPDATE_SNAPSHOT): {
@ -159,9 +169,9 @@ ReturnValue_t LocalDataPoolManager::performHkOperation() {
} }
if(poolObj->hasChanged()) { if(poolObj->hasChanged()) {
// prepare and send update snapshot. // prepare and send update snapshot.
}
toReset = poolObj; toReset = poolObj;
} }
}
else { else {
LocalPoolDataSetBase* dataSet = owner->getDataSetHandle( LocalPoolDataSetBase* dataSet = owner->getDataSetHandle(
receiver.dataId.sid); receiver.dataId.sid);
@ -170,10 +180,13 @@ ReturnValue_t LocalDataPoolManager::performHkOperation() {
} }
if(dataSet->hasChanged()) { if(dataSet->hasChanged()) {
// prepare and send update snapshot. // 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; break;
} }
default: default:
@ -425,6 +438,11 @@ ReturnValue_t LocalDataPoolManager::handleHousekeepingMessage(
dataSet, true); dataSet, true);
} }
case(HousekeepingMessage::UPDATE_NOTIFICATION_SET): {
owner->handleChangedDatasetOrVariable(sid);
return HasReturnvaluesIF::RETURN_OK;
}
default: default:
return CommandMessageIF::UNKNOWN_COMMAND; return CommandMessageIF::UNKNOWN_COMMAND;
} }

View File

@ -130,12 +130,13 @@ public:
static void setUpdateSnapshotVariableCommand(CommandMessage* command, static void setUpdateSnapshotVariableCommand(CommandMessage* command,
lp_id_t localPoolId, store_address_t storeId); lp_id_t localPoolId, store_address_t storeId);
sid_t getUpdateNotificationSetCommand(const CommandMessage* command); static sid_t getUpdateNotificationSetCommand(const CommandMessage* command);
lp_id_t getUpdateNotificationVariableCommand(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); store_address_t* storeId);
lp_id_t getUpdateSnapshotVariableCommand(const CommandMessage* command, static lp_id_t getUpdateSnapshotVariableCommand(const CommandMessage* command,
store_address_t* storeId); store_address_t* storeId);
/** Utility */ /** Utility */

View File

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