mueller_TmTcBridge_cherryPicked #40

Merged
muellerr merged 30 commits from KSat/fsfw:mueller_TmTcBridge_cherryPicked into master 2020-07-07 12:06:47 +02:00
2 changed files with 22 additions and 21 deletions
Showing only changes of commit 98c0b2c9ac - Show all commits

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. "
Outdated
Review

can this be moved to debug? we try to keep info as clean as possible

can this be moved to debug? we try to keep info as clean as possible
Review

done

done
"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."
Outdated
Review

this might be better in the error stream

this might be better in the error stream
Review

done

done

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;
};