C++11 adaptions

This commit is contained in:
Robin Müller 2021-09-28 16:31:53 +02:00
parent 1622e23f1c
commit bf02f14772
2 changed files with 9 additions and 10 deletions

View File

@ -32,15 +32,6 @@ public:
*/
virtual ~SpacePacket();
static constexpr uint16_t getTcSpacePacketIdFromApid(uint16_t apid) {
uint16_t tcPacketId = (0x18 << 8) | (((apid >> 8) & 0x07) << 8) | (apid & 0x00ff);
return tcPacketId;
}
static constexpr uint16_t getTmSpacePacketIdFromApid(uint16_t apid) {
uint16_t tmPacketId = (0x08 << 8) | (((apid >> 8) & 0x07) << 8) | (apid & 0x00ff);
return tmPacketId;
}
/**
* With this call, the complete data content (including the CCSDS Primary
* Header) is overwritten with the byte stream given.
@ -78,4 +69,12 @@ protected:
SpacePacketData localData;
};
constexpr uint16_t getTcSpacePacketIdFromApid(uint16_t apid) {
return (0x18 << 8) | (((apid >> 8) & 0x07) << 8) | (apid & 0x00ff);
}
constexpr uint16_t getTmSpacePacketIdFromApid(uint16_t apid) {
return (0x08 << 8) | (((apid >> 8) & 0x07) << 8) | (apid & 0x00ff);
}
#endif /* SPACEPACKET_H_ */

View File

@ -21,7 +21,7 @@ public:
//! is the size of the PUS packet starting at that index.
using IndexSizePair = std::pair<size_t, size_t>;
static constexpr uint8_t INTERFACE_ID = CLASS_ID::PUS_PARSER;
static constexpr uint8_t INTERFACE_ID = CLASS_ID::SPACE_PACKET_PARSER;
static constexpr ReturnValue_t NO_PACKET_FOUND = MAKE_RETURN_CODE(0x00);
static constexpr ReturnValue_t SPLIT_PACKET = MAKE_RETURN_CODE(0x01);