Merge remote-tracking branch 'upstream/master' into mueller_tcPacketBase
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
#include <framework/serviceinterface/ServiceInterfaceStream.h>
|
||||
#include <framework/tmtcpacket/ccsds_header.h>
|
||||
#include <framework/tmtcpacket/SpacePacket.h>
|
||||
#include "../serviceinterface/ServiceInterfaceStream.h"
|
||||
#include "ccsds_header.h"
|
||||
#include "SpacePacket.h"
|
||||
#include <string.h>
|
||||
|
||||
SpacePacket::SpacePacket( uint16_t packetDataLength, bool isTelecommand, uint16_t apid, uint16_t sequenceCount ):
|
||||
|
@ -1,7 +1,7 @@
|
||||
#ifndef SPACEPACKET_H_
|
||||
#define SPACEPACKET_H_
|
||||
|
||||
#include <framework/tmtcpacket/SpacePacketBase.h>
|
||||
#include "SpacePacketBase.h"
|
||||
|
||||
/**
|
||||
* The SpacePacket class is a representation of a simple CCSDS Space Packet
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include <framework/serviceinterface/ServiceInterfaceStream.h>
|
||||
#include <framework/tmtcpacket/SpacePacketBase.h>
|
||||
#include "../serviceinterface/ServiceInterfaceStream.h"
|
||||
#include "SpacePacketBase.h"
|
||||
#include <string.h>
|
||||
|
||||
SpacePacketBase::SpacePacketBase( const uint8_t* set_address ) {
|
||||
|
@ -1,7 +1,7 @@
|
||||
#ifndef SPACEPACKETBASE_H_
|
||||
#define SPACEPACKETBASE_H_
|
||||
|
||||
#include <framework/tmtcpacket/ccsds_header.h>
|
||||
#include "ccsds_header.h"
|
||||
#include <cstddef>
|
||||
|
||||
/**
|
||||
|
@ -1,9 +1,9 @@
|
||||
#ifndef FRAMEWORK_TMTCPACKET_PACKETMATCHER_APIDMATCHER_H_
|
||||
#define FRAMEWORK_TMTCPACKET_PACKETMATCHER_APIDMATCHER_H_
|
||||
|
||||
#include <framework/globalfunctions/matching/SerializeableMatcherIF.h>
|
||||
#include <framework/serialize/SerializeAdapter.h>
|
||||
#include <framework/tmtcpacket/pus/TmPacketMinimal.h>
|
||||
#include "../../globalfunctions/matching/SerializeableMatcherIF.h"
|
||||
#include "../../serialize/SerializeAdapter.h"
|
||||
#include "../../tmtcpacket/pus/TmPacketMinimal.h"
|
||||
|
||||
class ApidMatcher: public SerializeableMatcherIF<TmPacketMinimal*> {
|
||||
private:
|
||||
@ -22,16 +22,16 @@ public:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
ReturnValue_t serialize(uint8_t** buffer, uint32_t* size,
|
||||
const uint32_t max_size, bool bigEndian) const {
|
||||
return SerializeAdapter<uint16_t>::serialize(&apid, buffer, size, max_size, bigEndian);
|
||||
ReturnValue_t serialize(uint8_t** buffer, size_t* size,
|
||||
size_t maxSize, Endianness streamEndianness) const {
|
||||
return SerializeAdapter::serialize(&apid, buffer, size, maxSize, streamEndianness);
|
||||
}
|
||||
uint32_t getSerializedSize() const {
|
||||
return SerializeAdapter<uint16_t>::getSerializedSize(&apid);
|
||||
size_t getSerializedSize() const {
|
||||
return SerializeAdapter::getSerializedSize(&apid);
|
||||
}
|
||||
ReturnValue_t deSerialize(const uint8_t** buffer, int32_t* size,
|
||||
bool bigEndian) {
|
||||
return SerializeAdapter<uint16_t>::deSerialize(&apid, buffer, size, bigEndian);
|
||||
ReturnValue_t deSerialize(const uint8_t** buffer, size_t* size,
|
||||
Endianness streamEndianness) {
|
||||
return SerializeAdapter::deSerialize(&apid, buffer, size, streamEndianness);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
#include <framework/tmtcpacket/packetmatcher/ApidMatcher.h>
|
||||
#include <framework/tmtcpacket/packetmatcher/PacketMatchTree.h>
|
||||
#include <framework/tmtcpacket/packetmatcher/ServiceMatcher.h>
|
||||
#include <framework/tmtcpacket/packetmatcher/SubserviceMatcher.h>
|
||||
#include "ApidMatcher.h"
|
||||
#include "PacketMatchTree.h"
|
||||
#include "ServiceMatcher.h"
|
||||
#include "SubserviceMatcher.h"
|
||||
|
||||
PacketMatchTree::PacketMatchTree(Node* root) :
|
||||
MatchTree<TmPacketMinimal*>(root, 2), factoryBackend(0, POOL_SIZES,
|
||||
|
@ -1,10 +1,10 @@
|
||||
#ifndef FRAMEWORK_TMTCPACKET_PACKETMATCHER_PACKETMATCHTREE_H_
|
||||
#define FRAMEWORK_TMTCPACKET_PACKETMATCHER_PACKETMATCHTREE_H_
|
||||
|
||||
#include <framework/container/PlacementFactory.h>
|
||||
#include <framework/globalfunctions/matching/MatchTree.h>
|
||||
#include <framework/storagemanager/LocalPool.h>
|
||||
#include <framework/tmtcpacket/pus/TmPacketMinimal.h>
|
||||
#include "../../container/PlacementFactory.h"
|
||||
#include "../../globalfunctions/matching/MatchTree.h"
|
||||
#include "../../storagemanager/LocalPool.h"
|
||||
#include "../../tmtcpacket/pus/TmPacketMinimal.h"
|
||||
|
||||
class PacketMatchTree: public MatchTree<TmPacketMinimal*>, public HasReturnvaluesIF {
|
||||
public:
|
||||
|
@ -1,9 +1,9 @@
|
||||
#ifndef FRAMEWORK_TMTCPACKET_PACKETMATCHER_SERVICEMATCHER_H_
|
||||
#define FRAMEWORK_TMTCPACKET_PACKETMATCHER_SERVICEMATCHER_H_
|
||||
|
||||
#include <framework/globalfunctions/matching/SerializeableMatcherIF.h>
|
||||
#include <framework/serialize/SerializeAdapter.h>
|
||||
#include <framework/tmtcpacket/pus/TmPacketMinimal.h>
|
||||
#include "../../globalfunctions/matching/SerializeableMatcherIF.h"
|
||||
#include "../../serialize/SerializeAdapter.h"
|
||||
#include "../../tmtcpacket/pus/TmPacketMinimal.h"
|
||||
|
||||
class ServiceMatcher: public SerializeableMatcherIF<TmPacketMinimal*> {
|
||||
private:
|
||||
@ -22,16 +22,16 @@ public:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
ReturnValue_t serialize(uint8_t** buffer, uint32_t* size,
|
||||
const uint32_t max_size, bool bigEndian) const {
|
||||
return SerializeAdapter<uint8_t>::serialize(&service, buffer, size, max_size, bigEndian);
|
||||
ReturnValue_t serialize(uint8_t** buffer, size_t* size,
|
||||
size_t maxSize, Endianness streamEndianness) const {
|
||||
return SerializeAdapter::serialize(&service, buffer, size, maxSize, streamEndianness);
|
||||
}
|
||||
uint32_t getSerializedSize() const {
|
||||
return SerializeAdapter<uint8_t>::getSerializedSize(&service);
|
||||
size_t getSerializedSize() const {
|
||||
return SerializeAdapter::getSerializedSize(&service);
|
||||
}
|
||||
ReturnValue_t deSerialize(const uint8_t** buffer, int32_t* size,
|
||||
bool bigEndian) {
|
||||
return SerializeAdapter<uint8_t>::deSerialize(&service, buffer, size, bigEndian);
|
||||
ReturnValue_t deSerialize(const uint8_t** buffer, size_t* size,
|
||||
Endianness streamEndianness) {
|
||||
return SerializeAdapter::deSerialize(&service, buffer, size, streamEndianness);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -1,9 +1,9 @@
|
||||
#ifndef FRAMEWORK_TMTCPACKET_PACKETMATCHER_SUBSERVICEMATCHER_H_
|
||||
#define FRAMEWORK_TMTCPACKET_PACKETMATCHER_SUBSERVICEMATCHER_H_
|
||||
|
||||
#include <framework/globalfunctions/matching/SerializeableMatcherIF.h>
|
||||
#include <framework/serialize/SerializeAdapter.h>
|
||||
#include <framework/tmtcpacket/pus/TmPacketMinimal.h>
|
||||
#include "../../globalfunctions/matching/SerializeableMatcherIF.h"
|
||||
#include "../../serialize/SerializeAdapter.h"
|
||||
#include "../../tmtcpacket/pus/TmPacketMinimal.h"
|
||||
|
||||
class SubServiceMatcher: public SerializeableMatcherIF<TmPacketMinimal*> {
|
||||
public:
|
||||
@ -20,16 +20,16 @@ public:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
ReturnValue_t serialize(uint8_t** buffer, uint32_t* size,
|
||||
const uint32_t max_size, bool bigEndian) const {
|
||||
return SerializeAdapter<uint8_t>::serialize(&subService, buffer, size, max_size, bigEndian);
|
||||
ReturnValue_t serialize(uint8_t** buffer, size_t* size,
|
||||
size_t maxSize, Endianness streamEndianness) const {
|
||||
return SerializeAdapter::serialize(&subService, buffer, size, maxSize, streamEndianness);
|
||||
}
|
||||
uint32_t getSerializedSize() const {
|
||||
return SerializeAdapter<uint8_t>::getSerializedSize(&subService);
|
||||
size_t getSerializedSize() const {
|
||||
return SerializeAdapter::getSerializedSize(&subService);
|
||||
}
|
||||
ReturnValue_t deSerialize(const uint8_t** buffer, int32_t* size,
|
||||
bool bigEndian) {
|
||||
return SerializeAdapter<uint8_t>::deSerialize(&subService, buffer, size, bigEndian);
|
||||
ReturnValue_t deSerialize(const uint8_t** buffer, size_t* size,
|
||||
Endianness streamEndianness) {
|
||||
return SerializeAdapter::deSerialize(&subService, buffer, size, streamEndianness);
|
||||
}
|
||||
private:
|
||||
uint8_t subService;
|
||||
|
@ -1,7 +1,7 @@
|
||||
#ifndef FRAMEWORK_TMTCPACKET_PUS_PACKETTIMESTAMPINTERPRETERIF_H_
|
||||
#define FRAMEWORK_TMTCPACKET_PUS_PACKETTIMESTAMPINTERPRETERIF_H_
|
||||
|
||||
#include <framework/returnvalues/HasReturnvaluesIF.h>
|
||||
#include "../../returnvalues/HasReturnvaluesIF.h"
|
||||
class TmPacketMinimal;
|
||||
|
||||
class PacketTimestampInterpreterIF {
|
||||
|
@ -1,6 +1,6 @@
|
||||
#include <framework/globalfunctions/CRC.h>
|
||||
#include <framework/serviceinterface/ServiceInterfaceStream.h>
|
||||
#include <framework/tmtcpacket/pus/TcPacketBase.h>
|
||||
#include "../../globalfunctions/CRC.h"
|
||||
#include "../../serviceinterface/ServiceInterfaceStream.h"
|
||||
#include "TcPacketBase.h"
|
||||
#include <string.h>
|
||||
|
||||
TcPacketBase::TcPacketBase(const uint8_t* set_data) :
|
||||
|
@ -1,9 +1,10 @@
|
||||
#ifndef TCPACKETBASE_H_
|
||||
#define TCPACKETBASE_H_
|
||||
|
||||
#include <framework/tmtcpacket/SpacePacketBase.h>
|
||||
#include "../../tmtcpacket/SpacePacketBase.h"
|
||||
#include <cstddef>
|
||||
|
||||
|
||||
/**
|
||||
* This struct defines a byte-wise structured PUS TC Data Field Header.
|
||||
* Any optional fields in the header must be added or removed here.
|
||||
|
@ -1,7 +1,6 @@
|
||||
#include <framework/objectmanager/ObjectManagerIF.h>
|
||||
#include <framework/serviceinterface/ServiceInterfaceStream.h>
|
||||
#include <framework/tmtcpacket/pus/TcPacketStored.h>
|
||||
|
||||
#include "../../objectmanager/ObjectManagerIF.h"
|
||||
#include "../../serviceinterface/ServiceInterfaceStream.h"
|
||||
#include "TcPacketStored.h"
|
||||
#include <cstring>
|
||||
|
||||
TcPacketStored::TcPacketStored(store_address_t setAddress) :
|
||||
|
@ -1,8 +1,8 @@
|
||||
#ifndef TCPACKETSTORED_H_
|
||||
#define TCPACKETSTORED_H_
|
||||
|
||||
#include <framework/storagemanager/StorageManagerIF.h>
|
||||
#include <framework/tmtcpacket/pus/TcPacketBase.h>
|
||||
#include "../../storagemanager/StorageManagerIF.h"
|
||||
#include "TcPacketBase.h"
|
||||
|
||||
/**
|
||||
* This class generates a ECSS PUS Telecommand packet within a given
|
||||
|
@ -1,8 +1,8 @@
|
||||
#include <framework/globalfunctions/CRC.h>
|
||||
#include <framework/objectmanager/ObjectManagerIF.h>
|
||||
#include <framework/serviceinterface/ServiceInterfaceStream.h>
|
||||
#include <framework/tmtcpacket/pus/TmPacketBase.h>
|
||||
#include <framework/timemanager/CCSDSTime.h>
|
||||
#include "../../globalfunctions/CRC.h"
|
||||
#include "../../objectmanager/ObjectManagerIF.h"
|
||||
#include "../../serviceinterface/ServiceInterfaceStream.h"
|
||||
#include "TmPacketBase.h"
|
||||
#include "../../timemanager/CCSDSTime.h"
|
||||
#include <string.h>
|
||||
|
||||
TmPacketBase::TmPacketBase(uint8_t* set_data) :
|
||||
|
@ -1,10 +1,10 @@
|
||||
#ifndef TMPACKETBASE_H_
|
||||
#define TMPACKETBASE_H_
|
||||
|
||||
#include <framework/timemanager/TimeStamperIF.h>
|
||||
#include <framework/tmtcpacket/SpacePacketBase.h>
|
||||
#include <framework/timemanager/Clock.h>
|
||||
#include <framework/objectmanager/SystemObjectIF.h>
|
||||
#include "../../timemanager/TimeStamperIF.h"
|
||||
#include "../../tmtcpacket/SpacePacketBase.h"
|
||||
#include "../../timemanager/Clock.h"
|
||||
#include "../../objectmanager/SystemObjectIF.h"
|
||||
|
||||
namespace Factory{
|
||||
void setStaticFrameworkObjectIds();
|
||||
|
@ -1,7 +1,7 @@
|
||||
#include <framework/tmtcpacket/pus/TmPacketMinimal.h>
|
||||
#include "TmPacketMinimal.h"
|
||||
#include <stddef.h>
|
||||
#include <time.h>
|
||||
#include <framework/tmtcpacket/pus/PacketTimestampInterpreterIF.h>
|
||||
#include "PacketTimestampInterpreterIF.h"
|
||||
|
||||
TmPacketMinimal::TmPacketMinimal(const uint8_t* set_data) : SpacePacketBase( set_data ) {
|
||||
this->tm_data = (TmPacketMinimalPointer*)set_data;
|
||||
|
@ -2,8 +2,8 @@
|
||||
#define FRAMEWORK_TMTCPACKET_PUS_TMPACKETMINIMAL_H_
|
||||
|
||||
|
||||
#include <framework/tmtcpacket/SpacePacketBase.h>
|
||||
#include <framework/returnvalues/HasReturnvaluesIF.h>
|
||||
#include "../../tmtcpacket/SpacePacketBase.h"
|
||||
#include "../../returnvalues/HasReturnvaluesIF.h"
|
||||
|
||||
struct timeval;
|
||||
class PacketTimestampInterpreterIF;
|
||||
|
@ -1,7 +1,7 @@
|
||||
#include <framework/objectmanager/ObjectManagerIF.h>
|
||||
#include <framework/serviceinterface/ServiceInterfaceStream.h>
|
||||
#include <framework/tmtcpacket/pus/TmPacketStored.h>
|
||||
#include <framework/tmtcservices/TmTcMessage.h>
|
||||
#include "../../objectmanager/ObjectManagerIF.h"
|
||||
#include "../../serviceinterface/ServiceInterfaceStream.h"
|
||||
#include "TmPacketStored.h"
|
||||
#include "../../tmtcservices/TmTcMessage.h"
|
||||
#include <string.h>
|
||||
|
||||
TmPacketStored::TmPacketStored(store_address_t setAddress) :
|
||||
@ -10,14 +10,14 @@ TmPacketStored::TmPacketStored(store_address_t setAddress) :
|
||||
}
|
||||
|
||||
TmPacketStored::TmPacketStored(uint16_t apid, uint8_t service,
|
||||
uint8_t subservice, uint8_t packetSubcounter, const uint8_t* data,
|
||||
uint32_t size, const uint8_t* headerData, uint32_t headerSize) :
|
||||
uint8_t subservice, uint8_t packetSubcounter, const uint8_t *data,
|
||||
uint32_t size, const uint8_t *headerData, uint32_t headerSize) :
|
||||
TmPacketBase(NULL) {
|
||||
storeAddress.raw = StorageManagerIF::INVALID_ADDRESS;
|
||||
if (!checkAndSetStore()) {
|
||||
return;
|
||||
}
|
||||
uint8_t* pData = NULL;
|
||||
uint8_t *pData = NULL;
|
||||
ReturnValue_t returnValue = store->getFreeElement(&storeAddress,
|
||||
(TmPacketBase::TM_PACKET_MIN_SIZE + size + headerSize), &pData);
|
||||
|
||||
@ -34,21 +34,21 @@ TmPacketStored::TmPacketStored(uint16_t apid, uint8_t service,
|
||||
}
|
||||
|
||||
TmPacketStored::TmPacketStored(uint16_t apid, uint8_t service,
|
||||
uint8_t subservice, uint8_t packetSubcounter, SerializeIF* content,
|
||||
SerializeIF* header) :
|
||||
uint8_t subservice, uint8_t packetSubcounter, SerializeIF *content,
|
||||
SerializeIF *header) :
|
||||
TmPacketBase(NULL) {
|
||||
storeAddress.raw = StorageManagerIF::INVALID_ADDRESS;
|
||||
if (!checkAndSetStore()) {
|
||||
return;
|
||||
}
|
||||
uint32_t sourceDataSize = 0;
|
||||
size_t sourceDataSize = 0;
|
||||
if (content != NULL) {
|
||||
sourceDataSize += content->getSerializedSize();
|
||||
}
|
||||
if (header != NULL) {
|
||||
sourceDataSize += header->getSerializedSize();
|
||||
}
|
||||
uint8_t* p_data = NULL;
|
||||
uint8_t *p_data = NULL;
|
||||
ReturnValue_t returnValue = store->getFreeElement(&storeAddress,
|
||||
(TmPacketBase::TM_PACKET_MIN_SIZE + sourceDataSize), &p_data);
|
||||
if (returnValue != store->RETURN_OK) {
|
||||
@ -56,13 +56,15 @@ TmPacketStored::TmPacketStored(uint16_t apid, uint8_t service,
|
||||
}
|
||||
setData(p_data);
|
||||
initializeTmPacket(apid, service, subservice, packetSubcounter);
|
||||
uint8_t* putDataHere = getSourceData();
|
||||
uint32_t size = 0;
|
||||
uint8_t *putDataHere = getSourceData();
|
||||
size_t size = 0;
|
||||
if (header != NULL) {
|
||||
header->serialize(&putDataHere, &size, sourceDataSize, true);
|
||||
header->serialize(&putDataHere, &size, sourceDataSize,
|
||||
SerializeIF::Endianness::BIG);
|
||||
}
|
||||
if (content != NULL) {
|
||||
content->serialize(&putDataHere, &size, sourceDataSize, true);
|
||||
content->serialize(&putDataHere, &size, sourceDataSize,
|
||||
SerializeIF::Endianness::BIG);
|
||||
}
|
||||
setPacketDataLength(
|
||||
sourceDataSize + sizeof(PUSTmDataFieldHeader) + CRC_SIZE - 1);
|
||||
@ -106,8 +108,8 @@ bool TmPacketStored::checkAndSetStore() {
|
||||
return true;
|
||||
}
|
||||
|
||||
StorageManagerIF* TmPacketStored::store = NULL;
|
||||
InternalErrorReporterIF* TmPacketStored::internalErrorReporter = NULL;
|
||||
StorageManagerIF *TmPacketStored::store = NULL;
|
||||
InternalErrorReporterIF *TmPacketStored::internalErrorReporter = NULL;
|
||||
|
||||
ReturnValue_t TmPacketStored::sendPacket(MessageQueueId_t destination,
|
||||
MessageQueueId_t sentFrom, bool doErrorReporting) {
|
||||
@ -116,7 +118,8 @@ ReturnValue_t TmPacketStored::sendPacket(MessageQueueId_t destination,
|
||||
return HasReturnvaluesIF::RETURN_FAILED;
|
||||
}
|
||||
TmTcMessage tmMessage(getStoreAddress());
|
||||
ReturnValue_t result = MessageQueueSenderIF::sendMessage(destination, &tmMessage, sentFrom);
|
||||
ReturnValue_t result = MessageQueueSenderIF::sendMessage(destination,
|
||||
&tmMessage, sentFrom);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
deletePacket();
|
||||
if (doErrorReporting) {
|
||||
|
@ -1,11 +1,11 @@
|
||||
#ifndef TMPACKETSTORED_H_
|
||||
#define TMPACKETSTORED_H_
|
||||
|
||||
#include <framework/serialize/SerializeIF.h>
|
||||
#include <framework/storagemanager/StorageManagerIF.h>
|
||||
#include <framework/tmtcpacket/pus/TmPacketBase.h>
|
||||
#include <framework/internalError/InternalErrorReporterIF.h>
|
||||
#include <framework/ipc/MessageQueueSenderIF.h>
|
||||
#include "../../serialize/SerializeIF.h"
|
||||
#include "../../storagemanager/StorageManagerIF.h"
|
||||
#include "TmPacketBase.h"
|
||||
#include "../../internalError/InternalErrorReporterIF.h"
|
||||
#include "../../ipc/MessageQueueSenderIF.h"
|
||||
|
||||
/**
|
||||
* This class generates a ECSS PUS Telemetry packet within a given
|
||||
|
Reference in New Issue
Block a user