fsfw/tmtcservices/TmTcMessage.cpp
2020-10-06 16:01:35 +02:00

30 lines
685 B
C++

#include "../tmtcservices/TmTcMessage.h"
#include <string.h>
TmTcMessage::TmTcMessage() {
this->messageSize += sizeof(store_address_t);
}
TmTcMessage::~TmTcMessage() {
}
store_address_t TmTcMessage::getStorageId() {
store_address_t temp_id;
memcpy(&temp_id, this->getData(), sizeof(store_address_t) );
return temp_id;
}
TmTcMessage::TmTcMessage(store_address_t storeId) {
this->messageSize += sizeof(store_address_t);
this->setStorageId(storeId);
}
size_t TmTcMessage::getMinimumMessageSize() {
return this->HEADER_SIZE + sizeof(store_address_t);
}
void TmTcMessage::setStorageId(store_address_t storeId) {
memcpy(this->getData(), &storeId, sizeof(store_address_t) );
}