1
0
forked from fsfw/fsfw

adapting tmtc bridge

This commit is contained in:
2020-04-23 10:20:19 +02:00
parent db535e25f2
commit c075e1bf23
2 changed files with 45 additions and 15 deletions

View File

@ -16,8 +16,11 @@ class TmTcBridge : public AcceptsTelemetryIF,
public SystemObject {
public:
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;
static constexpr uint8_t LIMIT_STORED_DATA_SENT_PER_CYCLE = 15;
static constexpr uint8_t LIMIT_DOWNLINK_PACKETS_STORED = 20;
static constexpr uint8_t DEFAULT_STORED_DATA_SENT_PER_CYCLE = 5;
static constexpr uint8_t DEFAULT_DOWNLINK_PACKETS_STORED = 10;
TmTcBridge(object_id_t objectId_, object_id_t ccsdsPacketDistributor_);
virtual ~TmTcBridge();
@ -31,6 +34,15 @@ public:
*/
ReturnValue_t setNumberOfSentPacketsPerCycle(uint8_t sentPacketsPerCycle);
/**
* Set number of packets sent per performOperation().Please note that this
* value must be smaller than MAX_DOWNLINK_PACKETS_STORED
* @param sentPacketsPerCycle
* @return -@c RETURN_OK if value was set successfully
* -@c RETURN_FAILED otherwise, stored value stays the same
*/
ReturnValue_t setMaxNumberOfPacketsStored(uint8_t maxNumberOfPacketsStored);
void registerCommConnect();
void registerCommDisconnect();
@ -94,7 +106,13 @@ protected:
* Read the TM Queue and send TM if necessary. Default implementation provided
* @return
*/
virtual ReturnValue_t readTmQueue();
virtual ReturnValue_t handleTmQueue();
/**
* Send stored data if communication link is active
* @return
*/
virtual ReturnValue_t handleStoredTm();
/**
* Implemented by child class. Perform sending of Telemetry by implementing
@ -112,11 +130,6 @@ protected:
*/
virtual ReturnValue_t storeDownlinkData(TmTcMessage * message);
/**
* Send stored data if communication link is active
* @return
*/
ReturnValue_t sendStoredTm();
/**
* Print data as hexidecimal array
@ -126,8 +139,9 @@ protected:
void printData(uint8_t * data, size_t dataLen);
private:
FIFO<store_address_t, MAX_DOWNLINK_PACKETS_STORED> fifo;
uint8_t sentPacketsPerCycle = 10;
FIFO<store_address_t, LIMIT_DOWNLINK_PACKETS_STORED> fifo;
uint8_t sentPacketsPerCycle = DEFAULT_STORED_DATA_SENT_PER_CYCLE;
uint8_t maxNumberOfPacketsStored = DEFAULT_DOWNLINK_PACKETS_STORED;
};