1
0
forked from fsfw/fsfw

moved srv2 to framework

This commit is contained in:
2020-07-07 17:18:33 +02:00
parent 359163886b
commit 7698f3f13e
4 changed files with 359 additions and 16 deletions

View File

@ -0,0 +1,76 @@
#ifndef FRAMEWORK_PUS_SERVICEPACKETS_SERVICE2PACKETS_H_
#define FRAMEWORK_PUS_SERVICEPACKETS_SERVICE2PACKETS_H_
#include <framework/action/ActionMessage.h>
#include <framework/objectmanager/SystemObjectIF.h>
#include <framework/serialize/SerialLinkedListAdapter.h>
#include <framework/serviceinterface/ServiceInterfaceStream.h>
/**
* @brief Subservice 128
* @ingroup spacepackets
*/
class RawCommand { //!< [EXPORT] : [SUBSERVICE] 128
public:
RawCommand(const uint8_t* buffer, size_t size) {
// Deserialize Adapter to get correct endianness
SerializeAdapter::deSerialize(&objectId, &buffer, &size,
SerializeIF::Endianness::BIG);
commandBuffer = buffer;
// size is decremented by AutoSerializeAdapter,
// remaining size is data size
dataSize = size;
}
object_id_t getObjectId() const {
return objectId;
}
const uint8_t* getCommand() {
return commandBuffer;
}
size_t getCommandSize() const {
return dataSize;
}
private:
object_id_t objectId = 0;
const uint8_t* commandBuffer = nullptr; //!< [EXPORT] : [MAXSIZE] 256 Bytes
size_t dataSize = 0; //!< [EXPORT] : [IGNORE]
};
/**
* @brief Subservice 129: Command packet to set wiretapping mode
* @ingroup spacepackets
*/
class WiretappingToggle: public SerialLinkedListAdapter<SerializeIF>{ //!< [EXPORT] : [SUBSERVICE] 129
public:
static const size_t WIRETAPPING_COMMAND_SIZE = 5;
WiretappingToggle(){
setStart(&objectId);
objectId.setNext(&wiretappingMode);
}
uint8_t getWiretappingMode() const {
return wiretappingMode.entry;
}
private:
SerializeElement<object_id_t> objectId;
SerializeElement<uint8_t> wiretappingMode; //!< [EXPORT] : [INPUT] Mode 0: OFF, Mode 1: RAW
};
/**
* @brief Subservices 130 and 131: TM packets
* @ingroup spacepackets
*/
class WiretappingPacket { //!< [EXPORT] : [SUBSERVICE] 130, 131
public:
object_id_t objectId; //!< [EXPORT] : [COMMENT] Object ID of source object
const uint8_t* data; //!< [EXPORT] : [MAXSIZE] Raw Command Max. Size
WiretappingPacket(object_id_t objectId, const uint8_t* buffer):
objectId(objectId), data(buffer) {
}
};
#endif /* FRAMEWORK_PUS_SERVICEPACKETS_SERVICE2PACKETS_H_ */

View File

@ -1,17 +1,3 @@
/**
* \file Service5Packets.h
*
* Structure of Event Report.
* It consists of:
* 1. Report ID(RID). This is the Event ID in the FSFW
* 2. Object ID of the reporter (e.g. subsystem)
* 2. Parameter 1
* 3. Parameter 2
*
* Created on: 21.05.2019
* Author: R. Mueller, J. Meier
*/
#ifndef MISSION_PUS_SERVICEPACKETS_SERVICE5PACKETS_H_
#define MISSION_PUS_SERVICEPACKETS_SERVICE5PACKETS_H_
@ -20,8 +6,15 @@
/**
* \brief Subservice 1, 2, 3, 4
* \ingroup spacepackets
* @brief Subservice 1, 2, 3, 4
* Structure of Event Report.
* It consists of:
* 1. Report ID(RID). This is the Event ID in the FSFW
* 2. Object ID of the reporter (e.g. subsystem)
* 2. Parameter 1
* 3. Parameter 2
*
* @ingroup spacepackets
*/
class EventReport: public SerializeIF { //!< [EXPORT] : [SUBSERVICE] 1, 2, 3, 4
public: