2020-08-13 20:53:35 +02:00
|
|
|
#include "TmTcMessage.h"
|
2020-12-14 21:30:39 +01:00
|
|
|
|
|
|
|
#include <cstring>
|
2016-06-15 23:48:41 +02:00
|
|
|
|
|
|
|
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
2020-12-14 21:30:39 +01:00
|
|
|
TmTcMessage::TmTcMessage(store_address_t storeId) {
|
2016-06-15 23:48:41 +02:00
|
|
|
this->messageSize += sizeof(store_address_t);
|
2020-12-14 21:30:39 +01:00
|
|
|
this->setStorageId(storeId);
|
2016-06-15 23:48:41 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
size_t TmTcMessage::getMinimumMessageSize() {
|
|
|
|
return this->HEADER_SIZE + sizeof(store_address_t);
|
|
|
|
}
|
|
|
|
|
2020-12-14 21:30:39 +01:00
|
|
|
void TmTcMessage::setStorageId(store_address_t storeId) {
|
|
|
|
memcpy(this->getData(), &storeId, sizeof(store_address_t) );
|
2016-06-15 23:48:41 +02:00
|
|
|
}
|