Merge pull request 'some minor changes' (#291) from KSat/fsfw:mueller/datalinklayer-convergence into development
Reviewed-on: fsfw/fsfw#291
This commit is contained in:
commit
03e4504815
@ -1,10 +1,3 @@
|
|||||||
/**
|
|
||||||
* @file MapPacketExtraction.cpp
|
|
||||||
* @brief This file defines the MapPacketExtraction class.
|
|
||||||
* @date 26.03.2013
|
|
||||||
* @author baetz
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "MapPacketExtraction.h"
|
#include "MapPacketExtraction.h"
|
||||||
#include "../ipc/QueueFactory.h"
|
#include "../ipc/QueueFactory.h"
|
||||||
#include "../serviceinterface/ServiceInterfaceStream.h"
|
#include "../serviceinterface/ServiceInterfaceStream.h"
|
||||||
@ -12,14 +5,14 @@
|
|||||||
#include "../tmtcpacket/SpacePacketBase.h"
|
#include "../tmtcpacket/SpacePacketBase.h"
|
||||||
#include "../tmtcservices/AcceptsTelecommandsIF.h"
|
#include "../tmtcservices/AcceptsTelecommandsIF.h"
|
||||||
#include "../tmtcservices/TmTcMessage.h"
|
#include "../tmtcservices/TmTcMessage.h"
|
||||||
#include <string.h>
|
#include <cstring>
|
||||||
|
|
||||||
MapPacketExtraction::MapPacketExtraction(uint8_t setMapId,
|
MapPacketExtraction::MapPacketExtraction(uint8_t setMapId,
|
||||||
object_id_t setPacketDestination) :
|
object_id_t setPacketDestination) :
|
||||||
lastSegmentationFlag(NO_SEGMENTATION), mapId(setMapId), packetLength(0), bufferPosition(
|
lastSegmentationFlag(NO_SEGMENTATION), mapId(setMapId),
|
||||||
packetBuffer), packetDestination(setPacketDestination), packetStore(
|
bufferPosition(packetBuffer), packetDestination(setPacketDestination),
|
||||||
NULL), tcQueueId(MessageQueueIF::NO_QUEUE) {
|
tcQueueId(MessageQueueIF::NO_QUEUE) {
|
||||||
memset(packetBuffer, 0, sizeof(packetBuffer));
|
std::memset(packetBuffer, 0, sizeof(packetBuffer));
|
||||||
}
|
}
|
||||||
|
|
||||||
ReturnValue_t MapPacketExtraction::extractPackets(TcTransferFrame* frame) {
|
ReturnValue_t MapPacketExtraction::extractPackets(TcTransferFrame* frame) {
|
||||||
|
@ -1,12 +1,5 @@
|
|||||||
/**
|
#ifndef FSFW_DATALINKLAYER_MAPPACKETEXTRACTION_H_
|
||||||
* @file MapPacketExtraction.h
|
#define FSFW_DATALINKLAYER_MAPPACKETEXTRACTION_H_
|
||||||
* @brief This file defines the MapPacketExtraction class.
|
|
||||||
* @date 26.03.2013
|
|
||||||
* @author baetz
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef MAPPACKETEXTRACTION_H_
|
|
||||||
#define MAPPACKETEXTRACTION_H_
|
|
||||||
|
|
||||||
#include "MapPacketExtractionIF.h"
|
#include "MapPacketExtractionIF.h"
|
||||||
#include "../objectmanager/ObjectManagerIF.h"
|
#include "../objectmanager/ObjectManagerIF.h"
|
||||||
@ -20,17 +13,19 @@ class StorageManagerIF;
|
|||||||
* The class implements the full MAP Packet Extraction functionality as described in the CCSDS
|
* The class implements the full MAP Packet Extraction functionality as described in the CCSDS
|
||||||
* TC Space Data Link Protocol. It internally stores incomplete segmented packets until they are
|
* TC Space Data Link Protocol. It internally stores incomplete segmented packets until they are
|
||||||
* fully received. All found packets are forwarded to a single distribution entity.
|
* fully received. All found packets are forwarded to a single distribution entity.
|
||||||
|
* @author B. Baetz
|
||||||
*/
|
*/
|
||||||
class MapPacketExtraction: public MapPacketExtractionIF {
|
class MapPacketExtraction: public MapPacketExtractionIF {
|
||||||
private:
|
private:
|
||||||
static const uint32_t MAX_PACKET_SIZE = 4096;
|
static const uint32_t MAX_PACKET_SIZE = 4096;
|
||||||
uint8_t lastSegmentationFlag; //!< The segmentation flag of the last received frame.
|
uint8_t lastSegmentationFlag; //!< The segmentation flag of the last received frame.
|
||||||
uint8_t mapId; //!< MAP ID of this MAP Channel.
|
uint8_t mapId; //!< MAP ID of this MAP Channel.
|
||||||
uint32_t packetLength; //!< Complete length of the current Space Packet.
|
uint32_t packetLength = 0; //!< Complete length of the current Space Packet.
|
||||||
uint8_t* bufferPosition; //!< Position to write to in the internal Packet buffer.
|
uint8_t* bufferPosition; //!< Position to write to in the internal Packet buffer.
|
||||||
uint8_t packetBuffer[MAX_PACKET_SIZE]; //!< The internal Space Packet Buffer.
|
uint8_t packetBuffer[MAX_PACKET_SIZE]; //!< The internal Space Packet Buffer.
|
||||||
object_id_t packetDestination;
|
object_id_t packetDestination;
|
||||||
StorageManagerIF* packetStore; //!< Pointer to the store where full TC packets are stored.
|
//!< Pointer to the store where full TC packets are stored.
|
||||||
|
StorageManagerIF* packetStore = nullptr;
|
||||||
MessageQueueId_t tcQueueId; //!< QueueId to send found packets to the distributor.
|
MessageQueueId_t tcQueueId; //!< QueueId to send found packets to the distributor.
|
||||||
/**
|
/**
|
||||||
* Debug method to print the packet Buffer's content.
|
* Debug method to print the packet Buffer's content.
|
||||||
@ -75,4 +70,4 @@ public:
|
|||||||
uint8_t getMapId() const;
|
uint8_t getMapId() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* MAPPACKETEXTRACTION_H_ */
|
#endif /* FSFW_DATALINKLAYER_MAPPACKETEXTRACTION_H_ */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user