2020-05-17 01:17:11 +02:00
|
|
|
#include <framework/housekeeping/HousekeepingMessage.h>
|
2020-06-13 17:37:48 +02:00
|
|
|
#include <cstring>
|
2020-05-17 01:17:11 +02:00
|
|
|
|
2020-06-13 17:37:48 +02:00
|
|
|
HousekeepingMessage::HousekeepingMessage(MessageQueueMessageIF* message):
|
|
|
|
CommandMessageBase(message) {
|
|
|
|
}
|
2020-06-08 01:22:21 +02:00
|
|
|
|
2020-06-13 17:37:48 +02:00
|
|
|
HousekeepingMessage::~HousekeepingMessage() {
|
|
|
|
}
|
2020-06-08 01:22:21 +02:00
|
|
|
|
2020-06-13 17:37:48 +02:00
|
|
|
void HousekeepingMessage::setHkReportMessage(sid_t sid,
|
|
|
|
store_address_t storeId) {
|
|
|
|
CommandMessageBase::setCommand(HK_REPORT);
|
|
|
|
setSid(sid);
|
|
|
|
setParameter(storeId.raw);
|
|
|
|
}
|
|
|
|
|
|
|
|
size_t HousekeepingMessage::getMinimumMessageSize() const {
|
|
|
|
return HK_MESSAGE_SIZE;
|
|
|
|
}
|
|
|
|
|
|
|
|
size_t HousekeepingMessage::getMaximumMessageSize() const {
|
|
|
|
return MessageQueueMessage::MAX_MESSAGE_SIZE;
|
|
|
|
}
|
|
|
|
|
|
|
|
void HousekeepingMessage::clear() {
|
|
|
|
// clear IPC store where it is needed.
|
|
|
|
}
|
|
|
|
|
|
|
|
sid_t HousekeepingMessage::getSid() const {
|
|
|
|
sid_t sid;
|
|
|
|
std::memcpy(&sid.raw, CommandMessageBase::getData(), sizeof(sid.raw));
|
|
|
|
return sid;
|
|
|
|
}
|
|
|
|
|
|
|
|
uint8_t* HousekeepingMessage::getData() {
|
|
|
|
return internalMessage->getBuffer() + sizeof(sid_t);
|
|
|
|
}
|
|
|
|
|
|
|
|
void HousekeepingMessage::setParameter(uint32_t parameter) {
|
|
|
|
memcpy(getData(), ¶meter, sizeof(parameter));
|
|
|
|
}
|
|
|
|
|
|
|
|
void HousekeepingMessage::setSid(sid_t sid) {
|
|
|
|
std::memcpy(CommandMessageBase::getData(), &sid.raw, sizeof(sid.raw));
|
|
|
|
}
|