null replaced by nullptr.

storeID initialization added, all nullptr/0 initializations in header
This commit is contained in:
Robin Müller 2020-04-18 13:16:00 +02:00
parent ad01a36c02
commit 98c0b2c9ac
2 changed files with 22 additions and 21 deletions

View File

@ -11,17 +11,15 @@
#include <framework/tmtcservices/AcceptsTelecommandsIF.h>
#include <framework/serviceinterface/ServiceInterfaceStream.h>
TmTcBridge::TmTcBridge(object_id_t objectId_, object_id_t ccsdsPacketDistributor_):
SystemObject(objectId_),tcStore(NULL), tmStore(NULL),
ccsdsPacketDistributor(ccsdsPacketDistributor_), communicationLinkUp(false),
tmStored(false),recvBuffer(NULL), size(0) {
TmTcReceptionQueue = QueueFactory::instance()->
TmTcBridge::TmTcBridge(object_id_t objectId_,
object_id_t ccsdsPacketDistributor_): SystemObject(objectId_),
ccsdsPacketDistributor(ccsdsPacketDistributor_)
{
TmTcReceptionQueue = QueueFactory::instance()->
createMessageQueue(TMTC_RECEPTION_QUEUE_DEPTH);
}
TmTcBridge::~TmTcBridge() {
}
TmTcBridge::~TmTcBridge() {}
ReturnValue_t TmTcBridge::initialize() {
tcStore = objectManager->get<StorageManagerIF>(objects::TC_STORE);
@ -75,7 +73,7 @@ ReturnValue_t TmTcBridge::handleTm() {
ReturnValue_t TmTcBridge::readTmQueue() {
TmTcMessage message;
const uint8_t* data = NULL;
const uint8_t* data = nullptr;
uint32_t size = 0;
for (ReturnValue_t result = TmTcReceptionQueue->receiveMessage(&message);
result == RETURN_OK; result = TmTcReceptionQueue->receiveMessage(&message))
@ -105,7 +103,7 @@ ReturnValue_t TmTcBridge::readTmQueue() {
ReturnValue_t TmTcBridge::storeDownlinkData(TmTcMessage *message) {
info << "TMTC Bridge: Comm Link down. "
"Saving packet ID to be sent later\r\n" << std::flush;
store_address_t storeId;
store_address_t storeId = 0;
if(fifo.full()) {
info << "TMTC Bridge: TM downlink max. number of stored packet IDs reached."

View File

@ -48,12 +48,15 @@ public:
void registerCommConnect();
void registerCommDisconnect();
protected:
MessageQueueIF* TmTcReceptionQueue; //!< Used to send and receive TMTC messages. TmTcMessage is used to transport messages between tasks.
StorageManagerIF* tcStore;
StorageManagerIF* tmStore;
object_id_t ccsdsPacketDistributor;
bool communicationLinkUp; //!< Used to specify whether communication link is up
bool tmStored;
//! Used to send and receive TMTC messages.
//! TmTcMessage is used to transport messages between tasks.
MessageQueueIF* TmTcReceptionQueue = nullptr;
StorageManagerIF* tcStore = nullptr;
StorageManagerIF* tmStore = nullptr;
object_id_t ccsdsPacketDistributor = 0;
//! Used to specify whether communication link is up
bool communicationLinkUp = false;
bool tmStored = false;
/**
* Handle TC reception. Default implementation provided
@ -113,13 +116,13 @@ protected:
void printData(uint8_t * data, uint32_t dataLen);
private:
static const uint8_t TMTC_RECEPTION_QUEUE_DEPTH = 20;
static const uint8_t MAX_STORED_DATA_SENT_PER_CYCLE = 10;
static const uint8_t MAX_DOWNLINK_PACKETS_STORED = 15;
static constexpr uint8_t TMTC_RECEPTION_QUEUE_DEPTH = 20;
static constexpr uint8_t MAX_STORED_DATA_SENT_PER_CYCLE = 10;
static constexpr uint8_t MAX_DOWNLINK_PACKETS_STORED = 15;
FIFO<store_address_t, MAX_DOWNLINK_PACKETS_STORED> fifo;
uint8_t * recvBuffer;
uint32_t size;
uint8_t * recvBuffer = nullptr;
uint32_t size = 0;
};