added reordering of ctor arguments
This commit is contained in:
parent
4819bad402
commit
7bc7e06277
@ -1,22 +1,22 @@
|
|||||||
#include <framework/objectmanager/ObjectManagerIF.h>
|
#include <framework/objectmanager/ObjectManagerIF.h>
|
||||||
#include <framework/serviceinterface/ServiceInterfaceStream.h>
|
#include <framework/serviceinterface/ServiceInterfaceStream.h>
|
||||||
#include <framework/tmtcpacket/pus/TcPacketStored.h>
|
#include <framework/tmtcpacket/pus/TcPacketStored.h>
|
||||||
#include <string.h>
|
#include <cstring>
|
||||||
|
|
||||||
TcPacketStored::TcPacketStored(store_address_t setAddress) :
|
TcPacketStored::TcPacketStored(store_address_t setAddress) :
|
||||||
TcPacketBase(NULL), storeAddress(setAddress) {
|
TcPacketBase(nullptr), storeAddress(setAddress) {
|
||||||
this->setStoreAddress(this->storeAddress);
|
this->setStoreAddress(this->storeAddress);
|
||||||
}
|
}
|
||||||
|
|
||||||
TcPacketStored::TcPacketStored(uint16_t apid, uint8_t ack, uint8_t service,
|
TcPacketStored::TcPacketStored(uint8_t service, uint8_t subservice,
|
||||||
uint8_t subservice, uint8_t sequence_count, const uint8_t* data,
|
uint16_t apid, uint8_t sequence_count, const uint8_t* data,
|
||||||
uint32_t size) :
|
size_t size, uint8_t ack ) :
|
||||||
TcPacketBase(NULL) {
|
TcPacketBase(nullptr) {
|
||||||
this->storeAddress.raw = StorageManagerIF::INVALID_ADDRESS;
|
this->storeAddress.raw = StorageManagerIF::INVALID_ADDRESS;
|
||||||
if (!this->checkAndSetStore()) {
|
if (!this->checkAndSetStore()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
uint8_t* p_data = NULL;
|
uint8_t* p_data = nullptr;
|
||||||
ReturnValue_t returnValue = this->store->getFreeElement(&this->storeAddress,
|
ReturnValue_t returnValue = this->store->getFreeElement(&this->storeAddress,
|
||||||
(TC_PACKET_MIN_SIZE + size), &p_data);
|
(TC_PACKET_MIN_SIZE + size), &p_data);
|
||||||
if (returnValue != this->store->RETURN_OK) {
|
if (returnValue != this->store->RETURN_OK) {
|
||||||
@ -59,7 +59,7 @@ bool TcPacketStored::checkAndSetStore() {
|
|||||||
void TcPacketStored::setStoreAddress(store_address_t setAddress) {
|
void TcPacketStored::setStoreAddress(store_address_t setAddress) {
|
||||||
this->storeAddress = setAddress;
|
this->storeAddress = setAddress;
|
||||||
const uint8_t* temp_data = NULL;
|
const uint8_t* temp_data = NULL;
|
||||||
uint32_t temp_size;
|
size_t temp_size;
|
||||||
ReturnValue_t status = StorageManagerIF::RETURN_FAILED;
|
ReturnValue_t status = StorageManagerIF::RETURN_FAILED;
|
||||||
if (this->checkAndSetStore()) {
|
if (this->checkAndSetStore()) {
|
||||||
status = this->store->getData(this->storeAddress, &temp_data,
|
status = this->store->getData(this->storeAddress, &temp_data,
|
||||||
@ -79,7 +79,7 @@ store_address_t TcPacketStored::getStoreAddress() {
|
|||||||
|
|
||||||
bool TcPacketStored::isSizeCorrect() {
|
bool TcPacketStored::isSizeCorrect() {
|
||||||
const uint8_t* temp_data = NULL;
|
const uint8_t* temp_data = NULL;
|
||||||
uint32_t temp_size;
|
size_t temp_size;
|
||||||
ReturnValue_t status = this->store->getData(this->storeAddress, &temp_data,
|
ReturnValue_t status = this->store->getData(this->storeAddress, &temp_data,
|
||||||
&temp_size);
|
&temp_size);
|
||||||
if (status == StorageManagerIF::RETURN_OK) {
|
if (status == StorageManagerIF::RETURN_OK) {
|
||||||
|
@ -64,7 +64,9 @@ public:
|
|||||||
* @param data The data to be copied to the Application Data Field.
|
* @param data The data to be copied to the Application Data Field.
|
||||||
* @param size The amount of data to be copied.
|
* @param size The amount of data to be copied.
|
||||||
*/
|
*/
|
||||||
TcPacketStored( uint16_t apid, uint8_t ack, uint8_t service, uint8_t subservice, uint8_t sequence_count = 0, const uint8_t* data = NULL, uint32_t size = 0 );
|
TcPacketStored( uint8_t service, uint8_t subservice, uint16_t apid,
|
||||||
|
uint8_t sequence_count = 0, const uint8_t* data = nullptr,
|
||||||
|
size_t size = 0, uint8_t ack = TcPacketBase::ACK_ALL );
|
||||||
/**
|
/**
|
||||||
* Another constructor to create a TcPacket from a raw packet stream.
|
* Another constructor to create a TcPacket from a raw packet stream.
|
||||||
* Takes the data and adds it unchecked to the TcStore.
|
* Takes the data and adds it unchecked to the TcStore.
|
||||||
|
Loading…
Reference in New Issue
Block a user