Some bugfixes(?) for PusServiceBase.
Getter Function for Serial Buffer Adapter.
This commit is contained in:
parent
0a57103339
commit
827f185e20
@ -16,8 +16,8 @@ template<typename key_t, typename T>
|
|||||||
class FixedMap: public SerializeIF {
|
class FixedMap: public SerializeIF {
|
||||||
public:
|
public:
|
||||||
static const uint8_t INTERFACE_ID = CLASS_ID::FIXED_MAP;
|
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 KEY_ALREADY_EXISTS = MAKE_RETURN_CODE(0x01); //!< P1: SID for HK packets
|
||||||
static const ReturnValue_t MAP_FULL = MAKE_RETURN_CODE(0x02);
|
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);
|
static const ReturnValue_t KEY_DOES_NOT_EXIST = MAKE_RETURN_CODE(0x03);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@ -88,10 +88,10 @@ public:
|
|||||||
|
|
||||||
ReturnValue_t insert(key_t key, T value, Iterator *storedValue = NULL) {
|
ReturnValue_t insert(key_t key, T value, Iterator *storedValue = NULL) {
|
||||||
if (exists(key) == HasReturnvaluesIF::RETURN_OK) {
|
if (exists(key) == HasReturnvaluesIF::RETURN_OK) {
|
||||||
return KEY_ALREADY_EXISTS;
|
return FixedMap::KEY_ALREADY_EXISTS;
|
||||||
}
|
}
|
||||||
if (_size == theMap.maxSize()) {
|
if (_size == theMap.maxSize()) {
|
||||||
return MAP_FULL;
|
return FixedMap::MAP_FULL;
|
||||||
}
|
}
|
||||||
theMap[_size].first = key;
|
theMap[_size].first = key;
|
||||||
theMap[_size].second = value;
|
theMap[_size].second = value;
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
template<typename key_t, typename T, typename KEY_COMPARE = std::less<key_t>>
|
template<typename key_t, typename T, typename KEY_COMPARE = std::less<key_t>>
|
||||||
class FixedOrderedMultimap {
|
class FixedOrderedMultimap {
|
||||||
public:
|
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 KEY_ALREADY_EXISTS = MAKE_RETURN_CODE(0x01);
|
||||||
static const ReturnValue_t MAP_FULL = MAKE_RETURN_CODE(0x02);
|
static const ReturnValue_t MAP_FULL = MAKE_RETURN_CODE(0x02);
|
||||||
static const ReturnValue_t KEY_DOES_NOT_EXIST = MAKE_RETURN_CODE(0x03);
|
static const ReturnValue_t KEY_DOES_NOT_EXIST = MAKE_RETURN_CODE(0x03);
|
||||||
|
@ -24,6 +24,7 @@ enum {
|
|||||||
MEMORY_HELPER, //MH
|
MEMORY_HELPER, //MH
|
||||||
SERIALIZE_IF, //SE
|
SERIALIZE_IF, //SE
|
||||||
FIXED_MAP, //FM
|
FIXED_MAP, //FM
|
||||||
|
FIXED_MULTIMAP, //FMM
|
||||||
HAS_HEALTH_IF, //HHI
|
HAS_HEALTH_IF, //HHI
|
||||||
FIFO_CLASS, //FF
|
FIFO_CLASS, //FF
|
||||||
MESSAGE_PROXY, //MQP
|
MESSAGE_PROXY, //MQP
|
||||||
|
@ -96,10 +96,10 @@ uint8_t * SerialBufferAdapter<T>::getBuffer() {
|
|||||||
return buffer;
|
return buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
//template<typename T>
|
template<typename T>
|
||||||
//void SerialBufferAdapter<T>::setBuffer(uint8_t * buffer_) {
|
void SerialBufferAdapter<T>::setBuffer(uint8_t * buffer_) {
|
||||||
// buffer = buffer_;
|
buffer = buffer_;
|
||||||
//}
|
}
|
||||||
|
|
||||||
//forward Template declaration for linker
|
//forward Template declaration for linker
|
||||||
template class SerialBufferAdapter<uint8_t>;
|
template class SerialBufferAdapter<uint8_t>;
|
||||||
|
@ -56,7 +56,7 @@ public:
|
|||||||
bool bigEndian);
|
bool bigEndian);
|
||||||
|
|
||||||
uint8_t * getBuffer();
|
uint8_t * getBuffer();
|
||||||
//void setBuffer(uint8_t * buffer_);
|
void setBuffer(uint8_t * buffer_);
|
||||||
private:
|
private:
|
||||||
bool serializeLength;
|
bool serializeLength;
|
||||||
const uint8_t *constBuffer;
|
const uint8_t *constBuffer;
|
||||||
|
@ -46,13 +46,20 @@ public:
|
|||||||
*/
|
*/
|
||||||
virtual ~PusServiceBase();
|
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.
|
* 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
|
* 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.
|
* 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
|
* If a Telecommand can not be executed within one call cycle,
|
||||||
* verification message. Subservice checking should be implemented in this method.
|
* 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.
|
* @return The returned status_code is directly taken as main error code in the Verification Report.
|
||||||
* On success, RETURN_OK shall be returned.
|
* On success, RETURN_OK shall be returned.
|
||||||
*/
|
*/
|
||||||
@ -91,7 +98,8 @@ protected:
|
|||||||
/**
|
/**
|
||||||
* One of two error parameters for additional error information.
|
* 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.
|
* This is a complete instance of the Telecommand reception queue of the class.
|
||||||
* It is initialized on construction of the class.
|
* It is initialized on construction of the class.
|
||||||
|
Loading…
Reference in New Issue
Block a user