receiveTc function adapted

This commit is contained in:
Robin Müller 2020-01-01 16:54:05 +01:00
parent a762c159fe
commit c73cb90c36
2 changed files with 7 additions and 3 deletions

View File

@ -14,7 +14,7 @@
TmTcBridge::TmTcBridge(object_id_t objectId_, object_id_t ccsdsPacketDistributor_):
SystemObject(objectId_),tcStore(NULL), tmStore(NULL),
ccsdsPacketDistributor(ccsdsPacketDistributor_), communicationLinkUp(false),
tmStored(false) {
tmStored(false), size(0) {
TmTcReceptionQueue = QueueFactory::instance()->
createMessageQueue(TMTC_RECEPTION_QUEUE_DEPTH);
@ -55,7 +55,7 @@ ReturnValue_t TmTcBridge::performOperation(uint8_t operationCode) {
}
ReturnValue_t TmTcBridge::handleTc() {
ReturnValue_t result = receiveTc();
ReturnValue_t result = receiveTc(&recvBuffer, &size);
return result;
}

View File

@ -62,9 +62,11 @@ protected:
/**
* Implemented by child class. Perform receiving of Telecommand, for example by implementing
* specific drivers or wrappers, e.g. UART Communication or lwIP stack
* @param recvBuffer [out] Received data
* @param size [out] Size of received data
* @return
*/
virtual ReturnValue_t receiveTc() = 0;
virtual ReturnValue_t receiveTc(uint8_t ** recvBuffer, uint32_t * size) = 0;
/**
* Handle Telemetry. Default implementation provided.
@ -117,6 +119,8 @@ private:
static const uint8_t MAX_DOWNLINK_PACKETS_STORED = 20;
FIFO<store_address_t, MAX_DOWNLINK_PACKETS_STORED> fifo;
uint8_t * recvBuffer;
uint32_t size;
};