Merge branch 'mueller_framework' of https://egit.irs.uni-stuttgart.de/KSat/fsfw into mueller_framework

This commit is contained in:
Robin Müller 2020-01-09 12:50:00 +01:00
commit 0ddc44062d
7 changed files with 25 additions and 16 deletions

View File

@ -16,8 +16,8 @@ template<typename key_t, typename T>
class FixedMap: public SerializeIF {
public:
static const uint8_t INTERFACE_ID = CLASS_ID::FIXED_MAP;
static const ReturnValue_t KEY_ALREADY_EXISTS = MAKE_RETURN_CODE(0x01);
static const ReturnValue_t MAP_FULL = MAKE_RETURN_CODE(0x02);
static const ReturnValue_t KEY_ALREADY_EXISTS = MAKE_RETURN_CODE(0x01); //!< P1: SID for HK packets
static const ReturnValue_t MAP_FULL = MAKE_RETURN_CODE(0x02); //!< P1: SID for HK packets
static const ReturnValue_t KEY_DOES_NOT_EXIST = MAKE_RETURN_CODE(0x03);
private:
@ -88,10 +88,10 @@ public:
ReturnValue_t insert(key_t key, T value, Iterator *storedValue = NULL) {
if (exists(key) == HasReturnvaluesIF::RETURN_OK) {
return KEY_ALREADY_EXISTS;
return FixedMap::KEY_ALREADY_EXISTS;
}
if (_size == theMap.maxSize()) {
return MAP_FULL;
return FixedMap::MAP_FULL;
}
theMap[_size].first = key;
theMap[_size].second = value;

View File

@ -10,7 +10,7 @@
template<typename key_t, typename T, typename KEY_COMPARE = std::less<key_t>>
class FixedOrderedMultimap {
public:
static const uint8_t INTERFACE_ID = CLASS_ID::FIXED_MAP;
static const uint8_t INTERFACE_ID = CLASS_ID::FIXED_MULTIMAP;
static const ReturnValue_t KEY_ALREADY_EXISTS = MAKE_RETURN_CODE(0x01);
static const ReturnValue_t MAP_FULL = MAKE_RETURN_CODE(0x02);
static const ReturnValue_t KEY_DOES_NOT_EXIST = MAKE_RETURN_CODE(0x03);

View File

@ -24,6 +24,7 @@ enum {
MEMORY_HELPER, //MH
SERIALIZE_IF, //SE
FIXED_MAP, //FM
FIXED_MULTIMAP, //FMM
HAS_HEALTH_IF, //HHI
FIFO_CLASS, //FF
MESSAGE_PROXY, //MQP

View File

@ -96,10 +96,10 @@ uint8_t * SerialBufferAdapter<T>::getBuffer() {
return buffer;
}
//template<typename T>
//void SerialBufferAdapter<T>::setBuffer(uint8_t * buffer_) {
// buffer = buffer_;
//}
template<typename T>
void SerialBufferAdapter<T>::setBuffer(uint8_t * buffer_) {
buffer = buffer_;
}
//forward Template declaration for linker
template class SerialBufferAdapter<uint8_t>;

View File

@ -56,7 +56,7 @@ public:
bool bigEndian);
uint8_t * getBuffer();
//void setBuffer(uint8_t * buffer_);
void setBuffer(uint8_t * buffer_);
private:
bool serializeLength;
const uint8_t *constBuffer;

View File

@ -46,13 +46,20 @@ public:
*/
virtual ~PusServiceBase();
/**
* The handleRequest method shall handle any kind of Telecommand Request immediately.
* @brief The handleRequest method shall handle any kind of Telecommand Request immediately.
* @details
* Implemetations can take the Telecommand in currentPacket and perform any kind of operation.
* They may send additional "Start Success (1,3)" messages with the verifyReporter, but Completion
* Success or Failure Reports are generated automatically after execution of this method.
* If a Telecommand can not be executed within one call cycle, this Base class is not the right parent.
* The child class may add additional error information in #errorParameters which are attached to the generated
* verification message. Subservice checking should be implemented in this method.
*
* If a Telecommand can not be executed within one call cycle,
* this Base class is not the right parent.
*
* The child class may add additional error information by setting #errorParameters which are
* attached to the generated verification message.
*
* Subservice checking should be implemented in this method.
*
* @return The returned status_code is directly taken as main error code in the Verification Report.
* On success, RETURN_OK shall be returned.
*/
@ -91,7 +98,8 @@ protected:
/**
* One of two error parameters for additional error information.
*/
uint8_t errorParameter2;
// shouldn't this be uint32_t ? The PUS Verification Message structure param2 has the size 4
uint32_t errorParameter2;
/**
* This is a complete instance of the Telecommand reception queue of the class.
* It is initialized on construction of the class.

View File

@ -115,7 +115,7 @@ protected:
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 = 20;
static const uint8_t MAX_DOWNLINK_PACKETS_STORED = 15;
FIFO<store_address_t, MAX_DOWNLINK_PACKETS_STORED> fifo;
uint8_t * recvBuffer;