2020-08-13 20:53:35 +02:00
|
|
|
#include "MonitoringMessage.h"
|
2021-06-05 19:52:38 +02:00
|
|
|
#include "../objectmanager/ObjectManager.h"
|
2016-06-15 23:48:41 +02:00
|
|
|
|
|
|
|
MonitoringMessage::~MonitoringMessage() {
|
|
|
|
}
|
|
|
|
|
|
|
|
void MonitoringMessage::setLimitViolationReport(CommandMessage* message,
|
|
|
|
store_address_t storeId) {
|
|
|
|
setTypicalMessage(message, LIMIT_VIOLATION_REPORT, storeId);
|
|
|
|
}
|
|
|
|
|
|
|
|
void MonitoringMessage::setTypicalMessage(CommandMessage* message,
|
|
|
|
Command_t type, store_address_t storeId) {
|
|
|
|
message->setCommand(type);
|
|
|
|
message->setParameter2(storeId.raw);
|
|
|
|
}
|
|
|
|
|
|
|
|
store_address_t MonitoringMessage::getStoreId(const CommandMessage* message) {
|
|
|
|
store_address_t temp;
|
|
|
|
temp.raw = message->getParameter2();
|
|
|
|
return temp;
|
|
|
|
}
|
|
|
|
|
|
|
|
void MonitoringMessage::clear(CommandMessage* message) {
|
|
|
|
message->setCommand(CommandMessage::CMD_NONE);
|
|
|
|
switch (message->getCommand()) {
|
|
|
|
case MonitoringMessage::LIMIT_VIOLATION_REPORT: {
|
2021-06-05 19:52:38 +02:00
|
|
|
StorageManagerIF *ipcStore = ObjectManager::instance()->get<StorageManagerIF>(
|
2016-06-15 23:48:41 +02:00
|
|
|
objects::IPC_STORE);
|
|
|
|
if (ipcStore != NULL) {
|
|
|
|
ipcStore->deleteData(getStoreId(message));
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|