Merge branch 'master' into mueller/DHB-update
This commit is contained in:
commit
30f4348bff
0
.gitmodules
vendored
Normal file
0
.gitmodules
vendored
Normal file
12
FSFWVersion.h
Normal file
12
FSFWVersion.h
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
#ifndef FSFW_DEFAULTCFG_VERSION_H_
|
||||||
|
#define FSFW_DEFAULTCFG_VERSION_H_
|
||||||
|
|
||||||
|
const char* const FSFW_VERSION_NAME = "ASTP";
|
||||||
|
|
||||||
|
#define FSFW_VERSION 0
|
||||||
|
#define FSFW_SUBVERSION 0
|
||||||
|
#define FSFW_REVISION 1
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#endif /* FSFW_DEFAULTCFG_VERSION_H_ */
|
2
NOTICE
2
NOTICE
@ -4,6 +4,8 @@ The initial version of the Flight Software Framework was developed during
|
|||||||
the Flying Laptop Project by the Universität Stuttgart in coorporation
|
the Flying Laptop Project by the Universität Stuttgart in coorporation
|
||||||
with Airbus Defence and Space GmbH.
|
with Airbus Defence and Space GmbH.
|
||||||
|
|
||||||
|
The supreme FSFW Logo was designed by Markus Koller and Luise Trilsbach.
|
||||||
|
|
||||||
Copyrights in the Flight Software Framework are retained by their contributors.
|
Copyrights in the Flight Software Framework are retained by their contributors.
|
||||||
No copyright assignment is required to contribute to the Flight Software Framework.
|
No copyright assignment is required to contribute to the Flight Software Framework.
|
||||||
|
|
||||||
|
159
README.md
Normal file
159
README.md
Normal file
@ -0,0 +1,159 @@
|
|||||||
|
![FSFW Logo](logo/FSFW_Logo_V3_bw.png)
|
||||||
|
# Flight Software Framework (FSFW)
|
||||||
|
|
||||||
|
The Flight Software Framework is a C++ Object Oriented Framework for unmanned,
|
||||||
|
automated systems like Satellites.
|
||||||
|
|
||||||
|
The initial version of the Flight Software Framework was developed during
|
||||||
|
the Flying Laptop Project by the University of Stuttgart in cooperation
|
||||||
|
with Airbus Defence and Space GmbH.
|
||||||
|
|
||||||
|
## Intended Use
|
||||||
|
|
||||||
|
The framework is designed for systems, which communicate with external devices, perform control loops, receive telecommands and send telemetry, and need to maintain a high level of availability.
|
||||||
|
Therefore, a mode and health system provides control over the states of the software and the controlled devices.
|
||||||
|
In addition, a simple mechanism of event based fault detection, isolation and recovery is implemented as well.
|
||||||
|
|
||||||
|
The recommended hardware is a microprocessor with more than 2 MB of RAM and 1 MB of non-volatile Memory.
|
||||||
|
For reference, current Applications use a Cobham Gaisler UT699 (LEON3FT), a ISISPACE IOBC or a Zynq-7020 SoC.
|
||||||
|
|
||||||
|
|
||||||
|
## Structure
|
||||||
|
|
||||||
|
The general structure is driven by the usage of interfaces provided by objects. The FSFW uses C++11 as baseline. The intention behind this is that this C++ Standard should be widely available, even with older compilers.
|
||||||
|
The FSFW uses dynamic allocation during the initialization but provides static containers during runtime.
|
||||||
|
This simplifies the instantiation of objects and allows the usage of some standard containers.
|
||||||
|
Dynamic Allocation after initialization is discouraged and different solutions are provided in the FSFW to achieve that.
|
||||||
|
The fsfw uses Run-time type information.
|
||||||
|
Exceptions are not allowed.
|
||||||
|
|
||||||
|
### Failure Handling
|
||||||
|
|
||||||
|
Functions should return a defined ReturnValue_t to signal to the caller that something is gone wrong.
|
||||||
|
Returnvalues must be unique. For this the function HasReturnvaluesIF::makeReturnCode or the Macro MAKE_RETURN can be used.
|
||||||
|
The CLASS_ID is a unique id for that type of object. See returnvalues/FwClassIds.
|
||||||
|
|
||||||
|
### OSAL
|
||||||
|
The FSFW provides operation system abstraction layers for Linux, FreeRTOS and RTEMS. A independent OSAL called "host" is currently not finished. This aims to be running on windows as well.
|
||||||
|
The OSAL provides periodic tasks, message queues, clocks and Semaphores as well as Mutexes.
|
||||||
|
|
||||||
|
### Core Components
|
||||||
|
|
||||||
|
Clock:
|
||||||
|
* This is a class of static functions that can be used at anytime
|
||||||
|
* Leap Seconds must be set if any time conversions from UTC to other times is used
|
||||||
|
|
||||||
|
ObjectManager (must be created):
|
||||||
|
|
||||||
|
* The component which handles all references. All SystemObjects register at this component.
|
||||||
|
* Any SystemObject needs to have a unique ObjectId. Those can be managed like objects::framework_objects.
|
||||||
|
* A reference to an object can be get by calling the following function. T must be the specific Interface you want to call.
|
||||||
|
A nullptr check of the returning Pointer must be done. This function is based on Run-time type information.
|
||||||
|
|
||||||
|
``` c++
|
||||||
|
template <typename T> T* ObjectManagerIF::get( object_id_t id )
|
||||||
|
|
||||||
|
```
|
||||||
|
* A typical way to create all objects on startup is a handing a static produce function to the ObjectManager on creation.
|
||||||
|
By calling objectManager->initialize() the produce function will be called and all SystemObjects will be initialized afterwards.
|
||||||
|
|
||||||
|
Event Manager:
|
||||||
|
|
||||||
|
* Component which allows routing of events
|
||||||
|
* Other objects can subscribe to specific events, ranges of events or all events of an object.
|
||||||
|
* Subscriptions can be done during runtime but should be done during initialization
|
||||||
|
* Amounts of allowed subscriptions must be configured by setting this parameters:
|
||||||
|
|
||||||
|
``` c++
|
||||||
|
namespace fsfwconfig {
|
||||||
|
//! Configure the allocated pool sizes for the event manager.
|
||||||
|
static constexpr size_t FSFW_EVENTMGMR_MATCHTREE_NODES = 240;
|
||||||
|
static constexpr size_t FSFW_EVENTMGMT_EVENTIDMATCHERS = 120;
|
||||||
|
static constexpr size_t FSFW_EVENTMGMR_RANGEMATCHERS = 120;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
Health Table:
|
||||||
|
|
||||||
|
* A component which holds every health state
|
||||||
|
* Provides a thread safe way to access all health states without the need of message exchanges
|
||||||
|
|
||||||
|
Stores
|
||||||
|
|
||||||
|
* The message based communication can only exchange a few bytes of information inside the message itself. Therefore, additional information can be exchanged with Stores. With this, only the store address must be exchanged in the message.
|
||||||
|
* Internally, the FSFW uses an IPC Store to exchange data between processes. For incoming TCs a TC Store is used. For outgoing TM a TM store is used.
|
||||||
|
* All of them should use the Thread Safe Class storagemanager/PoolManager
|
||||||
|
|
||||||
|
Tasks
|
||||||
|
|
||||||
|
There are two different types of tasks:
|
||||||
|
* The PeriodicTask just executes objects that are of type ExecutableObjectIF in the order of the insertion to the Tasks.
|
||||||
|
* FixedTimeslotTask executes a list of calls in the order of the given list. This is intended for DeviceHandlers, where polling should be in a defined order. An example can be found in defaultcfg/fsfwconfig/pollingSequence
|
||||||
|
|
||||||
|
|
||||||
|
### Static Ids in the framework
|
||||||
|
|
||||||
|
Some parts of the framework use a static routing address for communication.
|
||||||
|
An example setup of ids can be found in the example config in "defaultcft/fsfwconfig/objects/Factory::setStaticFrameworkObjectIds()".
|
||||||
|
|
||||||
|
### Events
|
||||||
|
|
||||||
|
Events are tied to objects. EventIds can be generated by calling the Macro MAKE_EVENT. This works analog to the returnvalues.
|
||||||
|
Every object that needs own EventIds has to get a unique SUBSYSTEM_ID.
|
||||||
|
Every SystemObject can call triggerEvent from the parent class.
|
||||||
|
Therefore, event messages contain the specific EventId and the objectId of the object that has triggered.
|
||||||
|
|
||||||
|
### Internal Communication
|
||||||
|
|
||||||
|
Components communicate mostly over Message through Queues.
|
||||||
|
Those queues are created by calling the singleton QueueFactory::instance()->create().
|
||||||
|
|
||||||
|
### External Communication
|
||||||
|
|
||||||
|
The external communication with the mission control system is mostly up to the user implementation.
|
||||||
|
The FSFW provides PUS Services which can be used to but don't need to be used.
|
||||||
|
The services can be seen as a conversion from a TC to a message based communication and back.
|
||||||
|
|
||||||
|
#### CCSDS Frames, CCSDS Space Packets and PUS
|
||||||
|
|
||||||
|
If the communication is based on CCSDS Frames and Space Packets, several classes can be used to distributed the packets to the corresponding services. Those can be found in tcdistribution.
|
||||||
|
If Space Packets are used, a timestamper must be created.
|
||||||
|
An example can be found in the timemanager folder, this uses CCSDSTime::CDS_short.
|
||||||
|
|
||||||
|
#### DeviceHandling
|
||||||
|
|
||||||
|
DeviceHandlers are a core component of the FSFW.
|
||||||
|
The idea is, to have a software counterpart of every physical device to provide a simple mode, health and commanding interface.
|
||||||
|
By separating the underlying Communication Interface with DeviceCommunicationIF, a DH can be tested on different hardware.
|
||||||
|
The DH has mechanisms to monitor the communication with the physical device which allow for FDIR reaction.
|
||||||
|
A standard FDIR component for the DH will be created automatically but can be overwritten by the user.
|
||||||
|
|
||||||
|
#### Modes, Health
|
||||||
|
|
||||||
|
The two interfaces HasModesIF and HasHealthIF provide access for commanding and monitoring of components.
|
||||||
|
On-board Mode Management is implement in hierarchy system.
|
||||||
|
DeviceHandlers and Controllers are the lowest part of the hierarchy.
|
||||||
|
The next layer are Assemblies. Those assemblies act as a component which handle redundancies of handlers.
|
||||||
|
Assemblies share a common core with the next level which are the Subsystems.
|
||||||
|
|
||||||
|
Those Assemblies are intended to act as auto-generated components from a database which describes the subsystem modes.
|
||||||
|
The definitions contain transition and target tables which contain the DH, Assembly and Controller Modes to be commanded.
|
||||||
|
Transition tables contain as many steps as needed to reach the mode from any other mode, e.g. a switch into any higher AOCS mode might first turn on the sensors, than the actuators and the controller as last component.
|
||||||
|
The target table is used to describe the state that is checked continuously by the subsystem.
|
||||||
|
All of this allows System Modes to be generated as Subsystem object as well from the same database.
|
||||||
|
This System contains list of subsystem modes in the transition and target tables.
|
||||||
|
Therefore, it allows a modular system to create system modes and easy commanding of those, because only the highest components must be commanded.
|
||||||
|
|
||||||
|
The health state represents if the component is able to perform its tasks.
|
||||||
|
This can be used to signal the system to avoid using this component instead of a redundant one.
|
||||||
|
The on-board FDIR uses the health state for isolation and recovery.
|
||||||
|
|
||||||
|
## Example config
|
||||||
|
|
||||||
|
A example config can be found in defaultcfg/fsfwconfig.
|
||||||
|
|
||||||
|
## Unit Tests
|
||||||
|
|
||||||
|
Unit Tests are provided in the unittest folder. Those use the catch2 framework but do not include catch2 itself.
|
||||||
|
See README.md in the unittest Folder.
|
@ -1,10 +1,12 @@
|
|||||||
#include "ActionHelper.h"
|
#include "ActionHelper.h"
|
||||||
#include "HasActionsIF.h"
|
#include "HasActionsIF.h"
|
||||||
|
|
||||||
#include "../ipc/MessageQueueSenderIF.h"
|
#include "../ipc/MessageQueueSenderIF.h"
|
||||||
#include "../objectmanager/ObjectManagerIF.h"
|
#include "../objectmanager/ObjectManagerIF.h"
|
||||||
|
|
||||||
ActionHelper::ActionHelper(HasActionsIF* setOwner, MessageQueueIF* useThisQueue) :
|
ActionHelper::ActionHelper(HasActionsIF* setOwner,
|
||||||
owner(setOwner), queueToUse(useThisQueue), ipcStore(nullptr) {
|
MessageQueueIF* useThisQueue) :
|
||||||
|
owner(setOwner), queueToUse(useThisQueue) {
|
||||||
}
|
}
|
||||||
|
|
||||||
ActionHelper::~ActionHelper() {
|
ActionHelper::~ActionHelper() {
|
||||||
@ -33,13 +35,15 @@ ReturnValue_t ActionHelper::initialize(MessageQueueIF* queueToUse_) {
|
|||||||
return HasReturnvaluesIF::RETURN_OK;
|
return HasReturnvaluesIF::RETURN_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ActionHelper::step(uint8_t step, MessageQueueId_t reportTo, ActionId_t commandId, ReturnValue_t result) {
|
void ActionHelper::step(uint8_t step, MessageQueueId_t reportTo,
|
||||||
|
ActionId_t commandId, ReturnValue_t result) {
|
||||||
CommandMessage reply;
|
CommandMessage reply;
|
||||||
ActionMessage::setStepReply(&reply, commandId, step + STEP_OFFSET, result);
|
ActionMessage::setStepReply(&reply, commandId, step + STEP_OFFSET, result);
|
||||||
queueToUse->sendMessage(reportTo, &reply);
|
queueToUse->sendMessage(reportTo, &reply);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ActionHelper::finish(MessageQueueId_t reportTo, ActionId_t commandId, ReturnValue_t result) {
|
void ActionHelper::finish(MessageQueueId_t reportTo, ActionId_t commandId,
|
||||||
|
ReturnValue_t result) {
|
||||||
CommandMessage reply;
|
CommandMessage reply;
|
||||||
ActionMessage::setCompletionReply(&reply, commandId, result);
|
ActionMessage::setCompletionReply(&reply, commandId, result);
|
||||||
queueToUse->sendMessage(reportTo, &reply);
|
queueToUse->sendMessage(reportTo, &reply);
|
||||||
@ -49,8 +53,8 @@ void ActionHelper::setQueueToUse(MessageQueueIF* queue) {
|
|||||||
queueToUse = queue;
|
queueToUse = queue;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ActionHelper::prepareExecution(MessageQueueId_t commandedBy, ActionId_t actionId,
|
void ActionHelper::prepareExecution(MessageQueueId_t commandedBy,
|
||||||
store_address_t dataAddress) {
|
ActionId_t actionId, store_address_t dataAddress) {
|
||||||
const uint8_t* dataPtr = NULL;
|
const uint8_t* dataPtr = NULL;
|
||||||
size_t size = 0;
|
size_t size = 0;
|
||||||
ReturnValue_t result = ipcStore->getData(dataAddress, &dataPtr, &size);
|
ReturnValue_t result = ipcStore->getData(dataAddress, &dataPtr, &size);
|
||||||
@ -62,6 +66,11 @@ void ActionHelper::prepareExecution(MessageQueueId_t commandedBy, ActionId_t act
|
|||||||
}
|
}
|
||||||
result = owner->executeAction(actionId, commandedBy, dataPtr, size);
|
result = owner->executeAction(actionId, commandedBy, dataPtr, size);
|
||||||
ipcStore->deleteData(dataAddress);
|
ipcStore->deleteData(dataAddress);
|
||||||
|
if(result == HasActionsIF::EXECUTION_FINISHED) {
|
||||||
|
CommandMessage reply;
|
||||||
|
ActionMessage::setCompletionReply(&reply, actionId, result);
|
||||||
|
queueToUse->sendMessage(commandedBy, &reply);
|
||||||
|
}
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
CommandMessage reply;
|
CommandMessage reply;
|
||||||
ActionMessage::setStepReply(&reply, actionId, 0, result);
|
ActionMessage::setStepReply(&reply, actionId, 0, result);
|
||||||
@ -86,22 +95,28 @@ ReturnValue_t ActionHelper::reportData(MessageQueueId_t reportTo,
|
|||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
result = data->serialize(&dataPtr, &size, maxSize, SerializeIF::Endianness::BIG);
|
result = data->serialize(&dataPtr, &size, maxSize,
|
||||||
|
SerializeIF::Endianness::BIG);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
ipcStore->deleteData(storeAddress);
|
ipcStore->deleteData(storeAddress);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
//We don't need to report the objectId, as we receive REQUESTED data before the completion success message.
|
// We don't need to report the objectId, as we receive REQUESTED data
|
||||||
//True aperiodic replies need to be reported with another dedicated message.
|
// before the completion success message.
|
||||||
|
// True aperiodic replies need to be reported with
|
||||||
|
// another dedicated message.
|
||||||
ActionMessage::setDataReply(&reply, replyId, storeAddress);
|
ActionMessage::setDataReply(&reply, replyId, storeAddress);
|
||||||
|
|
||||||
//TODO Service Implementation sucks at the moment
|
// If the sender needs to be hidden, for example to handle packet
|
||||||
if (hideSender){
|
// as unrequested reply, this will be done here.
|
||||||
|
if (hideSender) {
|
||||||
result = MessageQueueSenderIF::sendMessage(reportTo, &reply);
|
result = MessageQueueSenderIF::sendMessage(reportTo, &reply);
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
result = queueToUse->sendMessage(reportTo, &reply);
|
result = queueToUse->sendMessage(reportTo, &reply);
|
||||||
}
|
}
|
||||||
if ( result != HasReturnvaluesIF::RETURN_OK){
|
|
||||||
|
if (result != HasReturnvaluesIF::RETURN_OK){
|
||||||
ipcStore->deleteData(storeAddress);
|
ipcStore->deleteData(storeAddress);
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
@ -109,3 +124,39 @@ ReturnValue_t ActionHelper::reportData(MessageQueueId_t reportTo,
|
|||||||
|
|
||||||
void ActionHelper::resetHelper() {
|
void ActionHelper::resetHelper() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ReturnValue_t ActionHelper::reportData(MessageQueueId_t reportTo,
|
||||||
|
ActionId_t replyId, const uint8_t *data, size_t dataSize,
|
||||||
|
bool hideSender) {
|
||||||
|
CommandMessage reply;
|
||||||
|
store_address_t storeAddress;
|
||||||
|
ReturnValue_t result = ipcStore->addData(&storeAddress, data, dataSize);
|
||||||
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
|
ipcStore->deleteData(storeAddress);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
// We don't need to report the objectId, as we receive REQUESTED data
|
||||||
|
// before the completion success message.
|
||||||
|
// True aperiodic replies need to be reported with
|
||||||
|
// another dedicated message.
|
||||||
|
ActionMessage::setDataReply(&reply, replyId, storeAddress);
|
||||||
|
|
||||||
|
// If the sender needs to be hidden, for example to handle packet
|
||||||
|
// as unrequested reply, this will be done here.
|
||||||
|
if (hideSender) {
|
||||||
|
result = MessageQueueSenderIF::sendMessage(reportTo, &reply);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
result = queueToUse->sendMessage(reportTo, &reply);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (result != HasReturnvaluesIF::RETURN_OK){
|
||||||
|
ipcStore->deleteData(storeAddress);
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
@ -1,15 +1,18 @@
|
|||||||
#ifndef ACTIONHELPER_H_
|
#ifndef FSFW_ACTION_ACTIONHELPER_H_
|
||||||
#define ACTIONHELPER_H_
|
#define FSFW_ACTION_ACTIONHELPER_H_
|
||||||
|
|
||||||
#include "ActionMessage.h"
|
#include "ActionMessage.h"
|
||||||
#include "../serialize/SerializeIF.h"
|
#include "../serialize/SerializeIF.h"
|
||||||
#include "../ipc/MessageQueueIF.h"
|
#include "../ipc/MessageQueueIF.h"
|
||||||
/**
|
/**
|
||||||
* \brief Action Helper is a helper class which handles action messages
|
* @brief Action Helper is a helper class which handles action messages
|
||||||
*
|
*
|
||||||
* Components which use the HasActionIF this helper can be used to handle the action messages.
|
* Components which use the HasActionIF this helper can be used to handle
|
||||||
* It does handle step messages as well as other answers to action calls. It uses the executeAction function
|
* the action messages.
|
||||||
* of its owner as callback. The call of the initialize function is mandatory and it needs a valid messageQueueIF pointer!
|
* It does handle step messages as well as other answers to action calls.
|
||||||
|
* It uses the executeAction function of its owner as callback.
|
||||||
|
* The call of the initialize function is mandatory and needs a
|
||||||
|
* valid MessageQueueIF pointer!
|
||||||
*/
|
*/
|
||||||
class HasActionsIF;
|
class HasActionsIF;
|
||||||
|
|
||||||
@ -18,7 +21,8 @@ public:
|
|||||||
/**
|
/**
|
||||||
* Constructor of the action helper
|
* Constructor of the action helper
|
||||||
* @param setOwner Pointer to the owner of the interface
|
* @param setOwner Pointer to the owner of the interface
|
||||||
* @param useThisQueue messageQueue to be used, can be set during initialize function as well.
|
* @param useThisQueue messageQueue to be used, can be set during
|
||||||
|
* initialize function as well.
|
||||||
*/
|
*/
|
||||||
ActionHelper(HasActionsIF* setOwner, MessageQueueIF* useThisQueue);
|
ActionHelper(HasActionsIF* setOwner, MessageQueueIF* useThisQueue);
|
||||||
|
|
||||||
@ -26,28 +30,36 @@ public:
|
|||||||
/**
|
/**
|
||||||
* Function to be called from the owner with a new command message
|
* Function to be called from the owner with a new command message
|
||||||
*
|
*
|
||||||
* If the message is a valid action message the helper will use the executeAction function from HasActionsIF.
|
* If the message is a valid action message the helper will use the
|
||||||
* If the message is invalid or the callback fails a message reply will be send to the sender of the message automatically.
|
* executeAction function from HasActionsIF.
|
||||||
|
* If the message is invalid or the callback fails a message reply will be
|
||||||
|
* send to the sender of the message automatically.
|
||||||
*
|
*
|
||||||
* @param command Pointer to a command message received by the owner
|
* @param command Pointer to a command message received by the owner
|
||||||
* @return HasReturnvaluesIF::RETURN_OK if the message is a action message, CommandMessage::UNKNOW_COMMAND if this message ID is unkown
|
* @return HasReturnvaluesIF::RETURN_OK if the message is a action message,
|
||||||
|
* CommandMessage::UNKNOW_COMMAND if this message ID is unkown
|
||||||
*/
|
*/
|
||||||
ReturnValue_t handleActionMessage(CommandMessage* command);
|
ReturnValue_t handleActionMessage(CommandMessage* command);
|
||||||
/**
|
/**
|
||||||
* Helper initialize function. Must be called before use of any other helper function
|
* Helper initialize function. Must be called before use of any other
|
||||||
* @param queueToUse_ Pointer to the messageQueue to be used, optional if queue was set in constructor
|
* helper function
|
||||||
|
* @param queueToUse_ Pointer to the messageQueue to be used, optional
|
||||||
|
* if queue was set in constructor
|
||||||
* @return Returns RETURN_OK if successful
|
* @return Returns RETURN_OK if successful
|
||||||
*/
|
*/
|
||||||
ReturnValue_t initialize(MessageQueueIF* queueToUse_ = nullptr);
|
ReturnValue_t initialize(MessageQueueIF* queueToUse_ = nullptr);
|
||||||
/**
|
/**
|
||||||
* Function to be called from the owner to send a step message. Success or failure will be determined by the result value.
|
* Function to be called from the owner to send a step message.
|
||||||
|
* Success or failure will be determined by the result value.
|
||||||
*
|
*
|
||||||
* @param step Number of steps already done
|
* @param step Number of steps already done
|
||||||
* @param reportTo The messageQueueId to report the step message to
|
* @param reportTo The messageQueueId to report the step message to
|
||||||
* @param commandId ID of the executed command
|
* @param commandId ID of the executed command
|
||||||
* @param result Result of the execution
|
* @param result Result of the execution
|
||||||
*/
|
*/
|
||||||
void step(uint8_t step, MessageQueueId_t reportTo, ActionId_t commandId, ReturnValue_t result = HasReturnvaluesIF::RETURN_OK);
|
void step(uint8_t step, MessageQueueId_t reportTo,
|
||||||
|
ActionId_t commandId,
|
||||||
|
ReturnValue_t result = HasReturnvaluesIF::RETURN_OK);
|
||||||
/**
|
/**
|
||||||
* Function to be called by the owner to send a action completion message
|
* Function to be called by the owner to send a action completion message
|
||||||
*
|
*
|
||||||
@ -55,39 +67,59 @@ public:
|
|||||||
* @param commandId ID of the executed command
|
* @param commandId ID of the executed command
|
||||||
* @param result Result of the execution
|
* @param result Result of the execution
|
||||||
*/
|
*/
|
||||||
void finish(MessageQueueId_t reportTo, ActionId_t commandId, ReturnValue_t result = HasReturnvaluesIF::RETURN_OK);
|
void finish(MessageQueueId_t reportTo, ActionId_t commandId,
|
||||||
|
ReturnValue_t result = HasReturnvaluesIF::RETURN_OK);
|
||||||
/**
|
/**
|
||||||
* Function to be called by the owner if an action does report data
|
* Function to be called by the owner if an action does report data.
|
||||||
*
|
* Takes a SerializeIF* pointer and serializes it into the IPC store.
|
||||||
* @param reportTo MessageQueueId_t to report the action completion message to
|
* @param reportTo MessageQueueId_t to report the action completion
|
||||||
|
* message to
|
||||||
* @param replyId ID of the executed command
|
* @param replyId ID of the executed command
|
||||||
* @param data Pointer to the data
|
* @param data Pointer to the data
|
||||||
* @return Returns RETURN_OK if successful, otherwise failure code
|
* @return Returns RETURN_OK if successful, otherwise failure code
|
||||||
*/
|
*/
|
||||||
ReturnValue_t reportData(MessageQueueId_t reportTo, ActionId_t replyId, SerializeIF* data, bool hideSender = false);
|
ReturnValue_t reportData(MessageQueueId_t reportTo, ActionId_t replyId,
|
||||||
|
SerializeIF* data, bool hideSender = false);
|
||||||
|
/**
|
||||||
|
* Function to be called by the owner if an action does report data.
|
||||||
|
* Takes the raw data and writes it into the IPC store.
|
||||||
|
* @param reportTo MessageQueueId_t to report the action completion
|
||||||
|
* message to
|
||||||
|
* @param replyId ID of the executed command
|
||||||
|
* @param data Pointer to the data
|
||||||
|
* @return Returns RETURN_OK if successful, otherwise failure code
|
||||||
|
*/
|
||||||
|
ReturnValue_t reportData(MessageQueueId_t reportTo, ActionId_t replyId,
|
||||||
|
const uint8_t* data, size_t dataSize, bool hideSender = false);
|
||||||
/**
|
/**
|
||||||
* Function to setup the MessageQueueIF* of the helper. Can be used to set the messageQueueIF* if
|
* Function to setup the MessageQueueIF* of the helper. Can be used to
|
||||||
* message queue is unavailable at construction and initialize but must be setup before first call of other functions.
|
* set the MessageQueueIF* if message queue is unavailable at construction
|
||||||
|
* and initialize but must be setup before first call of other functions.
|
||||||
* @param queue Queue to be used by the helper
|
* @param queue Queue to be used by the helper
|
||||||
*/
|
*/
|
||||||
void setQueueToUse(MessageQueueIF *queue);
|
void setQueueToUse(MessageQueueIF *queue);
|
||||||
protected:
|
protected:
|
||||||
static const uint8_t STEP_OFFSET = 1;//!< Increase of value of this per step
|
//!< Increase of value of this per step
|
||||||
|
static const uint8_t STEP_OFFSET = 1;
|
||||||
HasActionsIF* owner;//!< Pointer to the owner
|
HasActionsIF* owner;//!< Pointer to the owner
|
||||||
MessageQueueIF* queueToUse;//!< Queue to be used as response sender, has to be set with
|
//! Queue to be used as response sender, has to be set in ctor or with
|
||||||
StorageManagerIF* ipcStore;//!< Pointer to an IPC Store, initialized during construction or initialize(MessageQueueIF* queueToUse_) or with setQueueToUse(MessageQueueIF *queue)
|
//! setQueueToUse
|
||||||
|
MessageQueueIF* queueToUse;
|
||||||
|
//! Pointer to an IPC Store, initialized during construction or
|
||||||
|
StorageManagerIF* ipcStore = nullptr;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*Internal function called by handleActionMessage(CommandMessage* command)
|
* Internal function called by handleActionMessage
|
||||||
*
|
|
||||||
* @param commandedBy MessageQueueID of Commander
|
* @param commandedBy MessageQueueID of Commander
|
||||||
* @param actionId ID of action to be done
|
* @param actionId ID of action to be done
|
||||||
* @param dataAddress Address of additional data in IPC Store
|
* @param dataAddress Address of additional data in IPC Store
|
||||||
*/
|
*/
|
||||||
virtual void prepareExecution(MessageQueueId_t commandedBy, ActionId_t actionId, store_address_t dataAddress);
|
virtual void prepareExecution(MessageQueueId_t commandedBy,
|
||||||
|
ActionId_t actionId, store_address_t dataAddress);
|
||||||
/**
|
/**
|
||||||
*
|
* @brief Default implementation is empty.
|
||||||
*/
|
*/
|
||||||
virtual void resetHelper();
|
virtual void resetHelper();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* ACTIONHELPER_H_ */
|
#endif /* FSFW_ACTION_ACTIONHELPER_H_ */
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#ifndef ACTIONMESSAGE_H_
|
#ifndef FSFW_ACTION_ACTIONMESSAGE_H_
|
||||||
#define ACTIONMESSAGE_H_
|
#define FSFW_ACTION_ACTIONMESSAGE_H_
|
||||||
|
|
||||||
#include "../ipc/CommandMessage.h"
|
#include "../ipc/CommandMessage.h"
|
||||||
#include "../objectmanager/ObjectManagerIF.h"
|
#include "../objectmanager/ObjectManagerIF.h"
|
||||||
@ -18,15 +18,19 @@ public:
|
|||||||
static const Command_t COMPLETION_SUCCESS = MAKE_COMMAND_ID(5);
|
static const Command_t COMPLETION_SUCCESS = MAKE_COMMAND_ID(5);
|
||||||
static const Command_t COMPLETION_FAILED = MAKE_COMMAND_ID(6);
|
static const Command_t COMPLETION_FAILED = MAKE_COMMAND_ID(6);
|
||||||
virtual ~ActionMessage();
|
virtual ~ActionMessage();
|
||||||
static void setCommand(CommandMessage* message, ActionId_t fid, store_address_t parameters);
|
static void setCommand(CommandMessage* message, ActionId_t fid,
|
||||||
|
store_address_t parameters);
|
||||||
static ActionId_t getActionId(const CommandMessage* message );
|
static ActionId_t getActionId(const CommandMessage* message );
|
||||||
static store_address_t getStoreId(const CommandMessage* message );
|
static store_address_t getStoreId(const CommandMessage* message );
|
||||||
static void setStepReply(CommandMessage* message, ActionId_t fid, uint8_t step, ReturnValue_t result = HasReturnvaluesIF::RETURN_OK);
|
static void setStepReply(CommandMessage* message, ActionId_t fid,
|
||||||
|
uint8_t step, ReturnValue_t result = HasReturnvaluesIF::RETURN_OK);
|
||||||
static uint8_t getStep(const CommandMessage* message );
|
static uint8_t getStep(const CommandMessage* message );
|
||||||
static ReturnValue_t getReturnCode(const CommandMessage* message );
|
static ReturnValue_t getReturnCode(const CommandMessage* message );
|
||||||
static void setDataReply(CommandMessage* message, ActionId_t actionId, store_address_t data);
|
static void setDataReply(CommandMessage* message, ActionId_t actionId,
|
||||||
static void setCompletionReply(CommandMessage* message, ActionId_t fid, ReturnValue_t result = HasReturnvaluesIF::RETURN_OK);
|
store_address_t data);
|
||||||
|
static void setCompletionReply(CommandMessage* message, ActionId_t fid,
|
||||||
|
ReturnValue_t result = HasReturnvaluesIF::RETURN_OK);
|
||||||
static void clear(CommandMessage* message);
|
static void clear(CommandMessage* message);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* ACTIONMESSAGE_H_ */
|
#endif /* FSFW_ACTION_ACTIONMESSAGE_H_ */
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#ifndef COMMANDSACTIONSIF_H_
|
#ifndef FSFW_ACTION_COMMANDSACTIONSIF_H_
|
||||||
#define COMMANDSACTIONSIF_H_
|
#define FSFW_ACTION_COMMANDSACTIONSIF_H_
|
||||||
|
|
||||||
#include "CommandActionHelper.h"
|
#include "CommandActionHelper.h"
|
||||||
#include "../returnvalues/HasReturnvaluesIF.h"
|
#include "../returnvalues/HasReturnvaluesIF.h"
|
||||||
@ -24,11 +24,14 @@ public:
|
|||||||
virtual MessageQueueIF* getCommandQueuePtr() = 0;
|
virtual MessageQueueIF* getCommandQueuePtr() = 0;
|
||||||
protected:
|
protected:
|
||||||
virtual void stepSuccessfulReceived(ActionId_t actionId, uint8_t step) = 0;
|
virtual void stepSuccessfulReceived(ActionId_t actionId, uint8_t step) = 0;
|
||||||
virtual void stepFailedReceived(ActionId_t actionId, uint8_t step, ReturnValue_t returnCode) = 0;
|
virtual void stepFailedReceived(ActionId_t actionId, uint8_t step,
|
||||||
virtual void dataReceived(ActionId_t actionId, const uint8_t* data, uint32_t size) = 0;
|
ReturnValue_t returnCode) = 0;
|
||||||
|
virtual void dataReceived(ActionId_t actionId, const uint8_t* data,
|
||||||
|
uint32_t size) = 0;
|
||||||
virtual void completionSuccessfulReceived(ActionId_t actionId) = 0;
|
virtual void completionSuccessfulReceived(ActionId_t actionId) = 0;
|
||||||
virtual void completionFailedReceived(ActionId_t actionId, ReturnValue_t returnCode) = 0;
|
virtual void completionFailedReceived(ActionId_t actionId,
|
||||||
|
ReturnValue_t returnCode) = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
#endif /* COMMANDSACTIONSIF_H_ */
|
#endif /* FSFW_ACTION_COMMANDSACTIONSIF_H_ */
|
||||||
|
@ -1,11 +1,12 @@
|
|||||||
#ifndef FRAMEWORK_ACTION_HASACTIONSIF_H_
|
#ifndef FSFW_ACTION_HASACTIONSIF_H_
|
||||||
#define FRAMEWORK_ACTION_HASACTIONSIF_H_
|
#define FSFW_ACTION_HASACTIONSIF_H_
|
||||||
|
|
||||||
#include "ActionHelper.h"
|
#include "ActionHelper.h"
|
||||||
#include "ActionMessage.h"
|
#include "ActionMessage.h"
|
||||||
#include "SimpleActionHelper.h"
|
#include "SimpleActionHelper.h"
|
||||||
#include "../returnvalues/HasReturnvaluesIF.h"
|
#include "../returnvalues/HasReturnvaluesIF.h"
|
||||||
#include "../ipc/MessageQueueIF.h"
|
#include "../ipc/MessageQueueIF.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief
|
* @brief
|
||||||
* Interface for component which uses actions
|
* Interface for component which uses actions
|
||||||
@ -47,14 +48,16 @@ public:
|
|||||||
virtual MessageQueueId_t getCommandQueue() const = 0;
|
virtual MessageQueueId_t getCommandQueue() const = 0;
|
||||||
/**
|
/**
|
||||||
* Execute or initialize the execution of a certain function.
|
* Execute or initialize the execution of a certain function.
|
||||||
* Returning #EXECUTION_FINISHED or a failure code, nothing else needs to
|
* The ActionHelpers will execute this function and behave differently
|
||||||
* be done. When needing more steps, return RETURN_OK and issue steps and
|
* depending on the returnvalue.
|
||||||
* completion manually.
|
*
|
||||||
* One "step failed" or completion report must be issued!
|
* @return
|
||||||
|
* -@c EXECUTION_FINISHED Finish reply will be generated
|
||||||
|
* -@c Not RETURN_OK Step failure reply will be generated
|
||||||
*/
|
*/
|
||||||
virtual ReturnValue_t executeAction(ActionId_t actionId,
|
virtual ReturnValue_t executeAction(ActionId_t actionId,
|
||||||
MessageQueueId_t commandedBy, const uint8_t* data, size_t size) = 0;
|
MessageQueueId_t commandedBy, const uint8_t* data, size_t size) = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
#endif /* FRAMEWORK_ACTION_HASACTIONSIF_H_ */
|
#endif /* FSFW_ACTION_HASACTIONSIF_H_ */
|
||||||
|
@ -1,16 +1,17 @@
|
|||||||
#include "HasActionsIF.h"
|
#include "HasActionsIF.h"
|
||||||
#include "SimpleActionHelper.h"
|
#include "SimpleActionHelper.h"
|
||||||
|
|
||||||
SimpleActionHelper::SimpleActionHelper(HasActionsIF* setOwner,
|
SimpleActionHelper::SimpleActionHelper(HasActionsIF* setOwner,
|
||||||
MessageQueueIF* useThisQueue) :
|
MessageQueueIF* useThisQueue) :
|
||||||
ActionHelper(setOwner, useThisQueue), isExecuting(false), lastCommander(
|
ActionHelper(setOwner, useThisQueue), isExecuting(false) {
|
||||||
0), lastAction(0), stepCount(0) {
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SimpleActionHelper::~SimpleActionHelper() {
|
SimpleActionHelper::~SimpleActionHelper() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void SimpleActionHelper::step(ReturnValue_t result) {
|
void SimpleActionHelper::step(ReturnValue_t result) {
|
||||||
//STEP_OFFESET is subtracted to compensate for adding offset in base method, which is not necessary here.
|
// STEP_OFFESET is subtracted to compensate for adding offset in base
|
||||||
|
// method, which is not necessary here.
|
||||||
ActionHelper::step(stepCount - STEP_OFFSET, lastCommander, lastAction,
|
ActionHelper::step(stepCount - STEP_OFFSET, lastCommander, lastAction,
|
||||||
result);
|
result);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
|
@ -1,8 +1,13 @@
|
|||||||
#ifndef SIMPLEACTIONHELPER_H_
|
#ifndef FSFW_ACTION_SIMPLEACTIONHELPER_H_
|
||||||
#define SIMPLEACTIONHELPER_H_
|
#define FSFW_ACTION_SIMPLEACTIONHELPER_H_
|
||||||
|
|
||||||
#include "ActionHelper.h"
|
#include "ActionHelper.h"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief This is an action helper which is only able to service one action
|
||||||
|
* at a time but remembers last commander and last action which
|
||||||
|
* simplifies usage
|
||||||
|
*/
|
||||||
class SimpleActionHelper: public ActionHelper {
|
class SimpleActionHelper: public ActionHelper {
|
||||||
public:
|
public:
|
||||||
SimpleActionHelper(HasActionsIF* setOwner, MessageQueueIF* useThisQueue);
|
SimpleActionHelper(HasActionsIF* setOwner, MessageQueueIF* useThisQueue);
|
||||||
@ -12,13 +17,14 @@ public:
|
|||||||
ReturnValue_t reportData(SerializeIF* data);
|
ReturnValue_t reportData(SerializeIF* data);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void prepareExecution(MessageQueueId_t commandedBy, ActionId_t actionId, store_address_t dataAddress);
|
void prepareExecution(MessageQueueId_t commandedBy, ActionId_t actionId,
|
||||||
virtual void resetHelper();
|
store_address_t dataAddress);
|
||||||
|
virtual void resetHelper();
|
||||||
private:
|
private:
|
||||||
bool isExecuting;
|
bool isExecuting;
|
||||||
MessageQueueId_t lastCommander;
|
MessageQueueId_t lastCommander = MessageQueueIF::NO_QUEUE;
|
||||||
ActionId_t lastAction;
|
ActionId_t lastAction = 0;
|
||||||
uint8_t stepCount;
|
uint8_t stepCount = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* SIMPLEACTIONHELPER_H_ */
|
#endif /* SIMPLEACTIONHELPER_H_ */
|
||||||
|
6
defaultcfg/README.md
Normal file
6
defaultcfg/README.md
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
# How to setup configuration folder for FSFW
|
||||||
|
|
||||||
|
It is recommended to copy the content of the defaultcfg folder
|
||||||
|
into a config folder which is in the same directory as the Flight
|
||||||
|
Software Framework submodule. After that, the config.mk folder should be
|
||||||
|
included by the primary Makefile with CURRENTPATH set correctly.
|
55
defaultcfg/fsfwconfig/FSFWConfig.h
Normal file
55
defaultcfg/fsfwconfig/FSFWConfig.h
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
#ifndef CONFIG_FSFWCONFIG_H_
|
||||||
|
#define CONFIG_FSFWCONFIG_H_
|
||||||
|
|
||||||
|
#include <FSFWVersion.h>
|
||||||
|
#include <cstddef>
|
||||||
|
#include <cstdint>
|
||||||
|
|
||||||
|
//! Used to determine whether C++ ostreams are used
|
||||||
|
//! Those can lead to code bloat.
|
||||||
|
#define FSFW_CPP_OSTREAM_ENABLED 1
|
||||||
|
|
||||||
|
//! Reduced printout to further decrese code size
|
||||||
|
//! Be careful, this also turns off most diagnostic prinouts!
|
||||||
|
#define FSFW_REDUCED_PRINTOUT 0
|
||||||
|
|
||||||
|
//! Can be used to enable debugging printouts for developing the FSFW
|
||||||
|
#define FSFW_DEBUGGING 0
|
||||||
|
|
||||||
|
//! Defines the FIFO depth of each commanding service base which
|
||||||
|
//! also determines how many commands a CSB service can handle in one cycle
|
||||||
|
//! simulataneously. This will increase the required RAM for
|
||||||
|
//! each CSB service !
|
||||||
|
#define FSFW_CSB_FIFO_DEPTH 6
|
||||||
|
|
||||||
|
//! If FSFW_OBJ_EVENT_TRANSLATION is set to one,
|
||||||
|
//! additional output which requires the translation files translateObjects
|
||||||
|
//! and translateEvents (and their compiled source files)
|
||||||
|
#define FSFW_OBJ_EVENT_TRANSLATION 0
|
||||||
|
|
||||||
|
#if FSFW_OBJ_EVENT_TRANSLATION == 1
|
||||||
|
#define FSFW_DEBUG_OUTPUT 1
|
||||||
|
//! Specify whether info events are printed too.
|
||||||
|
#define FSFW_DEBUG_INFO 1
|
||||||
|
#include <translateObjects.h>
|
||||||
|
#include <translateEvents.h>
|
||||||
|
#else
|
||||||
|
#define FSFW_DEBUG_OUTPUT 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
//! When using the newlib nano library, C99 support for stdio facilities
|
||||||
|
//! will not be provided. This define should be set to 1 if this is the case.
|
||||||
|
#define FSFW_NO_C99_IO 1
|
||||||
|
|
||||||
|
namespace fsfwconfig {
|
||||||
|
//! Default timestamp size. The default timestamp will be an eight byte CDC
|
||||||
|
//! short timestamp.
|
||||||
|
static constexpr uint8_t FSFW_MISSION_TIMESTAMP_SIZE = 8;
|
||||||
|
|
||||||
|
//! Configure the allocated pool sizes for the event manager.
|
||||||
|
static constexpr size_t FSFW_EVENTMGMR_MATCHTREE_NODES = 240;
|
||||||
|
static constexpr size_t FSFW_EVENTMGMT_EVENTIDMATCHERS = 120;
|
||||||
|
static constexpr size_t FSFW_EVENTMGMR_RANGEMATCHERS = 120;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* CONFIG_FSFWCONFIG_H_ */
|
16
defaultcfg/fsfwconfig/OBSWConfig.h
Normal file
16
defaultcfg/fsfwconfig/OBSWConfig.h
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
#ifndef CONFIG_OBSWCONFIG_H_
|
||||||
|
#define CONFIG_OBSWCONFIG_H_
|
||||||
|
|
||||||
|
#include "OBSWVersion.h"
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
namespace config {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Add mission configuration flags here */
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* CONFIG_OBSWCONFIG_H_ */
|
9
defaultcfg/fsfwconfig/OBSWVersion.h
Normal file
9
defaultcfg/fsfwconfig/OBSWVersion.h
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
#ifndef CONFIG_VERSION_H_
|
||||||
|
#define CONFIG_VERSION_H_
|
||||||
|
|
||||||
|
/* OBSW versioning can be specified in this file */
|
||||||
|
|
||||||
|
#define OBSW_VERSION 0
|
||||||
|
#define OBSW_SUBVERSION 0
|
||||||
|
|
||||||
|
#endif /* CONFIG_VERSION_H_ */
|
5
defaultcfg/fsfwconfig/devices/logicalAddresses.cpp
Normal file
5
defaultcfg/fsfwconfig/devices/logicalAddresses.cpp
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
#include "logicalAddresses.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
18
defaultcfg/fsfwconfig/devices/logicalAddresses.h
Normal file
18
defaultcfg/fsfwconfig/devices/logicalAddresses.h
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
#ifndef CONFIG_DEVICES_LOGICALADDRESSES_H_
|
||||||
|
#define CONFIG_DEVICES_LOGICALADDRESSES_H_
|
||||||
|
|
||||||
|
#include <fsfw/devicehandlers/CookieIF.h>
|
||||||
|
#include "../objects/systemObjectList.h"
|
||||||
|
#include <cstdint>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Can be used for addresses for physical devices like I2C adresses.
|
||||||
|
*/
|
||||||
|
namespace addresses {
|
||||||
|
/* Logical addresses have uint32_t datatype */
|
||||||
|
enum logicalAddresses: address_t {
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#endif /* CONFIG_DEVICES_LOGICALADDRESSES_H_ */
|
4
defaultcfg/fsfwconfig/devices/powerSwitcherList.cpp
Normal file
4
defaultcfg/fsfwconfig/devices/powerSwitcherList.cpp
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
#include "powerSwitcherList.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
12
defaultcfg/fsfwconfig/devices/powerSwitcherList.h
Normal file
12
defaultcfg/fsfwconfig/devices/powerSwitcherList.h
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
#ifndef CONFIG_DEVICES_POWERSWITCHERLIST_H_
|
||||||
|
#define CONFIG_DEVICES_POWERSWITCHERLIST_H_
|
||||||
|
|
||||||
|
namespace switches {
|
||||||
|
/* Switches are uint8_t datatype and go from 0 to 255 */
|
||||||
|
enum switcherList {
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#endif /* CONFIG_DEVICES_POWERSWITCHERLIST_H_ */
|
18
defaultcfg/fsfwconfig/events/subsystemIdRanges.h
Normal file
18
defaultcfg/fsfwconfig/events/subsystemIdRanges.h
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
#ifndef CONFIG_EVENTS_SUBSYSTEMIDRANGES_H_
|
||||||
|
#define CONFIG_EVENTS_SUBSYSTEMIDRANGES_H_
|
||||||
|
|
||||||
|
#include <cstdint>
|
||||||
|
#include <fsfw/events/fwSubsystemIdRanges.h>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Custom subsystem IDs can be added here
|
||||||
|
* @details
|
||||||
|
* Subsystem IDs are used to create unique events.
|
||||||
|
*/
|
||||||
|
namespace SUBSYSTEM_ID {
|
||||||
|
enum: uint8_t {
|
||||||
|
SUBSYSTEM_ID_START = FW_SUBSYSTEM_ID_RANGE,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* CONFIG_EVENTS_SUBSYSTEMIDRANGES_H_ */
|
15
defaultcfg/fsfwconfig/fsfwconfig.mk
Normal file
15
defaultcfg/fsfwconfig/fsfwconfig.mk
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
CXXSRC += $(wildcard $(CURRENTPATH)/ipc/*.cpp)
|
||||||
|
CXXSRC += $(wildcard $(CURRENTPATH)/objects/*.cpp)
|
||||||
|
CXXSRC += $(wildcard $(CURRENTPATH)/pollingsequence/*.cpp)
|
||||||
|
CXXSRC += $(wildcard $(CURRENTPATH)/events/*.cpp)
|
||||||
|
CXXSRC += $(wildcard $(CURRENTPATH)/tmtc/*.cpp)
|
||||||
|
CXXSRC += $(wildcard $(CURRENTPATH)/devices/*.cpp)
|
||||||
|
|
||||||
|
INCLUDES += $(CURRENTPATH)
|
||||||
|
INCLUDES += $(CURRENTPATH)/objects
|
||||||
|
INCLUDES += $(CURRENTPATH)/returnvalues
|
||||||
|
INCLUDES += $(CURRENTPATH)/tmtc
|
||||||
|
INCLUDES += $(CURRENTPATH)/events
|
||||||
|
INCLUDES += $(CURRENTPATH)/devices
|
||||||
|
INCLUDES += $(CURRENTPATH)/pollingsequence
|
||||||
|
INCLUDES += $(CURRENTPATH)/ipc
|
12
defaultcfg/fsfwconfig/ipc/missionMessageTypes.cpp
Normal file
12
defaultcfg/fsfwconfig/ipc/missionMessageTypes.cpp
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
#include "missionMessageTypes.h"
|
||||||
|
|
||||||
|
#include <fsfw/ipc/CommandMessageIF.h>
|
||||||
|
|
||||||
|
void messagetypes::clearMissionMessage(CommandMessage* message) {
|
||||||
|
switch(message->getMessageType()) {
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
21
defaultcfg/fsfwconfig/ipc/missionMessageTypes.h
Normal file
21
defaultcfg/fsfwconfig/ipc/missionMessageTypes.h
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
#ifndef CONFIG_IPC_MISSIONMESSAGETYPES_H_
|
||||||
|
#define CONFIG_IPC_MISSIONMESSAGETYPES_H_
|
||||||
|
|
||||||
|
#include <fsfw/ipc/CommandMessage.h>
|
||||||
|
#include <fsfw/ipc/FwMessageTypes.h>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Custom command messages are specified here.
|
||||||
|
* Most messages needed to use FSFW are already located in
|
||||||
|
* <fsfw/ipc/FwMessageTypes.h>
|
||||||
|
* @param message Generic Command Message
|
||||||
|
*/
|
||||||
|
namespace messagetypes {
|
||||||
|
enum CustomMessageTypes {
|
||||||
|
MISSION_MESSAGE_TYPE_START = FW_MESSAGES_COUNT
|
||||||
|
};
|
||||||
|
|
||||||
|
void clearMissionMessage(CommandMessage* message);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* CONFIG_IPC_MISSIONMESSAGETYPES_H_ */
|
54
defaultcfg/fsfwconfig/objects/Factory.cpp
Normal file
54
defaultcfg/fsfwconfig/objects/Factory.cpp
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
#include "Factory.h"
|
||||||
|
#include "../tmtc/apid.h"
|
||||||
|
#include "../tmtc/pusIds.h"
|
||||||
|
#include "../objects/systemObjectList.h"
|
||||||
|
#include "../devices/logicalAddresses.h"
|
||||||
|
#include "../devices/powerSwitcherList.h"
|
||||||
|
|
||||||
|
#include <fsfw/devicehandlers/DeviceHandlerBase.h>
|
||||||
|
#include <fsfw/events/EventManager.h>
|
||||||
|
#include <fsfw/health/HealthTable.h>
|
||||||
|
#include <fsfw/tmtcpacket/pus/TmPacketStored.h>
|
||||||
|
#include <fsfw/tmtcservices/CommandingServiceBase.h>
|
||||||
|
#include <fsfw/tmtcservices/PusServiceBase.h>
|
||||||
|
#include <internalError/InternalErrorReporter.h>
|
||||||
|
|
||||||
|
#include <cstdint>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This class should be used to create all system objects required for
|
||||||
|
* the on-board software, using the object ID list from the configuration
|
||||||
|
* folder.
|
||||||
|
*
|
||||||
|
* The objects are registered in the internal object manager automatically.
|
||||||
|
* This is used later to add objects to tasks.
|
||||||
|
*
|
||||||
|
* This file also sets static framework IDs.
|
||||||
|
*
|
||||||
|
* Framework objects are created first.
|
||||||
|
* @ingroup init
|
||||||
|
*/
|
||||||
|
void Factory::produce(void) {
|
||||||
|
setStaticFrameworkObjectIds();
|
||||||
|
new EventManager(objects::EVENT_MANAGER);
|
||||||
|
new HealthTable(objects::HEALTH_TABLE);
|
||||||
|
new InternalErrorReporter(objects::INTERNAL_ERROR_REPORTER);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Factory::setStaticFrameworkObjectIds() {
|
||||||
|
PusServiceBase::packetSource = objects::NO_OBJECT;
|
||||||
|
PusServiceBase::packetDestination = objects::NO_OBJECT;
|
||||||
|
|
||||||
|
CommandingServiceBase::defaultPacketSource = objects::NO_OBJECT;
|
||||||
|
CommandingServiceBase::defaultPacketDestination = objects::NO_OBJECT;
|
||||||
|
|
||||||
|
VerificationReporter::messageReceiver = objects::PUS_SERVICE_1_VERIFICATION;
|
||||||
|
|
||||||
|
DeviceHandlerBase::powerSwitcherId = objects::NO_OBJECT;
|
||||||
|
DeviceHandlerBase::rawDataReceiverId = objects::PUS_SERVICE_2_DEVICE_ACCESS;
|
||||||
|
|
||||||
|
DeviceHandlerFailureIsolation::powerConfirmationId = objects::NO_OBJECT;
|
||||||
|
|
||||||
|
TmPacketStored::timeStamperId = objects::NO_OBJECT;
|
||||||
|
}
|
||||||
|
|
17
defaultcfg/fsfwconfig/objects/Factory.h
Normal file
17
defaultcfg/fsfwconfig/objects/Factory.h
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
#ifndef FACTORY_H_
|
||||||
|
#define FACTORY_H_
|
||||||
|
|
||||||
|
#include <fsfw/objectmanager/SystemObjectIF.h>
|
||||||
|
#include <cstddef>
|
||||||
|
|
||||||
|
namespace Factory {
|
||||||
|
/**
|
||||||
|
* @brief Creates all SystemObject elements which are persistent
|
||||||
|
* during execution.
|
||||||
|
*/
|
||||||
|
void produce();
|
||||||
|
void setStaticFrameworkObjectIds();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#endif /* FACTORY_H_ */
|
16
defaultcfg/fsfwconfig/objects/systemObjectList.h
Normal file
16
defaultcfg/fsfwconfig/objects/systemObjectList.h
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
#ifndef CONFIG_OBJECTS_SYSTEMOBJECTLIST_H_
|
||||||
|
#define CONFIG_OBJECTS_SYSTEMOBJECTLIST_H_
|
||||||
|
|
||||||
|
#include <cstdint>
|
||||||
|
#include <fsfw/objectmanager/frameworkObjects.h>
|
||||||
|
|
||||||
|
// The objects will be instantiated in the ID order
|
||||||
|
namespace objects {
|
||||||
|
enum sourceObjects: uint32_t {
|
||||||
|
/* All addresses between start and end are reserved for the FSFW */
|
||||||
|
FSFW_CONFIG_RESERVED_START = PUS_SERVICE_1_VERIFICATION,
|
||||||
|
FSFW_CONFIG_RESERVED_END = TM_STORE
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* BSP_CONFIG_OBJECTS_SYSTEMOBJECTLIST_H_ */
|
@ -0,0 +1,23 @@
|
|||||||
|
#include "PollingSequenceFactory.h"
|
||||||
|
|
||||||
|
#include <fsfw/serviceinterface/ServiceInterfaceStream.h>
|
||||||
|
#include <fsfw/devicehandlers/DeviceHandlerIF.h>
|
||||||
|
#include <fsfw/tasks/FixedTimeslotTaskIF.h>
|
||||||
|
|
||||||
|
ReturnValue_t pst::pollingSequenceInitDefault(
|
||||||
|
FixedTimeslotTaskIF *thisSequence) {
|
||||||
|
/* Length of a communication cycle */
|
||||||
|
uint32_t length = thisSequence->getPeriodMs();
|
||||||
|
|
||||||
|
/* Add polling sequence table here */
|
||||||
|
|
||||||
|
if (thisSequence->checkSequence() == HasReturnvaluesIF::RETURN_OK) {
|
||||||
|
return HasReturnvaluesIF::RETURN_OK;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
sif::error << "pst::pollingSequenceInitDefault: Sequence invalid!"
|
||||||
|
<< std::endl;
|
||||||
|
return HasReturnvaluesIF::RETURN_FAILED;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,32 @@
|
|||||||
|
#ifndef POLLINGSEQUENCEFACTORY_H_
|
||||||
|
#define POLLINGSEQUENCEFACTORY_H_
|
||||||
|
|
||||||
|
#include <fsfw/returnvalues/HasReturnvaluesIF.h>
|
||||||
|
|
||||||
|
class FixedTimeslotTaskIF;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* All device handlers are scheduled by adding them into Polling Sequence Tables (PST)
|
||||||
|
* to satisfy stricter timing requirements of device communication,
|
||||||
|
* A device handler has four different communication steps:
|
||||||
|
* 1. DeviceHandlerIF::SEND_WRITE -> Send write via interface
|
||||||
|
* 2. DeviceHandlerIF::GET_WRITE -> Get confirmation for write
|
||||||
|
* 3. DeviceHandlerIF::SEND_READ -> Send read request
|
||||||
|
* 4. DeviceHandlerIF::GET_READ -> Read from interface
|
||||||
|
* The PST specifies precisely when the respective ComIF functions are called
|
||||||
|
* during the communication cycle time.
|
||||||
|
* The task is created using the FixedTimeslotTaskIF,
|
||||||
|
* which utilises the underlying Operating System Abstraction Layer (OSAL)
|
||||||
|
*
|
||||||
|
* @param thisSequence FixedTimeslotTaskIF * object is passed inside the Factory class when creating the PST
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
namespace pst {
|
||||||
|
|
||||||
|
/* Default PST */
|
||||||
|
ReturnValue_t pollingSequenceInitDefault(FixedTimeslotTaskIF *thisSequence);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* POLLINGSEQUENCEINIT_H_ */
|
16
defaultcfg/fsfwconfig/returnvalues/classIds.h
Normal file
16
defaultcfg/fsfwconfig/returnvalues/classIds.h
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
#ifndef CONFIG_RETURNVALUES_CLASSIDS_H_
|
||||||
|
#define CONFIG_RETURNVALUES_CLASSIDS_H_
|
||||||
|
|
||||||
|
#include <fsfw/returnvalues/FwClassIds.h>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief CLASS_ID defintions which are required for custom returnvalues.
|
||||||
|
*/
|
||||||
|
namespace CLASS_ID {
|
||||||
|
enum {
|
||||||
|
MISSION_CLASS_ID_START = FW_CLASS_ID_COUNT,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#endif /* CONFIG_RETURNVALUES_CLASSIDS_H_ */
|
18
defaultcfg/fsfwconfig/tmtc/apid.h
Normal file
18
defaultcfg/fsfwconfig/tmtc/apid.h
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
#ifndef CONFIG_TMTC_APID_H_
|
||||||
|
#define CONFIG_TMTC_APID_H_
|
||||||
|
|
||||||
|
#include <cstdint>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Application Process Definition: entity, uniquely identified by an
|
||||||
|
* application process ID (APID), capable of generating telemetry source
|
||||||
|
* packets and receiving telecommand packets.
|
||||||
|
*
|
||||||
|
* Chose APID(s) for mission and define it here.
|
||||||
|
*/
|
||||||
|
namespace apid {
|
||||||
|
static const uint16_t DEFAULT_APID = 0x00;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#endif /* CONFIG_TMTC_APID_H_ */
|
23
defaultcfg/fsfwconfig/tmtc/pusIds.h
Normal file
23
defaultcfg/fsfwconfig/tmtc/pusIds.h
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
#ifndef CONFIG_TMTC_PUSIDS_HPP_
|
||||||
|
#define CONFIG_TMTC_PUSIDS_HPP_
|
||||||
|
|
||||||
|
namespace pus {
|
||||||
|
enum Ids: uint8_t {
|
||||||
|
PUS_SERVICE_1 = 1,
|
||||||
|
PUS_SERVICE_2 = 2,
|
||||||
|
PUS_SERVICE_3 = 3,
|
||||||
|
PUS_SERVICE_5 = 5,
|
||||||
|
PUS_SERVICE_6 = 6,
|
||||||
|
PUS_SERVICE_8 = 8,
|
||||||
|
PUS_SERVICE_9 = 9,
|
||||||
|
PUS_SERVICE_11 = 11,
|
||||||
|
PUS_SERVICE_17 = 17,
|
||||||
|
PUS_SERVICE_19 = 19,
|
||||||
|
PUS_SERVICE_20 = 20,
|
||||||
|
PUS_SERVICE_23 = 23,
|
||||||
|
PUS_SERVICE_200 = 200,
|
||||||
|
PUS_SERVICE_201 = 201,
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif /* CONFIG_TMTC_PUSIDS_HPP_ */
|
@ -1262,7 +1262,7 @@ void DeviceHandlerBase::buildInternalCommand(void) {
|
|||||||
if (result == BUSY) {
|
if (result == BUSY) {
|
||||||
//so we can track misconfigurations
|
//so we can track misconfigurations
|
||||||
sif::debug << std::hex << getObjectId()
|
sif::debug << std::hex << getObjectId()
|
||||||
<< ": DHB::buildInternalCommand: Busy" << std::endl;
|
<< ": DHB::buildInternalCommand: Busy" << std::dec << std::endl;
|
||||||
result = NOTHING_TO_SEND; //no need to report this
|
result = NOTHING_TO_SEND; //no need to report this
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include "fwSubsystemIdRanges.h"
|
#include "fwSubsystemIdRanges.h"
|
||||||
//could be move to more suitable location
|
//could be move to more suitable location
|
||||||
#include <config/tmtc/subsystemIdRanges.h>
|
#include <events/subsystemIdRanges.h>
|
||||||
|
|
||||||
typedef uint16_t EventId_t;
|
typedef uint16_t EventId_t;
|
||||||
typedef uint8_t EventSeverity_t;
|
typedef uint8_t EventSeverity_t;
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
#include "EventManager.h"
|
#include "EventManager.h"
|
||||||
#include "EventMessage.h"
|
#include "EventMessage.h"
|
||||||
|
#include <FSFWConfig.h>
|
||||||
|
|
||||||
#include "../serviceinterface/ServiceInterfaceStream.h"
|
#include "../serviceinterface/ServiceInterfaceStream.h"
|
||||||
#include "../ipc/QueueFactory.h"
|
#include "../ipc/QueueFactory.h"
|
||||||
#include "../ipc/MutexFactory.h"
|
#include "../ipc/MutexFactory.h"
|
||||||
@ -12,8 +14,10 @@ const uint16_t EventManager::POOL_SIZES[N_POOLS] = {
|
|||||||
// objects registering for certain events.
|
// objects registering for certain events.
|
||||||
// Each listener requires 1 or 2 EventIdMatcher and 1 or 2 ReportRangeMatcher.
|
// Each listener requires 1 or 2 EventIdMatcher and 1 or 2 ReportRangeMatcher.
|
||||||
// So a good guess is 75 to a max of 100 pools required for each, which fits well.
|
// So a good guess is 75 to a max of 100 pools required for each, which fits well.
|
||||||
// SHOULDDO: Shouldn't this be in the config folder and passed via ctor?
|
const uint16_t EventManager::N_ELEMENTS[N_POOLS] = {
|
||||||
const uint16_t EventManager::N_ELEMENTS[N_POOLS] = { 240, 120, 120 };
|
fsfwconfig::FSFW_EVENTMGMR_MATCHTREE_NODES ,
|
||||||
|
fsfwconfig::FSFW_EVENTMGMT_EVENTIDMATCHERS,
|
||||||
|
fsfwconfig::FSFW_EVENTMGMR_RANGEMATCHERS };
|
||||||
|
|
||||||
EventManager::EventManager(object_id_t setObjectId) :
|
EventManager::EventManager(object_id_t setObjectId) :
|
||||||
SystemObject(setObjectId),
|
SystemObject(setObjectId),
|
||||||
|
13
fsfw.mk
13
fsfw.mk
@ -28,12 +28,25 @@ CXXSRC += $(wildcard $(FRAMEWORK_PATH)/osal/*.cpp)
|
|||||||
# select the OS
|
# select the OS
|
||||||
ifeq ($(OS_FSFW),rtems)
|
ifeq ($(OS_FSFW),rtems)
|
||||||
CXXSRC += $(wildcard $(FRAMEWORK_PATH)/osal/rtems/*.cpp)
|
CXXSRC += $(wildcard $(FRAMEWORK_PATH)/osal/rtems/*.cpp)
|
||||||
|
|
||||||
else ifeq ($(OS_FSFW),linux)
|
else ifeq ($(OS_FSFW),linux)
|
||||||
CXXSRC += $(wildcard $(FRAMEWORK_PATH)/osal/linux/*.cpp)
|
CXXSRC += $(wildcard $(FRAMEWORK_PATH)/osal/linux/*.cpp)
|
||||||
|
|
||||||
else ifeq ($(OS_FSFW),freeRTOS)
|
else ifeq ($(OS_FSFW),freeRTOS)
|
||||||
CXXSRC += $(wildcard $(FRAMEWORK_PATH)/osal/FreeRTOS/*.cpp)
|
CXXSRC += $(wildcard $(FRAMEWORK_PATH)/osal/FreeRTOS/*.cpp)
|
||||||
|
|
||||||
else ifeq ($(OS_FSFW),host)
|
else ifeq ($(OS_FSFW),host)
|
||||||
CXXSRC += $(wildcard $(FRAMEWORK_PATH)/osal/host/*.cpp)
|
CXXSRC += $(wildcard $(FRAMEWORK_PATH)/osal/host/*.cpp)
|
||||||
|
ifeq ($(OS),Windows_NT)
|
||||||
|
CXXSRC += $(wildcard $(FRAMEWORK_PATH)/osal/windows/*.cpp)
|
||||||
|
else
|
||||||
|
# For now, the linux UDP bridge sources needs to be included manually by upper makefile
|
||||||
|
# for host OS because we can't be sure the OS is linux.
|
||||||
|
# Following lines can be used to do this:
|
||||||
|
# CXXSRC += $(FRAMEWORK_PATH)/osal/linux/TcUnixUdpPollingTask.cpp
|
||||||
|
# CXXSRC += $(FRAMEWORK_PATH)/osal/linux/TmTcUnixUdpBridge.cpp
|
||||||
|
endif
|
||||||
|
|
||||||
else
|
else
|
||||||
$(error invalid OS_FSFW specified, valid OS_FSFW are rtems, linux, freeRTOS, host)
|
$(error invalid OS_FSFW specified, valid OS_FSFW are rtems, linux, freeRTOS, host)
|
||||||
endif
|
endif
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#ifndef HASHEALTHIF_H_
|
#ifndef FSFW_HEALTH_HASHEALTHIF_H_
|
||||||
#define HASHEALTHIF_H_
|
#define FSFW_HEALTH_HASHEALTHIF_H_
|
||||||
|
|
||||||
#include "../events/Event.h"
|
#include "../events/Event.h"
|
||||||
#include "../returnvalues/HasReturnvaluesIF.h"
|
#include "../returnvalues/HasReturnvaluesIF.h"
|
||||||
@ -8,9 +8,13 @@
|
|||||||
class HasHealthIF {
|
class HasHealthIF {
|
||||||
public:
|
public:
|
||||||
|
|
||||||
typedef enum {
|
enum HealthState: uint8_t {
|
||||||
HEALTHY = 1, FAULTY = 0, EXTERNAL_CONTROL = 2, NEEDS_RECOVERY = 3, PERMANENT_FAULTY = 4
|
HEALTHY = 1,
|
||||||
} HealthState;
|
FAULTY = 0,
|
||||||
|
EXTERNAL_CONTROL = 2,
|
||||||
|
NEEDS_RECOVERY = 3,
|
||||||
|
PERMANENT_FAULTY = 4
|
||||||
|
};
|
||||||
|
|
||||||
static const uint8_t INTERFACE_ID = CLASS_ID::HAS_HEALTH_IF;
|
static const uint8_t INTERFACE_ID = CLASS_ID::HAS_HEALTH_IF;
|
||||||
static const ReturnValue_t OBJECT_NOT_HEALTHY = MAKE_RETURN_CODE(1);
|
static const ReturnValue_t OBJECT_NOT_HEALTHY = MAKE_RETURN_CODE(1);
|
||||||
@ -31,20 +35,17 @@ public:
|
|||||||
virtual MessageQueueId_t getCommandQueue() const = 0;
|
virtual MessageQueueId_t getCommandQueue() const = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* set the Health State
|
* @brief Set the Health State
|
||||||
*
|
|
||||||
* The parent will be informed, if the Health changes
|
* The parent will be informed, if the Health changes
|
||||||
*
|
|
||||||
* @param health
|
* @param health
|
||||||
*/
|
*/
|
||||||
virtual ReturnValue_t setHealth(HealthState health) = 0;
|
virtual ReturnValue_t setHealth(HealthState health) = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* get Health State
|
* @brief Get Health State
|
||||||
*
|
* @return Health State of the object
|
||||||
* @return Health State of the object
|
|
||||||
*/
|
*/
|
||||||
virtual HasHealthIF::HealthState getHealth() = 0;
|
virtual HasHealthIF::HealthState getHealth() = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* HASHEALTHIF_H_ */
|
#endif /* FSFW_HEALTH_HASHEALTHIF_H_ */
|
||||||
|
@ -12,13 +12,15 @@
|
|||||||
#include "../returnvalues/HasReturnvaluesIF.h"
|
#include "../returnvalues/HasReturnvaluesIF.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Helper class for Objects that implement HasHealthIF
|
* @brief Helper class for Objects that implement HasHealthIF
|
||||||
|
* @details
|
||||||
|
* It takes care of registering with the Health Table as well as handling
|
||||||
|
* health commands (including replying to the sender) and updating
|
||||||
|
* the Health Table.
|
||||||
*
|
*
|
||||||
* It takes care of registering with the Health Table as well as handling health commands
|
* If a parent is set in the ctor, the parent will be informed with a
|
||||||
* (including replying to the sender) and updating the Health Table.
|
* @c HEALTH_INFO message about changes in the health state.
|
||||||
*
|
* Note that a @c HEALTH_INFO is only generated if the Health
|
||||||
* If a parent is set in the ctor, the parent will be informed with a @c HEALTH_INFO message
|
|
||||||
* about changes in the health state. Note that a @c HEALTH_INFO is only generated if the Health
|
|
||||||
* changes, not for all @c HEALTH_SET commands received.
|
* changes, not for all @c HEALTH_SET commands received.
|
||||||
*
|
*
|
||||||
* It does NOT handle @c HEALTH_INFO messages
|
* It does NOT handle @c HEALTH_INFO messages
|
||||||
@ -27,10 +29,9 @@ class HealthHelper {
|
|||||||
public:
|
public:
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ctor
|
|
||||||
*
|
|
||||||
* @param owner
|
* @param owner
|
||||||
* @param objectId the object Id to use when communication with the HealthTable
|
* @param objectId The object Id to use when communication with
|
||||||
|
* the HealthTable
|
||||||
*/
|
*/
|
||||||
HealthHelper(HasHealthIF* owner, object_id_t objectId);
|
HealthHelper(HasHealthIF* owner, object_id_t objectId);
|
||||||
|
|
||||||
@ -56,8 +57,9 @@ public:
|
|||||||
*
|
*
|
||||||
* @param message
|
* @param message
|
||||||
* @return
|
* @return
|
||||||
* -@c RETURN_OK if the message was handled
|
* -@c RETURN_OK if the message was handled
|
||||||
* -@c RETURN_FAILED if the message could not be handled (ie it was not a @c HEALTH_SET or @c HEALTH_READ message)
|
* -@c RETURN_FAILED if the message could not be handled
|
||||||
|
* (ie it was not a @c HEALTH_SET or @c HEALTH_READ message)
|
||||||
*/
|
*/
|
||||||
ReturnValue_t handleHealthCommand(CommandMessage *message);
|
ReturnValue_t handleHealthCommand(CommandMessage *message);
|
||||||
|
|
||||||
@ -78,16 +80,19 @@ public:
|
|||||||
HasHealthIF::HealthState getHealth();
|
HasHealthIF::HealthState getHealth();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param parentQueue the Queue id of the parent object. Set to 0 if no parent present
|
* @param parentQueue The queue ID of the parent object.
|
||||||
|
* Set to 0 if no parent present
|
||||||
*/
|
*/
|
||||||
void setParentQueue(MessageQueueId_t parentQueue);
|
void setParentQueue(MessageQueueId_t parentQueue);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param parentQueue the Queue id of the parent object. Set to 0 if no parent present
|
* @param parentQueue The queue ID of the parent object.
|
||||||
|
* Set to 0 if no parent present
|
||||||
* @return
|
* @return
|
||||||
* -@c RETURN_OK if the Health Table was found and the object could be registered
|
* -@c RETURN_OK if the Health Table was found and the object
|
||||||
* -@c RETURN_FAILED else
|
* could be registered
|
||||||
|
* -@c RETURN_FAILED else
|
||||||
*/
|
*/
|
||||||
ReturnValue_t initialize(MessageQueueId_t parentQueue );
|
ReturnValue_t initialize(MessageQueueId_t parentQueue );
|
||||||
|
|
||||||
@ -110,11 +115,15 @@ private:
|
|||||||
HasHealthIF* owner;
|
HasHealthIF* owner;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* if the #parentQueue is not NULL, a @c HEALTH_INFO message will be sent to this queue
|
* if the #parentQueue is not NULL, a @c HEALTH_INFO message
|
||||||
* @param health the health is passed as parameter so that the number of calls to the health table can be minimized
|
* will be sent to this queue
|
||||||
|
* @param health
|
||||||
|
* The health is passed as parameter so that the number of
|
||||||
|
* calls to the health table can be minimized
|
||||||
* @param oldHealth information of the previous health state.
|
* @param oldHealth information of the previous health state.
|
||||||
*/
|
*/
|
||||||
void informParent(HasHealthIF::HealthState health, HasHealthIF::HealthState oldHealth);
|
void informParent(HasHealthIF::HealthState health,
|
||||||
|
HasHealthIF::HealthState oldHealth);
|
||||||
|
|
||||||
void handleSetHealthCommand(CommandMessage *message);
|
void handleSetHealthCommand(CommandMessage *message);
|
||||||
};
|
};
|
||||||
|
@ -7,11 +7,13 @@ void HealthMessage::setHealthMessage(CommandMessage* message, Command_t command,
|
|||||||
message->setParameter2(oldHealth);
|
message->setParameter2(oldHealth);
|
||||||
}
|
}
|
||||||
|
|
||||||
void HealthMessage::setHealthMessage(CommandMessage* message, Command_t command) {
|
void HealthMessage::setHealthMessage(CommandMessage* message,
|
||||||
|
Command_t command) {
|
||||||
message->setCommand(command);
|
message->setCommand(command);
|
||||||
}
|
}
|
||||||
|
|
||||||
HasHealthIF::HealthState HealthMessage::getHealth(const CommandMessage* message) {
|
HasHealthIF::HealthState HealthMessage::getHealth(
|
||||||
|
const CommandMessage* message) {
|
||||||
return (HasHealthIF::HealthState) message->getParameter();
|
return (HasHealthIF::HealthState) message->getParameter();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#ifndef HEALTHMESSAGE_H_
|
#ifndef FSFW_HEALTH_HEALTHMESSAGE_H_
|
||||||
#define HEALTHMESSAGE_H_
|
#define FSFW_HEALTH_HEALTHMESSAGE_H_
|
||||||
|
|
||||||
#include "HasHealthIF.h"
|
#include "HasHealthIF.h"
|
||||||
#include "../ipc/CommandMessage.h"
|
#include "../ipc/CommandMessage.h"
|
||||||
@ -7,14 +7,20 @@
|
|||||||
class HealthMessage {
|
class HealthMessage {
|
||||||
public:
|
public:
|
||||||
static const uint8_t MESSAGE_ID = messagetypes::HEALTH_COMMAND;
|
static const uint8_t MESSAGE_ID = messagetypes::HEALTH_COMMAND;
|
||||||
static const Command_t HEALTH_SET = MAKE_COMMAND_ID(1);//REPLY_COMMAND_OK/REPLY_REJECTED
|
|
||||||
static const Command_t HEALTH_ANNOUNCE = MAKE_COMMAND_ID(3); //NO REPLY!
|
static const Command_t HEALTH_SET = MAKE_COMMAND_ID(1);
|
||||||
|
// No reply expected, health will be announced as event!
|
||||||
|
static const Command_t HEALTH_ANNOUNCE = MAKE_COMMAND_ID(2);
|
||||||
|
// Same as before, but all objects in health table will
|
||||||
|
// announce their health as events.
|
||||||
|
static const Command_t HEALTH_ANNOUNCE_ALL = MAKE_COMMAND_ID(3);
|
||||||
|
|
||||||
static const Command_t HEALTH_INFO = MAKE_COMMAND_ID(5);
|
static const Command_t HEALTH_INFO = MAKE_COMMAND_ID(5);
|
||||||
static const Command_t REPLY_HEALTH_SET = MAKE_COMMAND_ID(6);
|
static const Command_t REPLY_HEALTH_SET = MAKE_COMMAND_ID(6);
|
||||||
|
|
||||||
static void setHealthMessage(CommandMessage *message, Command_t command,
|
static void setHealthMessage(CommandMessage *message, Command_t command,
|
||||||
HasHealthIF::HealthState health, HasHealthIF::HealthState oldHealth = HasHealthIF::FAULTY);
|
HasHealthIF::HealthState health,
|
||||||
|
HasHealthIF::HealthState oldHealth = HasHealthIF::FAULTY);
|
||||||
static void setHealthMessage(CommandMessage *message, Command_t command);
|
static void setHealthMessage(CommandMessage *message, Command_t command);
|
||||||
|
|
||||||
static HasHealthIF::HealthState getHealth(const CommandMessage *message);
|
static HasHealthIF::HealthState getHealth(const CommandMessage *message);
|
||||||
@ -27,4 +33,4 @@ private:
|
|||||||
HealthMessage();
|
HealthMessage();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* HEALTHMESSAGE_H_ */
|
#endif /* FSFW_HEALTH_HEALTHMESSAGE_H_ */
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
#include "HealthTable.h"
|
#include "HealthTable.h"
|
||||||
#include "../serialize/SerializeAdapter.h"
|
#include "../ipc/MutexHelper.h"
|
||||||
#include "../ipc/MutexFactory.h"
|
#include "../ipc/MutexFactory.h"
|
||||||
|
#include "../serialize/SerializeAdapter.h"
|
||||||
|
|
||||||
HealthTable::HealthTable(object_id_t objectid) :
|
HealthTable::HealthTable(object_id_t objectid) :
|
||||||
SystemObject(objectid) {
|
SystemObject(objectid) {
|
||||||
@ -9,6 +10,12 @@ HealthTable::HealthTable(object_id_t objectid) :
|
|||||||
mapIterator = healthMap.begin();
|
mapIterator = healthMap.begin();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void HealthTable::setMutexTimeout(MutexIF::TimeoutType timeoutType,
|
||||||
|
uint32_t timeoutMs) {
|
||||||
|
this->timeoutType = timeoutType;
|
||||||
|
this->mutexTimeoutMs = timeoutMs;
|
||||||
|
}
|
||||||
|
|
||||||
HealthTable::~HealthTable() {
|
HealthTable::~HealthTable() {
|
||||||
MutexFactory::instance()->deleteMutex(mutex);
|
MutexFactory::instance()->deleteMutex(mutex);
|
||||||
}
|
}
|
||||||
@ -18,74 +25,63 @@ ReturnValue_t HealthTable::registerObject(object_id_t object,
|
|||||||
if (healthMap.count(object) != 0) {
|
if (healthMap.count(object) != 0) {
|
||||||
return HasReturnvaluesIF::RETURN_FAILED;
|
return HasReturnvaluesIF::RETURN_FAILED;
|
||||||
}
|
}
|
||||||
healthMap.insert(
|
healthMap.emplace(object, initilialState);
|
||||||
std::pair<object_id_t, HasHealthIF::HealthState>(object,
|
|
||||||
initilialState));
|
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
return HasReturnvaluesIF::RETURN_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
void HealthTable::setHealth(object_id_t object,
|
void HealthTable::setHealth(object_id_t object,
|
||||||
HasHealthIF::HealthState newState) {
|
HasHealthIF::HealthState newState) {
|
||||||
mutex->lockMutex(MutexIF::BLOCKING);
|
MutexHelper(mutex, timeoutType, mutexTimeoutMs);
|
||||||
HealthMap::iterator iter = healthMap.find(object);
|
HealthMap::iterator iter = healthMap.find(object);
|
||||||
if (iter != healthMap.end()) {
|
if (iter != healthMap.end()) {
|
||||||
iter->second = newState;
|
iter->second = newState;
|
||||||
}
|
}
|
||||||
mutex->unlockMutex();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
HasHealthIF::HealthState HealthTable::getHealth(object_id_t object) {
|
HasHealthIF::HealthState HealthTable::getHealth(object_id_t object) {
|
||||||
HasHealthIF::HealthState state = HasHealthIF::HEALTHY;
|
HasHealthIF::HealthState state = HasHealthIF::HEALTHY;
|
||||||
mutex->lockMutex(MutexIF::BLOCKING);
|
MutexHelper(mutex, timeoutType, mutexTimeoutMs);
|
||||||
HealthMap::iterator iter = healthMap.find(object);
|
HealthMap::iterator iter = healthMap.find(object);
|
||||||
if (iter != healthMap.end()) {
|
if (iter != healthMap.end()) {
|
||||||
state = iter->second;
|
state = iter->second;
|
||||||
}
|
}
|
||||||
mutex->unlockMutex();
|
|
||||||
return state;
|
return state;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t HealthTable::getPrintSize() {
|
|
||||||
mutex->lockMutex(MutexIF::BLOCKING);
|
|
||||||
uint32_t size = healthMap.size() * 5 + 2;
|
|
||||||
mutex->unlockMutex();
|
|
||||||
return size;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool HealthTable::hasHealth(object_id_t object) {
|
bool HealthTable::hasHealth(object_id_t object) {
|
||||||
bool exits = false;
|
MutexHelper(mutex, timeoutType, mutexTimeoutMs);
|
||||||
mutex->lockMutex(MutexIF::BLOCKING);
|
|
||||||
HealthMap::iterator iter = healthMap.find(object);
|
HealthMap::iterator iter = healthMap.find(object);
|
||||||
if (iter != healthMap.end()) {
|
if (iter != healthMap.end()) {
|
||||||
exits = true;
|
return true;
|
||||||
}
|
}
|
||||||
mutex->unlockMutex();
|
return false;
|
||||||
return exits;
|
}
|
||||||
|
|
||||||
|
size_t HealthTable::getPrintSize() {
|
||||||
|
MutexHelper(mutex, timeoutType, mutexTimeoutMs);
|
||||||
|
uint32_t size = healthMap.size() * sizeof(object_id_t) +
|
||||||
|
sizeof(HasHealthIF::HealthState) + sizeof(uint16_t);
|
||||||
|
return size;
|
||||||
}
|
}
|
||||||
|
|
||||||
void HealthTable::printAll(uint8_t* pointer, size_t maxSize) {
|
void HealthTable::printAll(uint8_t* pointer, size_t maxSize) {
|
||||||
mutex->lockMutex(MutexIF::BLOCKING);
|
MutexHelper(mutex, timeoutType, mutexTimeoutMs);
|
||||||
size_t size = 0;
|
size_t size = 0;
|
||||||
uint16_t count = healthMap.size();
|
uint16_t count = healthMap.size();
|
||||||
ReturnValue_t result = SerializeAdapter::serialize(&count,
|
SerializeAdapter::serialize(&count,
|
||||||
&pointer, &size, maxSize, SerializeIF::Endianness::BIG);
|
&pointer, &size, maxSize, SerializeIF::Endianness::BIG);
|
||||||
HealthMap::iterator iter;
|
for (const auto& health: healthMap) {
|
||||||
for (iter = healthMap.begin();
|
SerializeAdapter::serialize(&health.first,
|
||||||
iter != healthMap.end() && result == HasReturnvaluesIF::RETURN_OK;
|
|
||||||
++iter) {
|
|
||||||
result = SerializeAdapter::serialize(&iter->first,
|
|
||||||
&pointer, &size, maxSize, SerializeIF::Endianness::BIG);
|
&pointer, &size, maxSize, SerializeIF::Endianness::BIG);
|
||||||
uint8_t health = iter->second;
|
uint8_t healthValue = health.second;
|
||||||
result = SerializeAdapter::serialize(&health, &pointer, &size,
|
SerializeAdapter::serialize(&healthValue, &pointer, &size,
|
||||||
maxSize, SerializeIF::Endianness::BIG);
|
maxSize, SerializeIF::Endianness::BIG);
|
||||||
}
|
}
|
||||||
mutex->unlockMutex();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ReturnValue_t HealthTable::iterate(
|
ReturnValue_t HealthTable::iterate(HealthEntry *value, bool reset) {
|
||||||
std::pair<object_id_t, HasHealthIF::HealthState> *value, bool reset) {
|
|
||||||
ReturnValue_t result = HasReturnvaluesIF::RETURN_OK;
|
ReturnValue_t result = HasReturnvaluesIF::RETURN_OK;
|
||||||
mutex->lockMutex(MutexIF::BLOCKING);
|
MutexHelper(mutex, timeoutType, mutexTimeoutMs);
|
||||||
if (reset) {
|
if (reset) {
|
||||||
mapIterator = healthMap.begin();
|
mapIterator = healthMap.begin();
|
||||||
}
|
}
|
||||||
@ -94,7 +90,5 @@ ReturnValue_t HealthTable::iterate(
|
|||||||
}
|
}
|
||||||
*value = *mapIterator;
|
*value = *mapIterator;
|
||||||
mapIterator++;
|
mapIterator++;
|
||||||
mutex->unlockMutex();
|
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@ -1,35 +1,47 @@
|
|||||||
#ifndef HEALTHTABLE_H_
|
#ifndef FSFW_HEALTH_HEALTHTABLE_H_
|
||||||
#define HEALTHTABLE_H_
|
#define FSFW_HEALTH_HEALTHTABLE_H_
|
||||||
|
|
||||||
#include "HealthTableIF.h"
|
#include "HealthTableIF.h"
|
||||||
#include "../objectmanager/SystemObject.h"
|
#include "../objectmanager/SystemObject.h"
|
||||||
#include "../ipc/MutexIF.h"
|
#include "../ipc/MutexIF.h"
|
||||||
#include <map>
|
#include <map>
|
||||||
|
|
||||||
typedef std::map<object_id_t, HasHealthIF::HealthState> HealthMap;
|
|
||||||
|
|
||||||
class HealthTable: public HealthTableIF, public SystemObject {
|
class HealthTable: public HealthTableIF, public SystemObject {
|
||||||
public:
|
public:
|
||||||
HealthTable(object_id_t objectid);
|
HealthTable(object_id_t objectid);
|
||||||
virtual ~HealthTable();
|
virtual ~HealthTable();
|
||||||
|
|
||||||
virtual ReturnValue_t registerObject(object_id_t object,
|
void setMutexTimeout(MutexIF::TimeoutType timeoutType, uint32_t timeoutMs);
|
||||||
HasHealthIF::HealthState initilialState = HasHealthIF::HEALTHY);
|
|
||||||
|
|
||||||
virtual bool hasHealth(object_id_t object);
|
/** HealthTableIF overrides */
|
||||||
virtual void setHealth(object_id_t object, HasHealthIF::HealthState newState);
|
virtual ReturnValue_t registerObject(object_id_t object,
|
||||||
virtual HasHealthIF::HealthState getHealth(object_id_t);
|
HasHealthIF::HealthState initilialState =
|
||||||
|
HasHealthIF::HEALTHY) override;
|
||||||
|
virtual size_t getPrintSize() override;
|
||||||
|
virtual void printAll(uint8_t *pointer, size_t maxSize) override;
|
||||||
|
|
||||||
virtual uint32_t getPrintSize();
|
/** ManagesHealthIF overrides */
|
||||||
virtual void printAll(uint8_t *pointer, size_t maxSize);
|
virtual bool hasHealth(object_id_t object) override;
|
||||||
|
virtual void setHealth(object_id_t object,
|
||||||
|
HasHealthIF::HealthState newState) override;
|
||||||
|
virtual HasHealthIF::HealthState getHealth(object_id_t) override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
using HealthMap = std::map<object_id_t, HasHealthIF::HealthState>;
|
||||||
|
using HealthEntry = std::pair<object_id_t, HasHealthIF::HealthState>;
|
||||||
|
|
||||||
MutexIF* mutex;
|
MutexIF* mutex;
|
||||||
|
MutexIF::TimeoutType timeoutType = MutexIF::TimeoutType::WAITING;
|
||||||
|
uint32_t mutexTimeoutMs = 20;
|
||||||
|
|
||||||
HealthMap healthMap;
|
HealthMap healthMap;
|
||||||
|
|
||||||
HealthMap::iterator mapIterator;
|
HealthMap::iterator mapIterator;
|
||||||
|
|
||||||
virtual ReturnValue_t iterate(std::pair<object_id_t,HasHealthIF::HealthState> *value, bool reset = false);
|
virtual ReturnValue_t iterate(
|
||||||
|
HealthEntry* value,
|
||||||
|
bool reset = false) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* HEALTHTABLE_H_ */
|
#endif /* FSFW_HEALTH_HEALTHTABLE_H_ */
|
||||||
|
@ -1,26 +1,24 @@
|
|||||||
#ifndef HEALTHTABLEIF_H_
|
#ifndef FSFW_HEALTH_HEALTHTABLEIF_H_
|
||||||
#define HEALTHTABLEIF_H_
|
#define FSFW_HEALTH_HEALTHTABLEIF_H_
|
||||||
|
|
||||||
#include "ManagesHealthIF.h"
|
#include "ManagesHealthIF.h"
|
||||||
#include "../objectmanager/ObjectManagerIF.h"
|
#include "../objectmanager/ObjectManagerIF.h"
|
||||||
#include "../returnvalues/HasReturnvaluesIF.h"
|
#include "../returnvalues/HasReturnvaluesIF.h"
|
||||||
#include <map>
|
|
||||||
|
|
||||||
|
|
||||||
class HealthTableIF: public ManagesHealthIF {
|
class HealthTableIF: public ManagesHealthIF {
|
||||||
friend class HealthCommandingService;
|
|
||||||
public:
|
public:
|
||||||
virtual ~HealthTableIF() {
|
virtual ~HealthTableIF() {}
|
||||||
}
|
|
||||||
|
|
||||||
virtual ReturnValue_t registerObject(object_id_t object,
|
virtual ReturnValue_t registerObject(object_id_t object,
|
||||||
HasHealthIF::HealthState initilialState = HasHealthIF::HEALTHY) = 0;
|
HasHealthIF::HealthState initilialState = HasHealthIF::HEALTHY) = 0;
|
||||||
|
|
||||||
virtual uint32_t getPrintSize() = 0;
|
virtual size_t getPrintSize() = 0;
|
||||||
virtual void printAll(uint8_t *pointer, size_t maxSize) = 0;
|
virtual void printAll(uint8_t *pointer, size_t maxSize) = 0;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual ReturnValue_t iterate(std::pair<object_id_t,HasHealthIF::HealthState> *value, bool reset = false) = 0;
|
virtual ReturnValue_t iterate(
|
||||||
|
std::pair<object_id_t,HasHealthIF::HealthState> *value,
|
||||||
|
bool reset = false) = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* HEALTHTABLEIF_H_ */
|
#endif /* FRAMEWORK_HEALTH_HEALTHTABLEIF_H_ */
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
#ifndef FRAMEWORK_HEALTH_MANAGESHEALTHIF_H_
|
#ifndef FSFW_HEALTH_MANAGESHEALTHIF_H_
|
||||||
#define FRAMEWORK_HEALTH_MANAGESHEALTHIF_H_
|
#define FSFW_HEALTH_MANAGESHEALTHIF_H_
|
||||||
|
|
||||||
#include "HasHealthIF.h"
|
#include "HasHealthIF.h"
|
||||||
#include "../objectmanager/ObjectManagerIF.h"
|
#include "../objectmanager/ObjectManagerIF.h"
|
||||||
|
|
||||||
class ManagesHealthIF {
|
class ManagesHealthIF {
|
||||||
public:
|
public:
|
||||||
virtual ~ManagesHealthIF() {
|
virtual ~ManagesHealthIF() {
|
||||||
@ -49,4 +50,4 @@ public:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* FRAMEWORK_HEALTH_MANAGESHEALTHIF_H_ */
|
#endif /* FSFW_HEALTH_MANAGESHEALTHIF_H_ */
|
||||||
|
BIN
logo/FSFW_Logo_V3.png
Normal file
BIN
logo/FSFW_Logo_V3.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 134 KiB |
711
logo/FSFW_Logo_V3.svg
Normal file
711
logo/FSFW_Logo_V3.svg
Normal file
@ -0,0 +1,711 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||||
|
|
||||||
|
<svg
|
||||||
|
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||||
|
xmlns:cc="http://creativecommons.org/ns#"
|
||||||
|
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||||
|
xmlns:svg="http://www.w3.org/2000/svg"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||||
|
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||||
|
width="59.111mm"
|
||||||
|
height="67.383003mm"
|
||||||
|
viewBox="0 0 59.111 67.383003"
|
||||||
|
version="1.1"
|
||||||
|
id="svg22814"
|
||||||
|
inkscape:version="0.92.0 r15299"
|
||||||
|
sodipodi:docname="FSFW_Logo_V3.svg"
|
||||||
|
style="enable-background:new">
|
||||||
|
<defs
|
||||||
|
id="defs22808">
|
||||||
|
<inkscape:path-effect
|
||||||
|
effect="bspline"
|
||||||
|
id="path-effect23502"
|
||||||
|
is_visible="true"
|
||||||
|
weight="33.333333"
|
||||||
|
steps="2"
|
||||||
|
helper_size="0"
|
||||||
|
apply_no_weight="true"
|
||||||
|
apply_with_weight="true"
|
||||||
|
only_selected="false" />
|
||||||
|
<filter
|
||||||
|
inkscape:collect="always"
|
||||||
|
style="color-interpolation-filters:sRGB"
|
||||||
|
id="filter23683">
|
||||||
|
<feBlend
|
||||||
|
inkscape:collect="always"
|
||||||
|
mode="darken"
|
||||||
|
in2="BackgroundImage"
|
||||||
|
id="feBlend23685" />
|
||||||
|
</filter>
|
||||||
|
<meshgradient
|
||||||
|
inkscape:collect="always"
|
||||||
|
id="meshgradient23819"
|
||||||
|
gradientUnits="userSpaceOnUse"
|
||||||
|
x="-9.447978"
|
||||||
|
y="-28.967659"
|
||||||
|
gradientTransform="matrix(1.6672918,0,0,1.5637161,15.752536,45.300004)">
|
||||||
|
<meshrow
|
||||||
|
id="meshrow23821">
|
||||||
|
<meshpatch
|
||||||
|
id="meshpatch23823">
|
||||||
|
<stop
|
||||||
|
path="c 11.8178,0 23.6355,0 35.4533,0"
|
||||||
|
style="stop-color:#0087ce;stop-opacity:1"
|
||||||
|
id="stop23825" />
|
||||||
|
<stop
|
||||||
|
path="c 0,3.49232 0,6.98464 0,10.477"
|
||||||
|
style="stop-color:#00beff;stop-opacity:1"
|
||||||
|
id="stop23827" />
|
||||||
|
<stop
|
||||||
|
path="c -11.8178,0 -23.6355,0 -35.4533,0"
|
||||||
|
style="stop-color:#0087ce;stop-opacity:1"
|
||||||
|
id="stop23829" />
|
||||||
|
<stop
|
||||||
|
path="c 0,-3.49232 0,-6.98464 0,-10.477"
|
||||||
|
style="stop-color:#00519e;stop-opacity:1"
|
||||||
|
id="stop23831" />
|
||||||
|
</meshpatch>
|
||||||
|
</meshrow>
|
||||||
|
</meshgradient>
|
||||||
|
<clipPath
|
||||||
|
clipPathUnits="userSpaceOnUse"
|
||||||
|
id="clipPath24955">
|
||||||
|
<g
|
||||||
|
style="display:inline;fill:url(#meshgradient24977);fill-opacity:1;enable-background:new"
|
||||||
|
id="g24975"
|
||||||
|
transform="translate(-42.742183,-140.61702)"
|
||||||
|
clip-path="none">
|
||||||
|
<path
|
||||||
|
inkscape:export-ydpi="499.60001"
|
||||||
|
inkscape:export-xdpi="499.60001"
|
||||||
|
style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:0.98999999;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.98699999;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
|
||||||
|
d="m 48.300305,143.44076 c -0.811661,0 -1.109125,0.75874 -1.480469,1.48047 l -4.00014,7.77454 c -0.371344,0.72173 0.668807,1.48047 1.480468,1.48047 h 9.625183 c 0.811661,0 1.109108,-0.75875 1.480469,-1.48047 l 4.00036,-7.77454 c 0.371361,-0.72172 -0.668808,-1.48047 -1.480469,-1.48047 z m 0,0.98828 h 9.625402 c 0.281935,0 0.621179,0.2415 0.492187,0.49219 l -4.00036,7.77454 c -0.128993,0.25069 -0.210251,0.49218 -0.492187,0.49218 h -9.625181 c -0.281935,0 -0.621175,-0.24149 -0.492189,-0.49218 l 4.000141,-7.77454 c 0.128986,-0.25069 0.210253,-0.49219 0.492187,-0.49219 z"
|
||||||
|
id="path24957"
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
sodipodi:nodetypes="ssssssssssssssssss" />
|
||||||
|
<path
|
||||||
|
inkscape:export-ydpi="499.60001"
|
||||||
|
inkscape:export-xdpi="499.60001"
|
||||||
|
sodipodi:nodetypes="ssssssssssssssssss"
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
id="path24959"
|
||||||
|
d="m 90.668816,143.44076 c -0.811661,0 -1.109125,0.75874 -1.480469,1.48047 l -4.00014,7.77454 c -0.371344,0.72173 0.668808,1.48047 1.480469,1.48047 h 9.625909 c 0.81166,0 1.109109,-0.75875 1.48047,-1.48047 l 4.000355,-7.77454 c 0.37136,-0.72172 -0.66881,-1.48047 -1.48046,-1.48047 z m 0,0.98828 h 9.626134 c 0.28193,0 0.62117,0.24151 0.49218,0.49219 l -4.000365,7.77454 c -0.128993,0.25069 -0.21025,0.49218 -0.49218,0.49218 h -9.625909 c -0.281935,0 -0.621174,-0.24149 -0.492188,-0.49218 l 4.00014,-7.77454 c 0.128986,-0.25069 0.210254,-0.49219 0.492188,-0.49219 z"
|
||||||
|
style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:0.98999999;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.98699999;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" />
|
||||||
|
<text
|
||||||
|
inkscape:export-ydpi="499.60001"
|
||||||
|
inkscape:export-xdpi="499.60001"
|
||||||
|
xml:space="preserve"
|
||||||
|
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:10.58333302px;line-height:6.61458349px;font-family:'Univers for UniS 55 Roman';-inkscape-font-specification:'Univers for UniS 55 Roman, ';letter-spacing:0px;word-spacing:0px;opacity:0.98999999;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332"
|
||||||
|
x="69.980721"
|
||||||
|
y="150.38542"
|
||||||
|
id="text24965"><tspan
|
||||||
|
dy="-2"
|
||||||
|
dx="0"
|
||||||
|
sodipodi:role="line"
|
||||||
|
id="tspan24961"
|
||||||
|
x="69.980721"
|
||||||
|
y="150.38542"
|
||||||
|
style="text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill-opacity:1;stroke-width:0.26458332">fs</tspan><tspan
|
||||||
|
dx="0 0 -0.27000001"
|
||||||
|
id="tspan24963"
|
||||||
|
sodipodi:role="line"
|
||||||
|
x="69.980721"
|
||||||
|
y="157"
|
||||||
|
style="text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill-opacity:1;stroke-width:0.26458332"> fw</tspan></text>
|
||||||
|
<g
|
||||||
|
inkscape:export-ydpi="499.60001"
|
||||||
|
inkscape:export-xdpi="499.60001"
|
||||||
|
transform="translate(-1.937002)"
|
||||||
|
id="g24969"
|
||||||
|
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:9.36171436px;line-height:5.85107136px;font-family:'Univers for UniS 55 Roman';-inkscape-font-specification:'Univers for UniS 55 Roman, ';letter-spacing:0px;word-spacing:0px;opacity:0.98999999;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.23404284"
|
||||||
|
aria-label="{">
|
||||||
|
<path
|
||||||
|
sodipodi:nodetypes="ccssccsssccccssccccssscc"
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
id="path24967"
|
||||||
|
style="font-size:18.72342873px;fill:#000000;fill-opacity:1;stroke-width:0.23404284"
|
||||||
|
d="m 67.678074,141.482 c -0.798867,0.0624 -1.915603,0.38946 -2.290072,0.80139 -0.361986,0.41191 -0.543,1.06141 -0.543,1.94766 v 1.29191 c 0,1.04851 -0.199567,1.82824 -0.599,2.34001 -0.386951,0.51177 -1.010722,0.82383 -1.872,0.93617 0.848795,0.11234 1.472567,0.41816 1.872,0.91745 0.399433,0.49929 0.599,1.22951 0.599,2.19064 v 1.38554 c 0,0.88624 0.193496,1.5478 0.543,1.98468 0.349504,0.44936 1.453759,0.79514 2.290072,0.85755 v 0.86501 c -1.260711,-0.0749 -2.215606,-0.38696 -2.864685,-0.93618 -0.636597,-0.53673 -0.954895,-1.55404 -0.954895,-3.05192 v -1.23574 c 0,-0.84879 -0.205958,-1.44794 -0.617873,-1.79745 -0.399433,-0.36199 -1.017306,-0.59291 -1.853619,-0.69277 v -0.95489 c 0.761419,-0.0624 1.360569,-0.28084 1.797449,-0.65532 0.449362,-0.38695 0.674043,-0.91745 0.674043,-1.59149 v -1.66639 c 0,-1.26071 0.293334,-2.19064 0.880001,-2.78979 0.586667,-0.59915 1.566527,-0.93617 2.939579,-1.01107 z" />
|
||||||
|
</g>
|
||||||
|
<g
|
||||||
|
inkscape:export-ydpi="499.60001"
|
||||||
|
inkscape:export-xdpi="499.60001"
|
||||||
|
aria-label="{"
|
||||||
|
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:9.36171436px;line-height:5.85107136px;font-family:'Univers for UniS 55 Roman';-inkscape-font-specification:'Univers for UniS 55 Roman, ';letter-spacing:0px;word-spacing:0px;opacity:0.98999999;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.23404284"
|
||||||
|
id="g24973"
|
||||||
|
transform="rotate(180,73.264036,148.80851)">
|
||||||
|
<path
|
||||||
|
d="m 67.678074,141.482 c -0.798867,0.0624 -1.915603,0.38946 -2.290072,0.80139 -0.361986,0.41191 -0.543,1.06141 -0.543,1.94766 v 1.29191 c 0,1.04851 -0.199567,1.82824 -0.599,2.34001 -0.386951,0.51177 -1.010722,0.82383 -1.872,0.93617 0.848795,0.11234 1.472567,0.41816 1.872,0.91745 0.399433,0.49929 0.599,1.22951 0.599,2.19064 v 1.38554 c 0,0.88624 0.193496,1.5478 0.543,1.98468 0.349504,0.44936 1.453759,0.79514 2.290072,0.85755 v 0.86501 c -1.260711,-0.0749 -2.215606,-0.38696 -2.864685,-0.93618 -0.636597,-0.53673 -0.954895,-1.55404 -0.954895,-3.05192 v -1.23574 c 0,-0.84879 -0.205958,-1.44794 -0.617873,-1.79745 -0.399433,-0.36199 -1.017306,-0.59291 -1.853619,-0.69277 v -0.95489 c 0.761419,-0.0624 1.360569,-0.28084 1.797449,-0.65532 0.449362,-0.38695 0.674043,-0.91745 0.674043,-1.59149 v -1.66639 c 0,-1.26071 0.293334,-2.19064 0.880001,-2.78979 0.586667,-0.59915 1.566527,-0.93617 2.939579,-1.01107 z"
|
||||||
|
style="font-size:18.72342873px;fill:#000000;fill-opacity:1;stroke-width:0.23404284"
|
||||||
|
id="path24971"
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
sodipodi:nodetypes="ccssccsssccccssccccssscc" />
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
</clipPath>
|
||||||
|
<meshgradient
|
||||||
|
inkscape:collect="always"
|
||||||
|
id="meshgradient24977"
|
||||||
|
gradientUnits="userSpaceOnUse"
|
||||||
|
gradientTransform="matrix(1.6672918,0,0,1.5637161,15.752536,45.300004)"
|
||||||
|
x="42.742184"
|
||||||
|
y="140.617">
|
||||||
|
<meshrow
|
||||||
|
id="meshrow24989">
|
||||||
|
<meshpatch
|
||||||
|
id="meshpatch24987">
|
||||||
|
<stop
|
||||||
|
path="c 19.7036,0 39.4071,0 59.1107,0"
|
||||||
|
style="stop-color:#00519e;stop-opacity:1"
|
||||||
|
id="stop24979" />
|
||||||
|
<stop
|
||||||
|
path="c 0,5.46099 0,10.922 0,16.383"
|
||||||
|
style="stop-color:#00beff;stop-opacity:1"
|
||||||
|
id="stop24981" />
|
||||||
|
<stop
|
||||||
|
path="c -19.7036,0 -39.4071,0 -59.1107,0"
|
||||||
|
style="stop-color:#00beff;stop-opacity:1"
|
||||||
|
id="stop24983" />
|
||||||
|
<stop
|
||||||
|
path="c 0,-5.46099 0,-10.922 0,-16.383"
|
||||||
|
style="stop-color:#00519e;stop-opacity:1"
|
||||||
|
id="stop24985" />
|
||||||
|
</meshpatch>
|
||||||
|
</meshrow>
|
||||||
|
</meshgradient>
|
||||||
|
</defs>
|
||||||
|
<sodipodi:namedview
|
||||||
|
id="base"
|
||||||
|
pagecolor="#ffffff"
|
||||||
|
bordercolor="#666666"
|
||||||
|
borderopacity="1.0"
|
||||||
|
inkscape:pageopacity="0.0"
|
||||||
|
inkscape:pageshadow="2"
|
||||||
|
inkscape:zoom="2"
|
||||||
|
inkscape:cx="110.06798"
|
||||||
|
inkscape:cy="138.03068"
|
||||||
|
inkscape:document-units="mm"
|
||||||
|
inkscape:current-layer="layer16"
|
||||||
|
showgrid="false"
|
||||||
|
inkscape:window-width="1536"
|
||||||
|
inkscape:window-height="801"
|
||||||
|
inkscape:window-x="-8"
|
||||||
|
inkscape:window-y="-8"
|
||||||
|
inkscape:window-maximized="1"
|
||||||
|
showguides="true"
|
||||||
|
inkscape:guide-bbox="true"
|
||||||
|
inkscape:pagecheckerboard="true" />
|
||||||
|
<metadata
|
||||||
|
id="metadata22811">
|
||||||
|
<rdf:RDF>
|
||||||
|
<cc:Work
|
||||||
|
rdf:about="">
|
||||||
|
<dc:format>image/svg+xml</dc:format>
|
||||||
|
<dc:type
|
||||||
|
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||||
|
<dc:title></dc:title>
|
||||||
|
</cc:Work>
|
||||||
|
</rdf:RDF>
|
||||||
|
</metadata>
|
||||||
|
<g
|
||||||
|
inkscape:groupmode="layer"
|
||||||
|
id="layer13"
|
||||||
|
inkscape:label="Corporate_Uni_Stuttgart"
|
||||||
|
transform="translate(0,16.383002)"
|
||||||
|
style="display:none;filter:url(#filter23683)">
|
||||||
|
<rect
|
||||||
|
style="opacity:1;fill:#3e444c;fill-opacity:1;stroke:none;stroke-width:0;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:0;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:fill markers stroke"
|
||||||
|
id="rect23621"
|
||||||
|
width="8.499999"
|
||||||
|
height="8.499999"
|
||||||
|
x="-8.499999"
|
||||||
|
y="42.5" />
|
||||||
|
<rect
|
||||||
|
y="34"
|
||||||
|
x="-8.499999"
|
||||||
|
height="8.499999"
|
||||||
|
width="8.499999"
|
||||||
|
id="rect23623"
|
||||||
|
style="opacity:1;fill:#00519e;fill-opacity:1;stroke:none;stroke-width:0;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:0;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:fill markers stroke" />
|
||||||
|
<rect
|
||||||
|
style="opacity:1;fill:#00beff;fill-opacity:1;stroke:none;stroke-width:0;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:0;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:fill markers stroke"
|
||||||
|
id="rect23625"
|
||||||
|
width="8.499999"
|
||||||
|
height="8.499999"
|
||||||
|
x="-8.499999"
|
||||||
|
y="25.5" />
|
||||||
|
<rect
|
||||||
|
style="opacity:1;fill:#009e51;fill-opacity:1;stroke:none;stroke-width:0;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:0;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:fill markers stroke"
|
||||||
|
id="rect23629"
|
||||||
|
width="8.499999"
|
||||||
|
height="8.499999"
|
||||||
|
x="-50.999996"
|
||||||
|
y="34" />
|
||||||
|
<rect
|
||||||
|
y="25.5"
|
||||||
|
x="-50.999996"
|
||||||
|
height="8.499999"
|
||||||
|
width="8.499999"
|
||||||
|
id="rect23631"
|
||||||
|
style="opacity:1;fill:#00ffbe;fill-opacity:1;stroke:none;stroke-width:0;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:0;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:fill markers stroke" />
|
||||||
|
<rect
|
||||||
|
y="34"
|
||||||
|
x="-16.999998"
|
||||||
|
height="8.499999"
|
||||||
|
width="8.499999"
|
||||||
|
id="rect23635"
|
||||||
|
style="opacity:1;fill:#51009e;fill-opacity:1;stroke:none;stroke-width:0;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:0;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:fill markers stroke" />
|
||||||
|
<rect
|
||||||
|
style="opacity:1;fill:#be00ff;fill-opacity:1;stroke:none;stroke-width:0;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:0;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:fill markers stroke"
|
||||||
|
id="rect23637"
|
||||||
|
width="8.499999"
|
||||||
|
height="8.499999"
|
||||||
|
x="-16.999998"
|
||||||
|
y="25.5" />
|
||||||
|
<rect
|
||||||
|
y="42.5"
|
||||||
|
x="-50.999996"
|
||||||
|
height="8.499999"
|
||||||
|
width="8.499999"
|
||||||
|
id="rect23639"
|
||||||
|
style="opacity:1;fill:#3e4c44;fill-opacity:1;stroke:none;stroke-width:0;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:0;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:fill markers stroke" />
|
||||||
|
<rect
|
||||||
|
style="opacity:1;fill:#443e4c;fill-opacity:1;stroke:none;stroke-width:0;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:0;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:fill markers stroke"
|
||||||
|
id="rect23641"
|
||||||
|
width="8.499999"
|
||||||
|
height="8.499999"
|
||||||
|
x="-16.999998"
|
||||||
|
y="42.5" />
|
||||||
|
<rect
|
||||||
|
y="42.5"
|
||||||
|
x="-33.999996"
|
||||||
|
height="8.499999"
|
||||||
|
width="8.499999"
|
||||||
|
id="rect23655"
|
||||||
|
style="opacity:1;fill:#4c443e;fill-opacity:1;stroke:none;stroke-width:0;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:0;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:fill markers stroke" />
|
||||||
|
<rect
|
||||||
|
style="opacity:1;fill:#9e5100;fill-opacity:1;stroke:none;stroke-width:0;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:0;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:fill markers stroke"
|
||||||
|
id="rect23657"
|
||||||
|
width="8.499999"
|
||||||
|
height="8.499999"
|
||||||
|
x="-33.999996"
|
||||||
|
y="34" />
|
||||||
|
<rect
|
||||||
|
y="25.5"
|
||||||
|
x="-33.999996"
|
||||||
|
height="8.499999"
|
||||||
|
width="8.499999"
|
||||||
|
id="rect23659"
|
||||||
|
style="opacity:1;fill:#ffbe00;fill-opacity:1;stroke:none;stroke-width:0;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:0;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:fill markers stroke" />
|
||||||
|
<rect
|
||||||
|
style="opacity:1;fill:#4c3e44;fill-opacity:1;stroke:none;stroke-width:0;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:0;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:fill markers stroke"
|
||||||
|
id="rect23661"
|
||||||
|
width="8.499999"
|
||||||
|
height="8.499999"
|
||||||
|
x="-25.499998"
|
||||||
|
y="42.5" />
|
||||||
|
<rect
|
||||||
|
y="34"
|
||||||
|
x="-25.499998"
|
||||||
|
height="8.499999"
|
||||||
|
width="8.499999"
|
||||||
|
id="rect23663"
|
||||||
|
style="opacity:1;fill:#9e0051;fill-opacity:1;stroke:none;stroke-width:0;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:0;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:fill markers stroke" />
|
||||||
|
<rect
|
||||||
|
style="opacity:1;fill:#ff00be;fill-opacity:1;stroke:none;stroke-width:0;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:0;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:fill markers stroke"
|
||||||
|
id="rect23665"
|
||||||
|
width="8.499999"
|
||||||
|
height="8.499999"
|
||||||
|
x="-25.499998"
|
||||||
|
y="25.5" />
|
||||||
|
<rect
|
||||||
|
y="42.5"
|
||||||
|
x="-42.499996"
|
||||||
|
height="8.499999"
|
||||||
|
width="8.499999"
|
||||||
|
id="rect23667"
|
||||||
|
style="opacity:1;fill:#444c3e;fill-opacity:1;stroke:none;stroke-width:0;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:0;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:fill markers stroke" />
|
||||||
|
<rect
|
||||||
|
style="opacity:1;fill:#519e00;fill-opacity:1;stroke:none;stroke-width:0;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:0;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:fill markers stroke"
|
||||||
|
id="rect23669"
|
||||||
|
width="8.499999"
|
||||||
|
height="8.499999"
|
||||||
|
x="-42.499996"
|
||||||
|
y="34" />
|
||||||
|
<rect
|
||||||
|
y="25.5"
|
||||||
|
x="-42.499996"
|
||||||
|
height="8.499999"
|
||||||
|
width="8.499999"
|
||||||
|
id="rect23671"
|
||||||
|
style="opacity:1;fill:#beff00;fill-opacity:1;stroke:none;stroke-width:0;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:0;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:fill markers stroke" />
|
||||||
|
<rect
|
||||||
|
style="opacity:1;fill:#006cb6;fill-opacity:1;stroke:none;stroke-width:0;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:0;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:fill markers stroke"
|
||||||
|
id="rect23673"
|
||||||
|
width="8.499999"
|
||||||
|
height="8.499999"
|
||||||
|
x="-8.499999"
|
||||||
|
y="17" />
|
||||||
|
<rect
|
||||||
|
y="8.500001"
|
||||||
|
x="-8.499999"
|
||||||
|
height="8.499999"
|
||||||
|
width="8.499999"
|
||||||
|
id="rect23713"
|
||||||
|
style="opacity:1;fill:#0087ce;fill-opacity:1;stroke:none;stroke-width:0;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:0;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:fill markers stroke" />
|
||||||
|
<rect
|
||||||
|
style="opacity:1;fill:#00a3e7;fill-opacity:1;stroke:none;stroke-width:0;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:0;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:fill markers stroke"
|
||||||
|
id="rect23715"
|
||||||
|
width="8.499999"
|
||||||
|
height="8.499999"
|
||||||
|
x="-8.499999"
|
||||||
|
y="1.9073486e-006" />
|
||||||
|
</g>
|
||||||
|
<g
|
||||||
|
inkscape:groupmode="layer"
|
||||||
|
id="layer10"
|
||||||
|
inkscape:label="Logo_mono_black"
|
||||||
|
transform="translate(0,-229.617)"
|
||||||
|
style="display:inline">
|
||||||
|
<g
|
||||||
|
style="display:inline"
|
||||||
|
id="g23526"
|
||||||
|
transform="translate(-42.742184,139.99998)">
|
||||||
|
<path
|
||||||
|
inkscape:export-ydpi="499.60001"
|
||||||
|
inkscape:export-xdpi="499.60001"
|
||||||
|
style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:0.98999999;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.98699999;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
|
||||||
|
d="m 48.300305,143.44076 c -0.811661,0 -1.109125,0.75874 -1.480469,1.48047 l -4.00014,7.77454 c -0.371344,0.72173 0.668807,1.48047 1.480468,1.48047 h 9.625183 c 0.811661,0 1.109108,-0.75875 1.480469,-1.48047 l 4.00036,-7.77454 c 0.371361,-0.72172 -0.668808,-1.48047 -1.480469,-1.48047 z m 0,0.98828 h 9.625402 c 0.281935,0 0.621179,0.2415 0.492187,0.49219 l -4.00036,7.77454 c -0.128993,0.25069 -0.210251,0.49218 -0.492187,0.49218 h -9.625181 c -0.281935,0 -0.621175,-0.24149 -0.492189,-0.49218 l 4.000141,-7.77454 c 0.128986,-0.25069 0.210253,-0.49219 0.492187,-0.49219 z"
|
||||||
|
id="path23506"
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
sodipodi:nodetypes="ssssssssssssssssss" />
|
||||||
|
<path
|
||||||
|
inkscape:export-ydpi="499.60001"
|
||||||
|
inkscape:export-xdpi="499.60001"
|
||||||
|
sodipodi:nodetypes="ssssssssssssssssss"
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
id="path23508"
|
||||||
|
d="m 90.668816,143.44076 c -0.811661,0 -1.109125,0.75874 -1.480469,1.48047 l -4.00014,7.77454 c -0.371344,0.72173 0.668808,1.48047 1.480469,1.48047 h 9.625909 c 0.81166,0 1.109109,-0.75875 1.48047,-1.48047 l 4.000355,-7.77454 c 0.37136,-0.72172 -0.66881,-1.48047 -1.48046,-1.48047 z m 0,0.98828 h 9.626134 c 0.28193,0 0.62117,0.24151 0.49218,0.49219 l -4.000365,7.77454 c -0.128993,0.25069 -0.21025,0.49218 -0.49218,0.49218 h -9.625909 c -0.281935,0 -0.621174,-0.24149 -0.492188,-0.49218 l 4.00014,-7.77454 c 0.128986,-0.25069 0.210254,-0.49219 0.492188,-0.49219 z"
|
||||||
|
style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:0.98999999;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.98699999;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" />
|
||||||
|
<text
|
||||||
|
inkscape:export-ydpi="499.60001"
|
||||||
|
inkscape:export-xdpi="499.60001"
|
||||||
|
xml:space="preserve"
|
||||||
|
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:10.58333302px;line-height:6.61458349px;font-family:'Univers for UniS 55 Roman';-inkscape-font-specification:'Univers for UniS 55 Roman, ';letter-spacing:0px;word-spacing:0px;opacity:0.98999999;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332"
|
||||||
|
x="69.980721"
|
||||||
|
y="150.38542"
|
||||||
|
id="text23365-1"><tspan
|
||||||
|
dy="-2"
|
||||||
|
dx="0"
|
||||||
|
sodipodi:role="line"
|
||||||
|
id="tspan23363-7"
|
||||||
|
x="69.980721"
|
||||||
|
y="150.38542"
|
||||||
|
style="text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;stroke-width:0.26458332">fs</tspan><tspan
|
||||||
|
dx="0 0 -0.27000001"
|
||||||
|
id="tspan23367-0"
|
||||||
|
sodipodi:role="line"
|
||||||
|
x="69.980721"
|
||||||
|
y="157"
|
||||||
|
style="text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;stroke-width:0.26458332"> fw</tspan></text>
|
||||||
|
<g
|
||||||
|
inkscape:export-ydpi="499.60001"
|
||||||
|
inkscape:export-xdpi="499.60001"
|
||||||
|
transform="translate(-1.937002)"
|
||||||
|
id="text23461"
|
||||||
|
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:9.36171436px;line-height:5.85107136px;font-family:'Univers for UniS 55 Roman';-inkscape-font-specification:'Univers for UniS 55 Roman, ';letter-spacing:0px;word-spacing:0px;opacity:0.98999999;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.23404284"
|
||||||
|
aria-label="{">
|
||||||
|
<path
|
||||||
|
sodipodi:nodetypes="ccssccsssccccssccccssscc"
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
id="path23467"
|
||||||
|
style="font-size:18.72342873px;fill:#000000;fill-opacity:1;stroke-width:0.23404284"
|
||||||
|
d="m 67.678074,141.482 c -0.798867,0.0624 -1.915603,0.38946 -2.290072,0.80139 -0.361986,0.41191 -0.543,1.06141 -0.543,1.94766 v 1.29191 c 0,1.04851 -0.199567,1.82824 -0.599,2.34001 -0.386951,0.51177 -1.010722,0.82383 -1.872,0.93617 0.848795,0.11234 1.472567,0.41816 1.872,0.91745 0.399433,0.49929 0.599,1.22951 0.599,2.19064 v 1.38554 c 0,0.88624 0.193496,1.5478 0.543,1.98468 0.349504,0.44936 1.453759,0.79514 2.290072,0.85755 v 0.86501 c -1.260711,-0.0749 -2.215606,-0.38696 -2.864685,-0.93618 -0.636597,-0.53673 -0.954895,-1.55404 -0.954895,-3.05192 v -1.23574 c 0,-0.84879 -0.205958,-1.44794 -0.617873,-1.79745 -0.399433,-0.36199 -1.017306,-0.59291 -1.853619,-0.69277 v -0.95489 c 0.761419,-0.0624 1.360569,-0.28084 1.797449,-0.65532 0.449362,-0.38695 0.674043,-0.91745 0.674043,-1.59149 v -1.66639 c 0,-1.26071 0.293334,-2.19064 0.880001,-2.78979 0.586667,-0.59915 1.566527,-0.93617 2.939579,-1.01107 z" />
|
||||||
|
</g>
|
||||||
|
<g
|
||||||
|
inkscape:export-ydpi="499.60001"
|
||||||
|
inkscape:export-xdpi="499.60001"
|
||||||
|
aria-label="{"
|
||||||
|
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:9.36171436px;line-height:5.85107136px;font-family:'Univers for UniS 55 Roman';-inkscape-font-specification:'Univers for UniS 55 Roman, ';letter-spacing:0px;word-spacing:0px;opacity:0.98999999;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.23404284"
|
||||||
|
id="g23472"
|
||||||
|
transform="rotate(180,73.264036,148.80851)">
|
||||||
|
<path
|
||||||
|
d="m 67.678074,141.482 c -0.798867,0.0624 -1.915603,0.38946 -2.290072,0.80139 -0.361986,0.41191 -0.543,1.06141 -0.543,1.94766 v 1.29191 c 0,1.04851 -0.199567,1.82824 -0.599,2.34001 -0.386951,0.51177 -1.010722,0.82383 -1.872,0.93617 0.848795,0.11234 1.472567,0.41816 1.872,0.91745 0.399433,0.49929 0.599,1.22951 0.599,2.19064 v 1.38554 c 0,0.88624 0.193496,1.5478 0.543,1.98468 0.349504,0.44936 1.453759,0.79514 2.290072,0.85755 v 0.86501 c -1.260711,-0.0749 -2.215606,-0.38696 -2.864685,-0.93618 -0.636597,-0.53673 -0.954895,-1.55404 -0.954895,-3.05192 v -1.23574 c 0,-0.84879 -0.205958,-1.44794 -0.617873,-1.79745 -0.399433,-0.36199 -1.017306,-0.59291 -1.853619,-0.69277 v -0.95489 c 0.761419,-0.0624 1.360569,-0.28084 1.797449,-0.65532 0.449362,-0.38695 0.674043,-0.91745 0.674043,-1.59149 v -1.66639 c 0,-1.26071 0.293334,-2.19064 0.880001,-2.78979 0.586667,-0.59915 1.566527,-0.93617 2.939579,-1.01107 z"
|
||||||
|
style="font-size:18.72342873px;fill:#000000;fill-opacity:1;stroke-width:0.23404284"
|
||||||
|
id="path23470"
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
sodipodi:nodetypes="ccssccsssccccssccccssscc" />
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
<g
|
||||||
|
inkscape:groupmode="layer"
|
||||||
|
id="layer12"
|
||||||
|
inkscape:label="Logo_mono_white"
|
||||||
|
style="display:inline"
|
||||||
|
transform="translate(0,16.383002)">
|
||||||
|
<g
|
||||||
|
id="g23618">
|
||||||
|
<path
|
||||||
|
inkscape:export-ydpi="499.60001"
|
||||||
|
inkscape:export-xdpi="499.60001"
|
||||||
|
style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:0.98999999;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.98699999;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
|
||||||
|
d="m 5.558122,20.44074 c -0.811661,0 -1.109125,0.75874 -1.480469,1.48047 l -4.00014,7.77454 c -0.371344,0.72173 0.668807,1.48047 1.480468,1.48047 h 9.625183 c 0.811661,0 1.109108,-0.75875 1.480469,-1.48047 l 4.00036,-7.77454 c 0.371361,-0.72172 -0.668808,-1.48047 -1.480469,-1.48047 z m 0,0.98828 h 9.625402 c 0.281935,0 0.621179,0.2415 0.492187,0.49219 l -4.00036,7.77454 c -0.128993,0.25069 -0.210251,0.49218 -0.492187,0.49218 H 1.557983 c -0.281935,0 -0.621175,-0.24149 -0.492189,-0.49218 l 4.000141,-7.77454 c 0.128986,-0.25069 0.210253,-0.49219 0.492187,-0.49219 z"
|
||||||
|
id="path23560"
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
sodipodi:nodetypes="ssssssssssssssssss" />
|
||||||
|
<path
|
||||||
|
inkscape:export-ydpi="499.60001"
|
||||||
|
inkscape:export-xdpi="499.60001"
|
||||||
|
sodipodi:nodetypes="ssssssssssssssssss"
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
id="path23562"
|
||||||
|
d="m 47.926633,20.44074 c -0.811661,0 -1.109125,0.75874 -1.480469,1.48047 l -4.00014,7.77454 c -0.371344,0.72173 0.668808,1.48047 1.480469,1.48047 h 9.625909 c 0.81166,0 1.109109,-0.75875 1.48047,-1.48047 l 4.000355,-7.77454 c 0.37136,-0.72172 -0.66881,-1.48047 -1.48046,-1.48047 z m 0,0.98828 h 9.626134 c 0.28193,0 0.62117,0.24151 0.49218,0.49219 l -4.000365,7.77454 c -0.128993,0.25069 -0.21025,0.49218 -0.49218,0.49218 h -9.625909 c -0.281935,0 -0.621174,-0.24149 -0.492188,-0.49218 l 4.00014,-7.77454 c 0.128986,-0.25069 0.210254,-0.49219 0.492188,-0.49219 z"
|
||||||
|
style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:0.98999999;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.98699999;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" />
|
||||||
|
<text
|
||||||
|
inkscape:export-ydpi="499.60001"
|
||||||
|
inkscape:export-xdpi="499.60001"
|
||||||
|
xml:space="preserve"
|
||||||
|
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:10.58333302px;line-height:6.61458349px;font-family:'Univers for UniS 55 Roman';-inkscape-font-specification:'Univers for UniS 55 Roman, ';letter-spacing:0px;word-spacing:0px;opacity:0.98999999;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332"
|
||||||
|
x="27.238537"
|
||||||
|
y="27.385403"
|
||||||
|
id="text23568"><tspan
|
||||||
|
dy="-2"
|
||||||
|
dx="0"
|
||||||
|
sodipodi:role="line"
|
||||||
|
id="tspan23564"
|
||||||
|
x="27.238537"
|
||||||
|
y="27.385403"
|
||||||
|
style="text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#ffffff;stroke-width:0.26458332">fs</tspan><tspan
|
||||||
|
dx="0 0 -0.27000001"
|
||||||
|
id="tspan23566"
|
||||||
|
sodipodi:role="line"
|
||||||
|
x="27.238537"
|
||||||
|
y="33.999985"
|
||||||
|
style="text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#ffffff;stroke-width:0.26458332"> fw</tspan></text>
|
||||||
|
<g
|
||||||
|
inkscape:export-ydpi="499.60001"
|
||||||
|
inkscape:export-xdpi="499.60001"
|
||||||
|
transform="translate(-44.679185,-123.00002)"
|
||||||
|
id="g23572"
|
||||||
|
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:9.36171436px;line-height:5.85107136px;font-family:'Univers for UniS 55 Roman';-inkscape-font-specification:'Univers for UniS 55 Roman, ';letter-spacing:0px;word-spacing:0px;opacity:0.98999999;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.23404284"
|
||||||
|
aria-label="{">
|
||||||
|
<path
|
||||||
|
sodipodi:nodetypes="ccssccsssccccssccccssscc"
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
id="path23570"
|
||||||
|
style="font-size:18.72342873px;fill:#ffffff;fill-opacity:1;stroke-width:0.23404284"
|
||||||
|
d="m 67.678074,141.482 c -0.798867,0.0624 -1.915603,0.38946 -2.290072,0.80139 -0.361986,0.41191 -0.543,1.06141 -0.543,1.94766 v 1.29191 c 0,1.04851 -0.199567,1.82824 -0.599,2.34001 -0.386951,0.51177 -1.010722,0.82383 -1.872,0.93617 0.848795,0.11234 1.472567,0.41816 1.872,0.91745 0.399433,0.49929 0.599,1.22951 0.599,2.19064 v 1.38554 c 0,0.88624 0.193496,1.5478 0.543,1.98468 0.349504,0.44936 1.453759,0.79514 2.290072,0.85755 v 0.86501 c -1.260711,-0.0749 -2.215606,-0.38696 -2.864685,-0.93618 -0.636597,-0.53673 -0.954895,-1.55404 -0.954895,-3.05192 v -1.23574 c 0,-0.84879 -0.205958,-1.44794 -0.617873,-1.79745 -0.399433,-0.36199 -1.017306,-0.59291 -1.853619,-0.69277 v -0.95489 c 0.761419,-0.0624 1.360569,-0.28084 1.797449,-0.65532 0.449362,-0.38695 0.674043,-0.91745 0.674043,-1.59149 v -1.66639 c 0,-1.26071 0.293334,-2.19064 0.880001,-2.78979 0.586667,-0.59915 1.566527,-0.93617 2.939579,-1.01107 z" />
|
||||||
|
</g>
|
||||||
|
<g
|
||||||
|
inkscape:export-ydpi="499.60001"
|
||||||
|
inkscape:export-xdpi="499.60001"
|
||||||
|
aria-label="{"
|
||||||
|
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:9.36171436px;line-height:5.85107136px;font-family:'Univers for UniS 55 Roman';-inkscape-font-specification:'Univers for UniS 55 Roman, ';letter-spacing:0px;word-spacing:0px;opacity:0.98999999;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.23404284"
|
||||||
|
id="g23576"
|
||||||
|
transform="rotate(180,51.892944,87.3085)">
|
||||||
|
<path
|
||||||
|
d="m 67.678074,141.482 c -0.798867,0.0624 -1.915603,0.38946 -2.290072,0.80139 -0.361986,0.41191 -0.543,1.06141 -0.543,1.94766 v 1.29191 c 0,1.04851 -0.199567,1.82824 -0.599,2.34001 -0.386951,0.51177 -1.010722,0.82383 -1.872,0.93617 0.848795,0.11234 1.472567,0.41816 1.872,0.91745 0.399433,0.49929 0.599,1.22951 0.599,2.19064 v 1.38554 c 0,0.88624 0.193496,1.5478 0.543,1.98468 0.349504,0.44936 1.453759,0.79514 2.290072,0.85755 v 0.86501 c -1.260711,-0.0749 -2.215606,-0.38696 -2.864685,-0.93618 -0.636597,-0.53673 -0.954895,-1.55404 -0.954895,-3.05192 v -1.23574 c 0,-0.84879 -0.205958,-1.44794 -0.617873,-1.79745 -0.399433,-0.36199 -1.017306,-0.59291 -1.853619,-0.69277 v -0.95489 c 0.761419,-0.0624 1.360569,-0.28084 1.797449,-0.65532 0.449362,-0.38695 0.674043,-0.91745 0.674043,-1.59149 v -1.66639 c 0,-1.26071 0.293334,-2.19064 0.880001,-2.78979 0.586667,-0.59915 1.566527,-0.93617 2.939579,-1.01107 z"
|
||||||
|
style="font-size:18.72342873px;fill:#ffffff;fill-opacity:1;stroke-width:0.23404284"
|
||||||
|
id="path23574"
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
sodipodi:nodetypes="ccssccsssccccssccccssscc" />
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
<g
|
||||||
|
inkscape:groupmode="layer"
|
||||||
|
id="layer14"
|
||||||
|
inkscape:label="Logo_colored"
|
||||||
|
style="display:inline"
|
||||||
|
transform="translate(0,17.000002)">
|
||||||
|
<g
|
||||||
|
id="g24826">
|
||||||
|
<path
|
||||||
|
sodipodi:nodetypes="ssssssssssssssssss"
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
id="path23538"
|
||||||
|
d="m 5.558122,19.823743 c -0.811661,0 -1.109125,0.75874 -1.480469,1.48047 l -4.00014,7.77454 c -0.371344,0.72173 0.668807,1.48047 1.480468,1.48047 h 9.625183 c 0.811661,0 1.109108,-0.75875 1.480469,-1.48047 l 4.00036,-7.77454 c 0.371361,-0.72172 -0.668808,-1.48047 -1.480469,-1.48047 z m 0,0.98828 h 9.625402 c 0.281935,0 0.621179,0.2415 0.492187,0.49219 l -4.00036,7.77454 c -0.128993,0.25069 -0.210251,0.49218 -0.492187,0.49218 H 1.557983 c -0.281935,0 -0.621175,-0.24149 -0.492189,-0.49218 l 4.000141,-7.77454 c 0.128986,-0.25069 0.210253,-0.49219 0.492187,-0.49219 z"
|
||||||
|
style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#00beff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.98699999;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
|
||||||
|
inkscape:export-xdpi="499.60001"
|
||||||
|
inkscape:export-ydpi="499.60001"
|
||||||
|
transform="translate(0,-17.000002)" />
|
||||||
|
<path
|
||||||
|
style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:0.98999999;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#00beff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.98699999;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
|
||||||
|
d="m 47.926633,19.823743 c -0.811661,0 -1.109125,0.75874 -1.480469,1.48047 l -4.00014,7.77454 c -0.371344,0.72173 0.668808,1.48047 1.480469,1.48047 h 9.625909 c 0.81166,0 1.109109,-0.75875 1.48047,-1.48047 l 4.000355,-7.77454 c 0.37136,-0.72172 -0.66881,-1.48047 -1.48046,-1.48047 z m 0,0.98828 h 9.626134 c 0.28193,0 0.62117,0.24151 0.49218,0.49219 l -4.000365,7.77454 c -0.128993,0.25069 -0.21025,0.49218 -0.49218,0.49218 h -9.625909 c -0.281935,0 -0.621174,-0.24149 -0.492188,-0.49218 l 4.00014,-7.77454 c 0.128986,-0.25069 0.210254,-0.49219 0.492188,-0.49219 z"
|
||||||
|
id="path23540"
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
sodipodi:nodetypes="ssssssssssssssssss"
|
||||||
|
inkscape:export-xdpi="499.60001"
|
||||||
|
inkscape:export-ydpi="499.60001"
|
||||||
|
transform="translate(0,-17.000002)" />
|
||||||
|
<g
|
||||||
|
aria-label="{"
|
||||||
|
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:9.36171436px;line-height:5.85107136px;font-family:'Univers for UniS 55 Roman';-inkscape-font-specification:'Univers for UniS 55 Roman, ';letter-spacing:0px;word-spacing:0px;display:inline;opacity:0.98999999;fill:#00519e;fill-opacity:1;stroke:none;stroke-width:0.23404284;enable-background:new"
|
||||||
|
id="g23550"
|
||||||
|
transform="translate(-44.679185,-140.61702)"
|
||||||
|
inkscape:export-xdpi="499.60001"
|
||||||
|
inkscape:export-ydpi="499.60001">
|
||||||
|
<path
|
||||||
|
d="m 67.678074,141.482 c -0.798867,0.0624 -1.915603,0.38946 -2.290072,0.80139 -0.361986,0.41191 -0.543,1.06141 -0.543,1.94766 v 1.29191 c 0,1.04851 -0.199567,1.82824 -0.599,2.34001 -0.386951,0.51177 -1.010722,0.82383 -1.872,0.93617 0.848795,0.11234 1.472567,0.41816 1.872,0.91745 0.399433,0.49929 0.599,1.22951 0.599,2.19064 v 1.38554 c 0,0.88624 0.193496,1.5478 0.543,1.98468 0.349504,0.44936 1.453759,0.79514 2.290072,0.85755 v 0.86501 c -1.260711,-0.0749 -2.215606,-0.38696 -2.864685,-0.93618 -0.636597,-0.53673 -0.954895,-1.55404 -0.954895,-3.05192 v -1.23574 c 0,-0.84879 -0.205958,-1.44794 -0.617873,-1.79745 -0.399433,-0.36199 -1.017306,-0.59291 -1.853619,-0.69277 v -0.95489 c 0.761419,-0.0624 1.360569,-0.28084 1.797449,-0.65532 0.449362,-0.38695 0.674043,-0.91745 0.674043,-1.59149 v -1.66639 c 0,-1.26071 0.293334,-2.19064 0.880001,-2.78979 0.586667,-0.59915 1.566527,-0.93617 2.939579,-1.01107 z"
|
||||||
|
style="font-size:18.72342873px;fill:#00519e;fill-opacity:1;stroke-width:0.23404284"
|
||||||
|
id="path23548"
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
sodipodi:nodetypes="ccssccsssccccssccccssscc" />
|
||||||
|
</g>
|
||||||
|
<g
|
||||||
|
transform="rotate(180,51.892943,78.500001)"
|
||||||
|
id="g23554"
|
||||||
|
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:9.36171436px;line-height:5.85107136px;font-family:'Univers for UniS 55 Roman';-inkscape-font-specification:'Univers for UniS 55 Roman, ';letter-spacing:0px;word-spacing:0px;display:inline;opacity:0.98999999;fill:#00519e;fill-opacity:1;stroke:none;stroke-width:0.23404284;enable-background:new"
|
||||||
|
aria-label="{"
|
||||||
|
inkscape:export-xdpi="499.60001"
|
||||||
|
inkscape:export-ydpi="499.60001">
|
||||||
|
<path
|
||||||
|
sodipodi:nodetypes="ccssccsssccccssccccssscc"
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
id="path23552"
|
||||||
|
style="font-size:18.72342873px;fill:#00519e;fill-opacity:1;stroke-width:0.23404284"
|
||||||
|
d="m 67.678074,141.482 c -0.798867,0.0624 -1.915603,0.38946 -2.290072,0.80139 -0.361986,0.41191 -0.543,1.06141 -0.543,1.94766 v 1.29191 c 0,1.04851 -0.199567,1.82824 -0.599,2.34001 -0.386951,0.51177 -1.010722,0.82383 -1.872,0.93617 0.848795,0.11234 1.472567,0.41816 1.872,0.91745 0.399433,0.49929 0.599,1.22951 0.599,2.19064 v 1.38554 c 0,0.88624 0.193496,1.5478 0.543,1.98468 0.349504,0.44936 1.453759,0.79514 2.290072,0.85755 v 0.86501 c -1.260711,-0.0749 -2.215606,-0.38696 -2.864685,-0.93618 -0.636597,-0.53673 -0.954895,-1.55404 -0.954895,-3.05192 v -1.23574 c 0,-0.84879 -0.205958,-1.44794 -0.617873,-1.79745 -0.399433,-0.36199 -1.017306,-0.59291 -1.853619,-0.69277 v -0.95489 c 0.761419,-0.0624 1.360569,-0.28084 1.797449,-0.65532 0.449362,-0.38695 0.674043,-0.91745 0.674043,-1.59149 v -1.66639 c 0,-1.26071 0.293334,-2.19064 0.880001,-2.78979 0.586667,-0.59915 1.566527,-0.93617 2.939579,-1.01107 z" />
|
||||||
|
</g>
|
||||||
|
<path
|
||||||
|
sodipodi:nodetypes="ccccc"
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
id="path23705"
|
||||||
|
d="m 24.042453,7.7684013 h 0.98425 V 6.1909995 h -0.98425 z"
|
||||||
|
style="display:inline;fill:#00519e;fill-opacity:1;stroke:none;stroke-width:0.15297562px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
|
||||||
|
<path
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
id="path23707"
|
||||||
|
d="m 26.264953,3.0725683 -2.2225,3e-7 v 0.7196666 l 2.2225,-3e-7 z"
|
||||||
|
style="display:inline;fill:#0087ce;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||||
|
transform="translate(0,-0.617)" />
|
||||||
|
<path
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
id="path23709"
|
||||||
|
d="m 22.994703,3.0725686 v 0.7196666 h 1.04775 V 3.0725686 Z"
|
||||||
|
style="display:inline;fill:none;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||||
|
transform="translate(0,-0.617)" />
|
||||||
|
<path
|
||||||
|
id="path23719"
|
||||||
|
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:10.58333302px;line-height:6.61458349px;font-family:'Univers for UniS 55 Roman';-inkscape-font-specification:'Univers for UniS 55 Roman, ';text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;display:inline;opacity:0.98999999;fill:#00beff;fill-opacity:1;stroke:none;stroke-width:0.26458332"
|
||||||
|
d="m 26.41312,1.4850686 c -0.1905,-0.014111 -0.373945,-0.021167 -0.550334,-0.021167 -0.282222,0 -0.493889,0.045861 -0.635,0.1375834 -0.772583,-0.62441639 0,0 -0.772583,-0.62441639 0.282222,-0.23988888 0.663222,-0.35983332 1.143,-0.35983332 0.141111,0 0.278695,0.007056 0.41275,0.0211667 0.141111,0.0141111 0.275167,0.03175 0.402167,0.0529167 z"
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
sodipodi:nodetypes="csccsccc"
|
||||||
|
transform="translate(0,-0.617)" />
|
||||||
|
<path
|
||||||
|
sodipodi:nodetypes="csccscc"
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
d="m 25.227786,1.601485 c -0.134055,0.091722 -0.201083,0.2751666 -0.201083,0.5503333 v 0.92075 l -0.98425,3e-7 v -0.85725 c 0,-0.5926667 0.137583,-1.0054167 0.41275,-1.23824999 0.772583,0.62441639 0,0 0.772583,0.62441639 z"
|
||||||
|
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:10.58333302px;line-height:6.61458349px;font-family:'Univers for UniS 55 Roman';-inkscape-font-specification:'Univers for UniS 55 Roman, ';text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;display:inline;opacity:0.98999999;fill:#00a3e7;fill-opacity:1;stroke:none;stroke-width:0.26458332"
|
||||||
|
id="path23717"
|
||||||
|
transform="translate(0,-0.617)" />
|
||||||
|
<path
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
id="path23727"
|
||||||
|
d="m 22.994703,2.4555686 v 0.7196666 h 1.04775 V 2.4555686 h -1.04775"
|
||||||
|
style="fill:#00beff;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
|
||||||
|
<path
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
id="path23729"
|
||||||
|
d="m 24.042453,6.1909994 h 0.98425 V 3.1752349 l -0.98425,3e-7 v 3.0157642"
|
||||||
|
style="fill:#006cb6;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
|
||||||
|
<path
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
id="path23731"
|
||||||
|
d="m 24.02759,11.070149 v 0.719667 h 2.032 v -0.719667 z"
|
||||||
|
style="fill:#00beff;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
|
||||||
|
<path
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
id="path23733"
|
||||||
|
d="m 27.29784,11.070149 v 0.719667 h -1.23825 v -0.719667"
|
||||||
|
style="fill:#00a3e7;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
|
||||||
|
<path
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
id="path23735"
|
||||||
|
d="m 25.07534,13.366982 h 0.98425 v 3.016 h -0.98425 z"
|
||||||
|
style="fill:#00beff;fill-opacity:1;stroke:none;stroke-width:0.21439861px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
|
||||||
|
<path
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
id="path23737"
|
||||||
|
d="m 25.07534,11.789816 h 0.98425 v 1.577166 h -0.98425 v -1.577166"
|
||||||
|
style="fill:#00a3e7;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
|
||||||
|
<path
|
||||||
|
sodipodi:nodetypes="cscsccscsccc"
|
||||||
|
d="m 27.446007,10.099652 c -0.1905,-0.01411 -0.373945,-0.02117 -0.550334,-0.02117 -0.282222,0 -0.493889,0.04586 -0.635,0.137584 -0.134055,0.09172 -0.201083,0.275166 -0.201083,0.550333 v 0.92075 h -0.98425 v -0.85725 c 0,-0.592667 0.137583,-1.0054166 0.41275,-1.2382499 0.282222,-0.2398889 0.663222,-0.3598333 1.143,-0.3598333 0.141111,0 0.278695,0.00706 0.41275,0.021167 0.141111,0.014111 0.275167,0.03175 0.402167,0.052917 z"
|
||||||
|
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:10.58333302px;line-height:6.61458349px;font-family:'Univers for UniS 55 Roman';-inkscape-font-specification:'Univers for UniS 55 Roman, ';text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;display:inline;opacity:0.98999999;fill:#006cb6;fill-opacity:1;stroke:none;stroke-width:0.26458332"
|
||||||
|
id="path23739"
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
transform="translate(0,-0.617)" />
|
||||||
|
<path
|
||||||
|
d="m 28.921204,8.5335684 c -0.677333,0 -1.199444,-0.1481667 -1.566333,-0.4445 -0.359833,-0.3033889 -0.53975,-0.7307356 -0.53975,-1.2810689 l 1.04775,4.856e-4 c 0,0.3033889 0.09878,0.53975 0.296333,0.7090833 0.204611,0.1693333 0.497417,0.254 0.878417,0.254 0,0 0,0 -0.116417,0.762 z"
|
||||||
|
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:10.58333302px;line-height:6.61458349px;font-family:'Univers for UniS 55 Roman';-inkscape-font-specification:'Univers for UniS 55 Roman, ';text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;display:inline;opacity:0.98999999;fill:#00beff;fill-opacity:1;stroke:none;stroke-width:0.26458332"
|
||||||
|
id="path23748"
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
sodipodi:nodetypes="ccccccc"
|
||||||
|
transform="translate(0,-0.617)" />
|
||||||
|
<path
|
||||||
|
d="m 29.799621,5.3903185 c 0.465667,0.1128889 0.811389,0.28575 1.037166,0.5185833 0.232833,0.2257778 0.34925,0.5326945 0.34925,0.92075 0,0.5221111 -0.197555,0.9383888 -0.592666,1.2488333 -0.395111,0.3033889 -0.9525,0.4550833 -1.672167,0.4550833 0.116417,-0.762 0,0 0.116417,-0.762 0.359833,0 0.631472,-0.077611 0.814917,-0.2328333 0.183444,-0.1552222 0.275166,-0.3563055 0.275166,-0.60325 0,-0.3175 -0.165805,-0.5221111 -0.497416,-0.6138333 0.169333,-0.9313333 0,0 0.169333,-0.9313333 z"
|
||||||
|
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:10.58333302px;line-height:6.61458349px;font-family:'Univers for UniS 55 Roman';-inkscape-font-specification:'Univers for UniS 55 Roman, ';text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;display:inline;opacity:0.98999999;fill:#0087ce;fill-opacity:1;stroke:none;stroke-width:0.26458332"
|
||||||
|
id="path23752"
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
sodipodi:nodetypes="ccsccccscc"
|
||||||
|
transform="translate(0,-0.617)" />
|
||||||
|
<path
|
||||||
|
d="m 27.926371,4.4378185 c 0,0.3245555 0.215194,0.53975 0.645583,0.6455833 l 1.227667,0.3069167 c -0.169333,0.9313333 0,0 -0.169333,0.9313333 C 29.298677,6.222874 28.910621,6.1240962 28.466121,6.0253185 28.014566,5.9265407 27.644149,5.7677907 27.354871,5.5490685 27.065593,5.3303463 26.920954,4.9987352 26.920954,4.5542352 c 1.005417,-0.1164167 0,0 1.005417,-0.1164167 z"
|
||||||
|
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:10.58333302px;line-height:6.61458349px;font-family:'Univers for UniS 55 Roman';-inkscape-font-specification:'Univers for UniS 55 Roman, ';text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;display:inline;opacity:0.98999999;fill:#00a3e7;fill-opacity:1;stroke:none;stroke-width:0.26458332"
|
||||||
|
id="path23755"
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
sodipodi:nodetypes="cccccscc"
|
||||||
|
transform="translate(0,-0.617)" />
|
||||||
|
<path
|
||||||
|
d="m 31.048454,4.5436518 h -1.016 v -0.0635 c 0,-0.5362222 -0.342194,-0.8043333 -1.026583,-0.8043333 -0.338667,0 -0.60325,0.067028 -0.79375,0.2010834 -0.1905,0.127 -0.28575,0.3139722 -0.28575,0.5609166 -1.005417,0.1164167 0,0 -1.005417,0.1164167 0,-0.4797778 0.1905,-0.8678334 0.5715,-1.1641667 0.388056,-0.2963333 0.889001,-0.4444999 1.502834,-0.4444999 0.578555,0 1.065388,0.1199444 1.460499,0.3598333 0.395111,0.2328333 0.592667,0.5961944 0.592667,1.0900833 z"
|
||||||
|
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:10.58333302px;line-height:6.61458349px;font-family:'Univers for UniS 55 Roman';-inkscape-font-specification:'Univers for UniS 55 Roman, ';text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;display:inline;opacity:0.98999999;fill:#006cb6;fill-opacity:1;stroke:none;stroke-width:0.26458332"
|
||||||
|
id="path23758"
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
sodipodi:nodetypes="ccssccccscsc"
|
||||||
|
transform="translate(0,-0.617)" />
|
||||||
|
<path
|
||||||
|
sodipodi:nodetypes="cccccc"
|
||||||
|
transform="translate(0,-0.617)"
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
id="path23764"
|
||||||
|
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:10.58333302px;line-height:6.61458349px;font-family:'Univers for UniS 55 Roman';-inkscape-font-specification:'Univers for UniS 55 Roman, ';text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;display:inline;opacity:0.98999999;fill:#00beff;fill-opacity:1;stroke:none;stroke-width:0.26458332"
|
||||||
|
d="m 33.742924,15.878152 1.3335,-4.191 h 1.026583 l -1.87325,5.312833 h -1.142999 c 0.656166,-1.121833 0,0 0.656166,-1.121833 z" />
|
||||||
|
<path
|
||||||
|
sodipodi:nodetypes="ccccc"
|
||||||
|
d="m 32.536424,11.070152 1.2065,4.191 c -0.656166,1.121833 0,0 -0.656166,1.121833 l -1.248834,-4.370916 c 0.6985,-0.941917 0,0 0.6985,-0.941917 z"
|
||||||
|
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:10.58333302px;line-height:6.61458349px;font-family:'Univers for UniS 55 Roman';-inkscape-font-specification:'Univers for UniS 55 Roman, ';text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;display:inline;opacity:0.98999999;fill:#00a3e7;fill-opacity:1;stroke:none;stroke-width:0.26458332"
|
||||||
|
id="path23766"
|
||||||
|
inkscape:connector-curvature="0" />
|
||||||
|
<path
|
||||||
|
sodipodi:nodetypes="ccccccc"
|
||||||
|
transform="translate(0,-0.617)"
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
id="path23768"
|
||||||
|
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:10.58333302px;line-height:6.61458349px;font-family:'Univers for UniS 55 Roman';-inkscape-font-specification:'Univers for UniS 55 Roman, ';text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;display:inline;opacity:0.98999999;fill:#0087ce;fill-opacity:1;stroke:none;stroke-width:0.26458332"
|
||||||
|
d="m 29.890591,15.920485 1.344083,-4.233333 h 1.30175 c -0.6985,0.941917 0,0 -0.6985,0.941917 l -1.386416,4.370916 h -1.17475 c 0.613833,-1.0795 0,0 0.613833,-1.0795 z" />
|
||||||
|
<path
|
||||||
|
sodipodi:nodetypes="ccccc"
|
||||||
|
d="m 28.610008,11.687152 1.280583,4.233333 c -0.613833,1.0795 0,0 -0.613833,1.0795 l -1.756834,-5.312833 z"
|
||||||
|
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:10.58333302px;line-height:6.61458349px;font-family:'Univers for UniS 55 Roman';-inkscape-font-specification:'Univers for UniS 55 Roman, ';text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;display:inline;opacity:0.98999999;fill:#00519e;fill-opacity:1;stroke:none;stroke-width:0.26458332"
|
||||||
|
id="path23770"
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
transform="translate(0,-0.617)" />
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
<g
|
||||||
|
inkscape:groupmode="layer"
|
||||||
|
id="layer16"
|
||||||
|
inkscape:label="Logo_gradient"
|
||||||
|
style="display:inline">
|
||||||
|
<rect
|
||||||
|
style="display:inline;opacity:1;fill:url(#meshgradient23819);fill-opacity:1;stroke:none;stroke-width:0;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:0;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:fill markers stroke;enable-background:new"
|
||||||
|
id="rect23817"
|
||||||
|
width="59.111"
|
||||||
|
height="16.382999"
|
||||||
|
x="-1.110223e-016"
|
||||||
|
y="3.8147118e-006"
|
||||||
|
clip-path="url(#clipPath24955)" />
|
||||||
|
</g>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 58 KiB |
BIN
logo/FSFW_Logo_V3_bw.png
Normal file
BIN
logo/FSFW_Logo_V3_bw.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 13 KiB |
@ -1,6 +1,11 @@
|
|||||||
|
|
||||||
|
#include "MessageQueue.h"
|
||||||
|
|
||||||
|
#include "../../ipc/MessageQueueSenderIF.h"
|
||||||
|
#include "../../ipc/MessageQueueMessageIF.h"
|
||||||
#include "../../ipc/QueueFactory.h"
|
#include "../../ipc/QueueFactory.h"
|
||||||
#include "../../osal/host/MessageQueue.h"
|
|
||||||
#include "../../serviceinterface/ServiceInterfaceStream.h"
|
#include "../../serviceinterface/ServiceInterfaceStream.h"
|
||||||
|
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
|
||||||
QueueFactory* QueueFactory::factoryInstance = nullptr;
|
QueueFactory* QueueFactory::factoryInstance = nullptr;
|
||||||
|
@ -33,7 +33,7 @@ ReturnValue_t TcUnixUdpPollingTask::performOperation(uint8_t opCode) {
|
|||||||
while(1) {
|
while(1) {
|
||||||
//! Sender Address is cached here.
|
//! Sender Address is cached here.
|
||||||
struct sockaddr_in senderAddress;
|
struct sockaddr_in senderAddress;
|
||||||
socklen_t senderSockLen = 0;
|
socklen_t senderSockLen = sizeof(senderAddress);
|
||||||
ssize_t bytesReceived = recvfrom(serverUdpSocket,
|
ssize_t bytesReceived = recvfrom(serverUdpSocket,
|
||||||
receptionBuffer.data(), frameSize, receptionFlags,
|
receptionBuffer.data(), frameSize, receptionFlags,
|
||||||
reinterpret_cast<sockaddr*>(&senderAddress), &senderSockLen);
|
reinterpret_cast<sockaddr*>(&senderAddress), &senderSockLen);
|
||||||
|
@ -65,9 +65,13 @@ TmTcUnixUdpBridge::~TmTcUnixUdpBridge() {
|
|||||||
ReturnValue_t TmTcUnixUdpBridge::sendTm(const uint8_t *data, size_t dataLen) {
|
ReturnValue_t TmTcUnixUdpBridge::sendTm(const uint8_t *data, size_t dataLen) {
|
||||||
int flags = 0;
|
int flags = 0;
|
||||||
|
|
||||||
clientAddress.sin_addr.s_addr = htons(INADDR_ANY);
|
MutexHelper lock(mutex, MutexIF::TimeoutType::WAITING, 10);
|
||||||
//clientAddress.sin_addr.s_addr = inet_addr("127.73.73.1");
|
|
||||||
clientAddressLen = sizeof(serverAddress);
|
if(ipAddrAnySet){
|
||||||
|
clientAddress.sin_addr.s_addr = htons(INADDR_ANY);
|
||||||
|
//clientAddress.sin_addr.s_addr = inet_addr("127.73.73.1");
|
||||||
|
clientAddressLen = sizeof(serverAddress);
|
||||||
|
}
|
||||||
|
|
||||||
// char ipAddress [15];
|
// char ipAddress [15];
|
||||||
// sif::debug << "IP Address Sender: "<< inet_ntop(AF_INET,
|
// sif::debug << "IP Address Sender: "<< inet_ntop(AF_INET,
|
||||||
@ -85,7 +89,7 @@ ReturnValue_t TmTcUnixUdpBridge::sendTm(const uint8_t *data, size_t dataLen) {
|
|||||||
return HasReturnvaluesIF::RETURN_OK;
|
return HasReturnvaluesIF::RETURN_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TmTcUnixUdpBridge::checkAndSetClientAddress(sockaddr_in newAddress) {
|
void TmTcUnixUdpBridge::checkAndSetClientAddress(sockaddr_in& newAddress) {
|
||||||
MutexHelper lock(mutex, MutexIF::TimeoutType::WAITING, 10);
|
MutexHelper lock(mutex, MutexIF::TimeoutType::WAITING, 10);
|
||||||
|
|
||||||
// char ipAddress [15];
|
// char ipAddress [15];
|
||||||
@ -168,3 +172,7 @@ void TmTcUnixUdpBridge::handleSendError() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TmTcUnixUdpBridge::setClientAddressToAny(bool ipAddrAnySet){
|
||||||
|
this->ipAddrAnySet = ipAddrAnySet;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -20,8 +20,9 @@ public:
|
|||||||
uint16_t serverPort = 0xFFFF,uint16_t clientPort = 0xFFFF);
|
uint16_t serverPort = 0xFFFF,uint16_t clientPort = 0xFFFF);
|
||||||
virtual~ TmTcUnixUdpBridge();
|
virtual~ TmTcUnixUdpBridge();
|
||||||
|
|
||||||
void checkAndSetClientAddress(sockaddr_in clientAddress);
|
void checkAndSetClientAddress(sockaddr_in& clientAddress);
|
||||||
|
|
||||||
|
void setClientAddressToAny(bool ipAddrAnySet);
|
||||||
protected:
|
protected:
|
||||||
virtual ReturnValue_t sendTm(const uint8_t * data, size_t dataLen) override;
|
virtual ReturnValue_t sendTm(const uint8_t * data, size_t dataLen) override;
|
||||||
|
|
||||||
@ -36,6 +37,8 @@ private:
|
|||||||
struct sockaddr_in serverAddress;
|
struct sockaddr_in serverAddress;
|
||||||
socklen_t serverAddressLen = 0;
|
socklen_t serverAddressLen = 0;
|
||||||
|
|
||||||
|
bool ipAddrAnySet = false;
|
||||||
|
|
||||||
//! Access to the client address is mutex protected as it is set
|
//! Access to the client address is mutex protected as it is set
|
||||||
//! by another task.
|
//! by another task.
|
||||||
MutexIF* mutex;
|
MutexIF* mutex;
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
#include <rtems/score/todimpl.h>
|
#include <rtems/score/todimpl.h>
|
||||||
|
|
||||||
uint16_t Clock::leapSeconds = 0;
|
uint16_t Clock::leapSeconds = 0;
|
||||||
MutexIF* Clock::timeMutex = NULL;
|
MutexIF* Clock::timeMutex = nullptr;
|
||||||
|
|
||||||
uint32_t Clock::getTicksPerSecond(void){
|
uint32_t Clock::getTicksPerSecond(void){
|
||||||
rtems_interval ticks_per_second = rtems_clock_get_ticks_per_second();
|
rtems_interval ticks_per_second = rtems_clock_get_ticks_per_second();
|
||||||
@ -40,7 +40,7 @@ ReturnValue_t Clock::setClock(const timeval* time) {
|
|||||||
//SHOULDDO: Not sure if we need to protect this call somehow (by thread lock or something).
|
//SHOULDDO: Not sure if we need to protect this call somehow (by thread lock or something).
|
||||||
//Uli: rtems docu says you can call this from an ISR, not sure if this means no protetion needed
|
//Uli: rtems docu says you can call this from an ISR, not sure if this means no protetion needed
|
||||||
//TODO Second parameter is ISR_lock_Context
|
//TODO Second parameter is ISR_lock_Context
|
||||||
_TOD_Set(&newTime,NULL);
|
_TOD_Set(&newTime,nullptr);
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
return HasReturnvaluesIF::RETURN_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -131,7 +131,7 @@ ReturnValue_t Clock::convertTimevalToJD2000(timeval time, double* JD2000) {
|
|||||||
|
|
||||||
ReturnValue_t Clock::convertUTCToTT(timeval utc, timeval* tt) {
|
ReturnValue_t Clock::convertUTCToTT(timeval utc, timeval* tt) {
|
||||||
//SHOULDDO: works not for dates in the past (might have less leap seconds)
|
//SHOULDDO: works not for dates in the past (might have less leap seconds)
|
||||||
if (timeMutex == NULL) {
|
if (timeMutex == nullptr) {
|
||||||
return HasReturnvaluesIF::RETURN_FAILED;
|
return HasReturnvaluesIF::RETURN_FAILED;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -157,40 +157,34 @@ ReturnValue_t Clock::setLeapSeconds(const uint16_t leapSeconds_) {
|
|||||||
if(checkOrCreateClockMutex()!=HasReturnvaluesIF::RETURN_OK){
|
if(checkOrCreateClockMutex()!=HasReturnvaluesIF::RETURN_OK){
|
||||||
return HasReturnvaluesIF::RETURN_FAILED;
|
return HasReturnvaluesIF::RETURN_FAILED;
|
||||||
}
|
}
|
||||||
ReturnValue_t result = timeMutex->lockMutex(MutexIF::NO_TIMEOUT);
|
MutexHelper helper(timeMutex);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
leapSeconds = leapSeconds_;
|
leapSeconds = leapSeconds_;
|
||||||
|
|
||||||
result = timeMutex->unlockMutex();
|
|
||||||
return result;
|
return HasReturnvaluesIF::RETURN_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
ReturnValue_t Clock::getLeapSeconds(uint16_t* leapSeconds_) {
|
ReturnValue_t Clock::getLeapSeconds(uint16_t* leapSeconds_) {
|
||||||
if(timeMutex==NULL){
|
if(timeMutex==nullptr){
|
||||||
return HasReturnvaluesIF::RETURN_FAILED;
|
return HasReturnvaluesIF::RETURN_FAILED;
|
||||||
}
|
}
|
||||||
ReturnValue_t result = timeMutex->lockMutex(MutexIF::NO_TIMEOUT);
|
MutexHelper helper(timeMutex);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
*leapSeconds_ = leapSeconds;
|
*leapSeconds_ = leapSeconds;
|
||||||
|
|
||||||
result = timeMutex->unlockMutex();
|
return HasReturnvaluesIF::RETURN_OK;
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ReturnValue_t Clock::checkOrCreateClockMutex(){
|
ReturnValue_t Clock::checkOrCreateClockMutex(){
|
||||||
if(timeMutex==NULL){
|
if(timeMutex==nullptr){
|
||||||
MutexFactory* mutexFactory = MutexFactory::instance();
|
MutexFactory* mutexFactory = MutexFactory::instance();
|
||||||
if (mutexFactory == NULL) {
|
if (mutexFactory == nullptr) {
|
||||||
return HasReturnvaluesIF::RETURN_FAILED;
|
return HasReturnvaluesIF::RETURN_FAILED;
|
||||||
}
|
}
|
||||||
timeMutex = mutexFactory->createMutex();
|
timeMutex = mutexFactory->createMutex();
|
||||||
if (timeMutex == NULL) {
|
if (timeMutex == nullptr) {
|
||||||
return HasReturnvaluesIF::RETURN_FAILED;
|
return HasReturnvaluesIF::RETURN_FAILED;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -158,7 +158,7 @@ uint32_t CpuUsage::ThreadData::getSerializedSize() const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ReturnValue_t CpuUsage::ThreadData::deSerialize(const uint8_t** buffer,
|
ReturnValue_t CpuUsage::ThreadData::deSerialize(const uint8_t** buffer,
|
||||||
int32_t* size, Endianness streamEndianness) {
|
size_t* size, Endianness streamEndianness) {
|
||||||
ReturnValue_t result = SerializeAdapter::deSerialize(&id, buffer,
|
ReturnValue_t result = SerializeAdapter::deSerialize(&id, buffer,
|
||||||
size, streamEndianness);
|
size, streamEndianness);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
|
@ -12,8 +12,8 @@ ReturnValue_t InternalErrorCodes::translate(uint8_t code) {
|
|||||||
// return INVALID_WORKSPACE_ADDRESS;
|
// return INVALID_WORKSPACE_ADDRESS;
|
||||||
case INTERNAL_ERROR_TOO_LITTLE_WORKSPACE:
|
case INTERNAL_ERROR_TOO_LITTLE_WORKSPACE:
|
||||||
return TOO_LITTLE_WORKSPACE;
|
return TOO_LITTLE_WORKSPACE;
|
||||||
case INTERNAL_ERROR_WORKSPACE_ALLOCATION:
|
// case INTERNAL_ERROR_WORKSPACE_ALLOCATION:
|
||||||
return WORKSPACE_ALLOCATION;
|
// return WORKSPACE_ALLOCATION;
|
||||||
// case INTERNAL_ERROR_INTERRUPT_STACK_TOO_SMALL:
|
// case INTERNAL_ERROR_INTERRUPT_STACK_TOO_SMALL:
|
||||||
// return INTERRUPT_STACK_TOO_SMALL;
|
// return INTERRUPT_STACK_TOO_SMALL;
|
||||||
case INTERNAL_ERROR_THREAD_EXITTED:
|
case INTERNAL_ERROR_THREAD_EXITTED:
|
||||||
|
@ -1,86 +0,0 @@
|
|||||||
#include "Interrupt.h"
|
|
||||||
extern "C" {
|
|
||||||
#include <bsp_flp/hw_timer/hw_timer.h>
|
|
||||||
#include <bsp_flp/hw_uart/hw_uart.h>
|
|
||||||
}
|
|
||||||
#include "RtemsBasic.h"
|
|
||||||
|
|
||||||
|
|
||||||
ReturnValue_t Interrupt::enableInterrupt(InterruptNumber_t interruptNumber) {
|
|
||||||
volatile uint32_t* irqMask = hw_irq_mask;
|
|
||||||
uint32_t expectedValue = *irqMask | (1 << interruptNumber);
|
|
||||||
*irqMask = expectedValue;
|
|
||||||
uint32_t tempValue = *irqMask;
|
|
||||||
if (tempValue == expectedValue) {
|
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
|
||||||
} else {
|
|
||||||
return HasReturnvaluesIF::RETURN_FAILED;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ReturnValue_t Interrupt::setInterruptServiceRoutine(IsrHandler_t handler,
|
|
||||||
InterruptNumber_t interrupt, IsrHandler_t* oldHandler) {
|
|
||||||
IsrHandler_t oldHandler_local;
|
|
||||||
if (oldHandler == NULL) {
|
|
||||||
oldHandler = &oldHandler_local;
|
|
||||||
}
|
|
||||||
//+ 0x10 comes because of trap type assignment to IRQs in UT699 processor
|
|
||||||
rtems_status_code status = rtems_interrupt_catch(handler, interrupt + 0x10,
|
|
||||||
oldHandler);
|
|
||||||
switch(status){
|
|
||||||
case RTEMS_SUCCESSFUL:
|
|
||||||
//ISR established successfully
|
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
|
||||||
case RTEMS_INVALID_NUMBER:
|
|
||||||
//illegal vector number
|
|
||||||
return HasReturnvaluesIF::RETURN_FAILED;
|
|
||||||
case RTEMS_INVALID_ADDRESS:
|
|
||||||
//illegal ISR entry point or invalid old_isr_handler
|
|
||||||
return HasReturnvaluesIF::RETURN_FAILED;
|
|
||||||
default:
|
|
||||||
return HasReturnvaluesIF::RETURN_FAILED;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
ReturnValue_t Interrupt::disableInterrupt(InterruptNumber_t interruptNumber) {
|
|
||||||
//TODO Not implemented
|
|
||||||
return HasReturnvaluesIF::RETURN_FAILED;
|
|
||||||
}
|
|
||||||
|
|
||||||
//SHOULDDO: Make default values (edge, polarity) settable?
|
|
||||||
ReturnValue_t Interrupt::enableGpioInterrupt(InterruptNumber_t interrupt) {
|
|
||||||
volatile uint32_t* irqMask = hw_irq_mask;
|
|
||||||
uint32_t expectedValue = *irqMask | (1 << interrupt);
|
|
||||||
*irqMask = expectedValue;
|
|
||||||
uint32_t tempValue = *irqMask;
|
|
||||||
if (tempValue == expectedValue) {
|
|
||||||
volatile hw_gpio_port_t* ioPorts = hw_gpio_port;
|
|
||||||
ioPorts->direction &= ~(1 << interrupt); //Direction In
|
|
||||||
ioPorts->interrupt_edge |= 1 << interrupt; //Edge triggered
|
|
||||||
ioPorts->interrupt_polarity |= 1 << interrupt; //Trigger on rising edge
|
|
||||||
ioPorts->interrupt_mask |= 1 << interrupt; //Enable
|
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
|
||||||
} else {
|
|
||||||
return HasReturnvaluesIF::RETURN_FAILED;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ReturnValue_t Interrupt::disableGpioInterrupt(InterruptNumber_t interrupt) {
|
|
||||||
volatile uint32_t* irqMask = hw_irq_mask;
|
|
||||||
uint32_t expectedValue = *irqMask & ~(1 << interrupt);
|
|
||||||
*irqMask = expectedValue;
|
|
||||||
uint32_t tempValue = *irqMask;
|
|
||||||
if (tempValue == expectedValue) {
|
|
||||||
//Disable gpio IRQ
|
|
||||||
volatile hw_gpio_port_t* ioPorts = hw_gpio_port;
|
|
||||||
ioPorts->interrupt_mask &= ~(1 << interrupt);
|
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
|
||||||
} else {
|
|
||||||
return HasReturnvaluesIF::RETURN_FAILED;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool Interrupt::isInterruptInProgress() {
|
|
||||||
return rtems_interrupt_is_in_progress();
|
|
||||||
}
|
|
@ -1,50 +0,0 @@
|
|||||||
#ifndef OS_RTEMS_INTERRUPT_H_
|
|
||||||
#define OS_RTEMS_INTERRUPT_H_
|
|
||||||
|
|
||||||
#include "../../returnvalues/HasReturnvaluesIF.h"
|
|
||||||
#include <cstring>
|
|
||||||
#include <rtems.h>
|
|
||||||
|
|
||||||
typedef rtems_isr_entry IsrHandler_t;
|
|
||||||
typedef rtems_isr IsrReturn_t;
|
|
||||||
typedef rtems_vector_number InterruptNumber_t;
|
|
||||||
|
|
||||||
class Interrupt {
|
|
||||||
public:
|
|
||||||
virtual ~Interrupt(){};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Establishes a new interrupt service routine.
|
|
||||||
* @param handler The service routine to establish
|
|
||||||
* @param interrupt The interrupt (NOT trap type) the routine shall react to.
|
|
||||||
* @return RETURN_OK on success. Otherwise, the OS failure code is returned.
|
|
||||||
*/
|
|
||||||
static ReturnValue_t setInterruptServiceRoutine(IsrHandler_t handler,
|
|
||||||
InterruptNumber_t interrupt, IsrHandler_t *oldHandler = NULL);
|
|
||||||
static ReturnValue_t enableInterrupt(InterruptNumber_t interruptNumber);
|
|
||||||
static ReturnValue_t disableInterrupt(InterruptNumber_t interruptNumber);
|
|
||||||
/**
|
|
||||||
* Enables the interrupt given.
|
|
||||||
* The function tests, if the InterruptMask register was written successfully.
|
|
||||||
* @param interrupt The interrupt to enable.
|
|
||||||
* @return RETURN_OK if the interrupt was set successfully. RETURN_FAILED else.
|
|
||||||
*/
|
|
||||||
static ReturnValue_t enableGpioInterrupt(InterruptNumber_t interrupt);
|
|
||||||
/**
|
|
||||||
* Disables the interrupt given.
|
|
||||||
* @param interrupt The interrupt to disable.
|
|
||||||
* @return RETURN_OK if the interrupt was set successfully. RETURN_FAILED else.
|
|
||||||
*/
|
|
||||||
static ReturnValue_t disableGpioInterrupt(InterruptNumber_t interrupt);
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Checks if the current executing context is an ISR.
|
|
||||||
* @return true if handling an interrupt, false else.
|
|
||||||
*/
|
|
||||||
static bool isInterruptInProgress();
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
#endif /* OS_RTEMS_INTERRUPT_H_ */
|
|
@ -1,14 +1,15 @@
|
|||||||
#include "../../serviceinterface/ServiceInterfaceStream.h"
|
#include "../../serviceinterface/ServiceInterfaceStream.h"
|
||||||
|
#include "../../objectmanager/ObjectManagerIF.h"
|
||||||
#include "MessageQueue.h"
|
#include "MessageQueue.h"
|
||||||
#include "RtemsBasic.h"
|
#include "RtemsBasic.h"
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
MessageQueue::MessageQueue(size_t message_depth, size_t max_message_size) :
|
MessageQueue::MessageQueue(size_t message_depth, size_t max_message_size) :
|
||||||
id(0), lastPartner(0), defaultDestination(NO_QUEUE), internalErrorReporter(NULL) {
|
id(0), lastPartner(0), defaultDestination(NO_QUEUE), internalErrorReporter(nullptr) {
|
||||||
rtems_name name = ('Q' << 24) + (queueCounter++ << 8);
|
rtems_name name = ('Q' << 24) + (queueCounter++ << 8);
|
||||||
rtems_status_code status = rtems_message_queue_create(name, message_depth,
|
rtems_status_code status = rtems_message_queue_create(name, message_depth,
|
||||||
max_message_size, 0, &(this->id));
|
max_message_size, 0, &(this->id));
|
||||||
if (status != RTEMS_SUCCESSFUL) {
|
if (status != RTEMS_SUCCESSFUL) {
|
||||||
error << "MessageQueue::MessageQueue: Creating Queue " << std::hex
|
sif::error << "MessageQueue::MessageQueue: Creating Queue " << std::hex
|
||||||
<< name << std::dec << " failed with status:"
|
<< name << std::dec << " failed with status:"
|
||||||
<< (uint32_t) status << std::endl;
|
<< (uint32_t) status << std::endl;
|
||||||
this->id = 0;
|
this->id = 0;
|
||||||
@ -20,15 +21,15 @@ MessageQueue::~MessageQueue() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ReturnValue_t MessageQueue::sendMessage(MessageQueueId_t sendTo,
|
ReturnValue_t MessageQueue::sendMessage(MessageQueueId_t sendTo,
|
||||||
MessageQueueMessage* message, bool ignoreFault) {
|
MessageQueueMessageIF* message, bool ignoreFault) {
|
||||||
return sendMessageFrom(sendTo, message, this->getId(), ignoreFault);
|
return sendMessageFrom(sendTo, message, this->getId(), ignoreFault);
|
||||||
}
|
}
|
||||||
|
|
||||||
ReturnValue_t MessageQueue::sendToDefault(MessageQueueMessage* message) {
|
ReturnValue_t MessageQueue::sendToDefault(MessageQueueMessageIF* message) {
|
||||||
return sendToDefaultFrom(message, this->getId());
|
return sendToDefaultFrom(message, this->getId());
|
||||||
}
|
}
|
||||||
|
|
||||||
ReturnValue_t MessageQueue::reply(MessageQueueMessage* message) {
|
ReturnValue_t MessageQueue::reply(MessageQueueMessageIF* message) {
|
||||||
if (this->lastPartner != 0) {
|
if (this->lastPartner != 0) {
|
||||||
return sendMessage(this->lastPartner, message, this->getId());
|
return sendMessage(this->lastPartner, message, this->getId());
|
||||||
} else {
|
} else {
|
||||||
@ -36,27 +37,29 @@ ReturnValue_t MessageQueue::reply(MessageQueueMessage* message) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ReturnValue_t MessageQueue::receiveMessage(MessageQueueMessage* message,
|
ReturnValue_t MessageQueue::receiveMessage(MessageQueueMessageIF* message,
|
||||||
MessageQueueId_t* receivedFrom) {
|
MessageQueueId_t* receivedFrom) {
|
||||||
ReturnValue_t status = this->receiveMessage(message);
|
ReturnValue_t status = this->receiveMessage(message);
|
||||||
*receivedFrom = this->lastPartner;
|
*receivedFrom = this->lastPartner;
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
ReturnValue_t MessageQueue::receiveMessage(MessageQueueMessage* message) {
|
ReturnValue_t MessageQueue::receiveMessage(MessageQueueMessageIF* message) {
|
||||||
|
size_t size = 0;
|
||||||
rtems_status_code status = rtems_message_queue_receive(id,
|
rtems_status_code status = rtems_message_queue_receive(id,
|
||||||
message->getBuffer(), &(message->messageSize),
|
message->getBuffer(),&size,
|
||||||
RTEMS_NO_WAIT, 1);
|
RTEMS_NO_WAIT, 1);
|
||||||
if (status == RTEMS_SUCCESSFUL) {
|
if (status == RTEMS_SUCCESSFUL) {
|
||||||
|
message->setMessageSize(size);
|
||||||
this->lastPartner = message->getSender();
|
this->lastPartner = message->getSender();
|
||||||
//Check size of incoming message.
|
//Check size of incoming message.
|
||||||
if (message->messageSize < message->getMinimumMessageSize()) {
|
if (message->getMessageSize() < message->getMinimumMessageSize()) {
|
||||||
return HasReturnvaluesIF::RETURN_FAILED;
|
return HasReturnvaluesIF::RETURN_FAILED;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
//No message was received. Keep lastPartner anyway, I might send something later.
|
//No message was received. Keep lastPartner anyway, I might send something later.
|
||||||
//But still, delete packet content.
|
//But still, delete packet content.
|
||||||
memset(message->getData(), 0, message->MAX_DATA_SIZE);
|
memset(message->getData(), 0, message->getMaximumMessageSize());
|
||||||
}
|
}
|
||||||
return convertReturnCode(status);
|
return convertReturnCode(status);
|
||||||
}
|
}
|
||||||
@ -79,20 +82,20 @@ void MessageQueue::setDefaultDestination(MessageQueueId_t defaultDestination) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ReturnValue_t MessageQueue::sendMessageFrom(MessageQueueId_t sendTo,
|
ReturnValue_t MessageQueue::sendMessageFrom(MessageQueueId_t sendTo,
|
||||||
MessageQueueMessage* message, MessageQueueId_t sentFrom,
|
MessageQueueMessageIF* message, MessageQueueId_t sentFrom,
|
||||||
bool ignoreFault) {
|
bool ignoreFault) {
|
||||||
|
|
||||||
message->setSender(sentFrom);
|
message->setSender(sentFrom);
|
||||||
rtems_status_code result = rtems_message_queue_send(sendTo,
|
rtems_status_code result = rtems_message_queue_send(sendTo,
|
||||||
message->getBuffer(), message->messageSize);
|
message->getBuffer(), message->getMessageSize());
|
||||||
|
|
||||||
//TODO: Check if we're in ISR.
|
//TODO: Check if we're in ISR.
|
||||||
if (result != RTEMS_SUCCESSFUL && !ignoreFault) {
|
if (result != RTEMS_SUCCESSFUL && !ignoreFault) {
|
||||||
if (internalErrorReporter == NULL) {
|
if (internalErrorReporter == nullptr) {
|
||||||
internalErrorReporter = objectManager->get<InternalErrorReporterIF>(
|
internalErrorReporter = objectManager->get<InternalErrorReporterIF>(
|
||||||
objects::INTERNAL_ERROR_REPORTER);
|
objects::INTERNAL_ERROR_REPORTER);
|
||||||
}
|
}
|
||||||
if (internalErrorReporter != NULL) {
|
if (internalErrorReporter != nullptr) {
|
||||||
internalErrorReporter->queueMessageNotSent();
|
internalErrorReporter->queueMessageNotSent();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -105,7 +108,7 @@ ReturnValue_t MessageQueue::sendMessageFrom(MessageQueueId_t sendTo,
|
|||||||
return returnCode;
|
return returnCode;
|
||||||
}
|
}
|
||||||
|
|
||||||
ReturnValue_t MessageQueue::sendToDefaultFrom(MessageQueueMessage* message,
|
ReturnValue_t MessageQueue::sendToDefaultFrom(MessageQueueMessageIF* message,
|
||||||
MessageQueueId_t sentFrom, bool ignoreFault) {
|
MessageQueueId_t sentFrom, bool ignoreFault) {
|
||||||
return sendMessageFrom(defaultDestination, message, sentFrom, ignoreFault);
|
return sendMessageFrom(defaultDestination, message, sentFrom, ignoreFault);
|
||||||
}
|
}
|
||||||
|
@ -1,14 +1,5 @@
|
|||||||
/**
|
#ifndef FSFW_OSAL_RTEMS_MESSAGEQUEUE_H_
|
||||||
* @file MessageQueue.h
|
#define FSFW_OSAL_RTEMS_MESSAGEQUEUE_H_
|
||||||
*
|
|
||||||
* @date 10/02/2012
|
|
||||||
* @author Bastian Baetz
|
|
||||||
*
|
|
||||||
* @brief This file contains the definition of the MessageQueue class.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef MESSAGEQUEUE_H_
|
|
||||||
#define MESSAGEQUEUE_H_
|
|
||||||
|
|
||||||
#include "../../internalError/InternalErrorReporterIF.h"
|
#include "../../internalError/InternalErrorReporterIF.h"
|
||||||
#include "../../ipc/MessageQueueIF.h"
|
#include "../../ipc/MessageQueueIF.h"
|
||||||
@ -60,14 +51,14 @@ public:
|
|||||||
* @param ignoreFault If set to true, the internal software fault counter is not incremented if queue is full.
|
* @param ignoreFault If set to true, the internal software fault counter is not incremented if queue is full.
|
||||||
*/
|
*/
|
||||||
ReturnValue_t sendMessage(MessageQueueId_t sendTo,
|
ReturnValue_t sendMessage(MessageQueueId_t sendTo,
|
||||||
MessageQueueMessage* message, bool ignoreFault = false );
|
MessageQueueMessageIF* message, bool ignoreFault = false );
|
||||||
/**
|
/**
|
||||||
* @brief This operation sends a message to the default destination.
|
* @brief This operation sends a message to the default destination.
|
||||||
* @details As in the sendMessage method, this function uses the sendToDefault call of the
|
* @details As in the sendMessage method, this function uses the sendToDefault call of the
|
||||||
* MessageQueueSender parent class and adds its queue id as "sentFrom" information.
|
* MessageQueueSender parent class and adds its queue id as "sentFrom" information.
|
||||||
* @param message A pointer to a previously created message, which is sent.
|
* @param message A pointer to a previously created message, which is sent.
|
||||||
*/
|
*/
|
||||||
ReturnValue_t sendToDefault( MessageQueueMessage* message );
|
ReturnValue_t sendToDefault( MessageQueueMessageIF* message );
|
||||||
/**
|
/**
|
||||||
* @brief This operation sends a message to the last communication partner.
|
* @brief This operation sends a message to the last communication partner.
|
||||||
* @details This operation simplifies answering an incoming message by using the stored
|
* @details This operation simplifies answering an incoming message by using the stored
|
||||||
@ -75,7 +66,7 @@ public:
|
|||||||
* (i.e. lastPartner is zero), an error code is returned.
|
* (i.e. lastPartner is zero), an error code is returned.
|
||||||
* @param message A pointer to a previously created message, which is sent.
|
* @param message A pointer to a previously created message, which is sent.
|
||||||
*/
|
*/
|
||||||
ReturnValue_t reply( MessageQueueMessage* message );
|
ReturnValue_t reply( MessageQueueMessageIF* message );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief This function reads available messages from the message queue and returns the sender.
|
* @brief This function reads available messages from the message queue and returns the sender.
|
||||||
@ -84,7 +75,7 @@ public:
|
|||||||
* @param message A pointer to a message in which the received data is stored.
|
* @param message A pointer to a message in which the received data is stored.
|
||||||
* @param receivedFrom A pointer to a queue id in which the sender's id is stored.
|
* @param receivedFrom A pointer to a queue id in which the sender's id is stored.
|
||||||
*/
|
*/
|
||||||
ReturnValue_t receiveMessage(MessageQueueMessage* message,
|
ReturnValue_t receiveMessage(MessageQueueMessageIF* message,
|
||||||
MessageQueueId_t *receivedFrom);
|
MessageQueueId_t *receivedFrom);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -95,7 +86,7 @@ public:
|
|||||||
* message's content is cleared and the function returns immediately.
|
* message's content is cleared and the function returns immediately.
|
||||||
* @param message A pointer to a message in which the received data is stored.
|
* @param message A pointer to a message in which the received data is stored.
|
||||||
*/
|
*/
|
||||||
ReturnValue_t receiveMessage(MessageQueueMessage* message);
|
ReturnValue_t receiveMessage(MessageQueueMessageIF* message);
|
||||||
/**
|
/**
|
||||||
* Deletes all pending messages in the queue.
|
* Deletes all pending messages in the queue.
|
||||||
* @param count The number of flushed messages.
|
* @param count The number of flushed messages.
|
||||||
@ -121,7 +112,7 @@ public:
|
|||||||
* This variable is set to zero by default.
|
* This variable is set to zero by default.
|
||||||
* \param ignoreFault If set to true, the internal software fault counter is not incremented if queue is full.
|
* \param ignoreFault If set to true, the internal software fault counter is not incremented if queue is full.
|
||||||
*/
|
*/
|
||||||
virtual ReturnValue_t sendMessageFrom( MessageQueueId_t sendTo, MessageQueueMessage* message, MessageQueueId_t sentFrom = NO_QUEUE, bool ignoreFault = false );
|
virtual ReturnValue_t sendMessageFrom( MessageQueueId_t sendTo, MessageQueueMessageIF* message, MessageQueueId_t sentFrom = NO_QUEUE, bool ignoreFault = false );
|
||||||
/**
|
/**
|
||||||
* \brief The sendToDefault method sends a queue message to the default destination.
|
* \brief The sendToDefault method sends a queue message to the default destination.
|
||||||
* \details In all other aspects, it works identical to the sendMessage method.
|
* \details In all other aspects, it works identical to the sendMessage method.
|
||||||
@ -129,7 +120,7 @@ public:
|
|||||||
* \param sentFrom The sentFrom information can be set to inject the sender's queue id into the message.
|
* \param sentFrom The sentFrom information can be set to inject the sender's queue id into the message.
|
||||||
* This variable is set to zero by default.
|
* This variable is set to zero by default.
|
||||||
*/
|
*/
|
||||||
virtual ReturnValue_t sendToDefaultFrom( MessageQueueMessage* message, MessageQueueId_t sentFrom = NO_QUEUE, bool ignoreFault = false );
|
virtual ReturnValue_t sendToDefaultFrom( MessageQueueMessageIF* message, MessageQueueId_t sentFrom = NO_QUEUE, bool ignoreFault = false );
|
||||||
/**
|
/**
|
||||||
* \brief This method is a simple setter for the default destination.
|
* \brief This method is a simple setter for the default destination.
|
||||||
*/
|
*/
|
||||||
@ -178,4 +169,4 @@ private:
|
|||||||
static ReturnValue_t convertReturnCode(rtems_status_code inValue);
|
static ReturnValue_t convertReturnCode(rtems_status_code inValue);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* MESSAGEQUEUE_H_ */
|
#endif /* FSFW_OSAL_RTEMS_MESSAGEQUEUE_H_ */
|
||||||
|
@ -30,7 +30,7 @@ ReturnValue_t MultiObjectTask::startTask() {
|
|||||||
rtems_status_code status = rtems_task_start(id, MultiObjectTask::taskEntryPoint,
|
rtems_status_code status = rtems_task_start(id, MultiObjectTask::taskEntryPoint,
|
||||||
rtems_task_argument((void *) this));
|
rtems_task_argument((void *) this));
|
||||||
if (status != RTEMS_SUCCESSFUL) {
|
if (status != RTEMS_SUCCESSFUL) {
|
||||||
error << "ObjectTask::startTask for " << std::hex << this->getId()
|
sif::error << "ObjectTask::startTask for " << std::hex << this->getId()
|
||||||
<< std::dec << " failed." << std::endl;
|
<< std::dec << " failed." << std::endl;
|
||||||
}
|
}
|
||||||
switch(status){
|
switch(status){
|
||||||
@ -63,8 +63,8 @@ void MultiObjectTask::taskFunctionality() {
|
|||||||
char nameSpace[8] = { 0 };
|
char nameSpace[8] = { 0 };
|
||||||
char* ptr = rtems_object_get_name(getId(), sizeof(nameSpace),
|
char* ptr = rtems_object_get_name(getId(), sizeof(nameSpace),
|
||||||
nameSpace);
|
nameSpace);
|
||||||
error << "ObjectTask: " << ptr << " Deadline missed." << std::endl;
|
sif::error << "ObjectTask: " << ptr << " Deadline missed." << std::endl;
|
||||||
if (this->deadlineMissedFunc != NULL) {
|
if (this->deadlineMissedFunc != nullptr) {
|
||||||
this->deadlineMissedFunc();
|
this->deadlineMissedFunc();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -74,7 +74,7 @@ void MultiObjectTask::taskFunctionality() {
|
|||||||
ReturnValue_t MultiObjectTask::addComponent(object_id_t object) {
|
ReturnValue_t MultiObjectTask::addComponent(object_id_t object) {
|
||||||
ExecutableObjectIF* newObject = objectManager->get<ExecutableObjectIF>(
|
ExecutableObjectIF* newObject = objectManager->get<ExecutableObjectIF>(
|
||||||
object);
|
object);
|
||||||
if (newObject == NULL) {
|
if (newObject == nullptr) {
|
||||||
return HasReturnvaluesIF::RETURN_FAILED;
|
return HasReturnvaluesIF::RETURN_FAILED;
|
||||||
}
|
}
|
||||||
objectList.push_back(newObject);
|
objectList.push_back(newObject);
|
||||||
|
@ -80,7 +80,7 @@ protected:
|
|||||||
/**
|
/**
|
||||||
* @brief The pointer to the deadline-missed function.
|
* @brief The pointer to the deadline-missed function.
|
||||||
* @details This pointer stores the function that is executed if the task's deadline is missed.
|
* @details This pointer stores the function that is executed if the task's deadline is missed.
|
||||||
* So, each may react individually on a timing failure. The pointer may be NULL,
|
* So, each may react individually on a timing failure. The pointer may be nullptr,
|
||||||
* then nothing happens on missing the deadline. The deadline is equal to the next execution
|
* then nothing happens on missing the deadline. The deadline is equal to the next execution
|
||||||
* of the periodic task.
|
* of the periodic task.
|
||||||
*/
|
*/
|
||||||
|
@ -10,7 +10,7 @@ Mutex::Mutex() :
|
|||||||
RTEMS_BINARY_SEMAPHORE | RTEMS_PRIORITY | RTEMS_INHERIT_PRIORITY, 0,
|
RTEMS_BINARY_SEMAPHORE | RTEMS_PRIORITY | RTEMS_INHERIT_PRIORITY, 0,
|
||||||
&mutexId);
|
&mutexId);
|
||||||
if (status != RTEMS_SUCCESSFUL) {
|
if (status != RTEMS_SUCCESSFUL) {
|
||||||
error << "Mutex: creation with name, id " << mutexName << ", " << mutexId
|
sif::error << "Mutex: creation with name, id " << mutexName << ", " << mutexId
|
||||||
<< " failed with " << status << std::endl;
|
<< " failed with " << status << std::endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -18,24 +18,25 @@ Mutex::Mutex() :
|
|||||||
Mutex::~Mutex() {
|
Mutex::~Mutex() {
|
||||||
rtems_status_code status = rtems_semaphore_delete(mutexId);
|
rtems_status_code status = rtems_semaphore_delete(mutexId);
|
||||||
if (status != RTEMS_SUCCESSFUL) {
|
if (status != RTEMS_SUCCESSFUL) {
|
||||||
error << "Mutex: deletion for id " << mutexId
|
sif::error << "Mutex: deletion for id " << mutexId
|
||||||
<< " failed with " << status << std::endl;
|
<< " failed with " << status << std::endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ReturnValue_t Mutex::lockMutex(TimeoutType timeoutType =
|
ReturnValue_t Mutex::lockMutex(TimeoutType timeoutType =
|
||||||
TimeoutType::BLOCKING, uint32_t timeoutMs) {
|
TimeoutType::BLOCKING, uint32_t timeoutMs) {
|
||||||
|
rtems_status_code status = RTEMS_INVALID_ID;
|
||||||
if(timeoutMs == MutexIF::TimeoutType::BLOCKING) {
|
if(timeoutMs == MutexIF::TimeoutType::BLOCKING) {
|
||||||
rtems_status_code status = rtems_semaphore_obtain(mutexId,
|
status = rtems_semaphore_obtain(mutexId,
|
||||||
RTEMS_WAIT, RTEMS_NO_TIMEOUT);
|
RTEMS_WAIT, RTEMS_NO_TIMEOUT);
|
||||||
}
|
}
|
||||||
else if(timeoutMs == MutexIF::TimeoutType::POLLING) {
|
else if(timeoutMs == MutexIF::TimeoutType::POLLING) {
|
||||||
timeoutMs = RTEMS_NO_TIMEOUT;
|
timeoutMs = RTEMS_NO_TIMEOUT;
|
||||||
rtems_status_code status = rtems_semaphore_obtain(mutexId,
|
status = rtems_semaphore_obtain(mutexId,
|
||||||
RTEMS_NO_WAIT, 0);
|
RTEMS_NO_WAIT, 0);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
rtems_status_code status = rtems_semaphore_obtain(mutexId,
|
status = rtems_semaphore_obtain(mutexId,
|
||||||
RTEMS_WAIT, timeoutMs);
|
RTEMS_WAIT, timeoutMs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#ifndef FRAMEWORK_OSAL_RTEMS_MUTEX_H_
|
#ifndef FSFW_OSAL_RTEMS_MUTEX_H_
|
||||||
#define FRAMEWORK_OSAL_RTEMS_MUTEX_H_
|
#define FSFW_OSAL_RTEMS_MUTEX_H_
|
||||||
|
|
||||||
#include "../../ipc/MutexIF.h"
|
#include "../../ipc/MutexIF.h"
|
||||||
#include "RtemsBasic.h"
|
#include "RtemsBasic.h"
|
||||||
@ -15,4 +15,4 @@ private:
|
|||||||
static uint8_t count;
|
static uint8_t count;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* OS_RTEMS_MUTEX_H_ */
|
#endif /* FSFW_OSAL_RTEMS_MUTEX_H_ */
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
#include "Mutex.h"
|
#include "Mutex.h"
|
||||||
#include "RtemsBasic.h"
|
#include "RtemsBasic.h"
|
||||||
|
|
||||||
//TODO: Different variant than the lazy loading in QueueFactory. What's better and why?
|
|
||||||
MutexFactory* MutexFactory::factoryInstance = new MutexFactory();
|
MutexFactory* MutexFactory::factoryInstance = new MutexFactory();
|
||||||
|
|
||||||
MutexFactory::MutexFactory() {
|
MutexFactory::MutexFactory() {
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
#include "../../devicehandlers/FixedSequenceSlot.h"
|
#include "../../tasks/FixedSequenceSlot.h"
|
||||||
#include "../../objectmanager/SystemObjectIF.h"
|
#include "../../objectmanager/SystemObjectIF.h"
|
||||||
|
#include "../../objectmanager/ObjectManagerIF.h"
|
||||||
#include "PollingTask.h"
|
#include "PollingTask.h"
|
||||||
#include "RtemsBasic.h"
|
#include "RtemsBasic.h"
|
||||||
#include "../../returnvalues/HasReturnvaluesIF.h"
|
#include "../../returnvalues/HasReturnvaluesIF.h"
|
||||||
@ -34,14 +35,14 @@ rtems_task PollingTask::taskEntryPoint(rtems_task_argument argument) {
|
|||||||
PollingTask *originalTask(reinterpret_cast<PollingTask*>(argument));
|
PollingTask *originalTask(reinterpret_cast<PollingTask*>(argument));
|
||||||
//The task's functionality is called.
|
//The task's functionality is called.
|
||||||
originalTask->taskFunctionality();
|
originalTask->taskFunctionality();
|
||||||
debug << "Polling task " << originalTask->getId()
|
sif::debug << "Polling task " << originalTask->getId()
|
||||||
<< " returned from taskFunctionality." << std::endl;
|
<< " returned from taskFunctionality." << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
void PollingTask::missedDeadlineCounter() {
|
void PollingTask::missedDeadlineCounter() {
|
||||||
PollingTask::deadlineMissedCount++;
|
PollingTask::deadlineMissedCount++;
|
||||||
if (PollingTask::deadlineMissedCount % 10 == 0) {
|
if (PollingTask::deadlineMissedCount % 10 == 0) {
|
||||||
error << "PST missed " << PollingTask::deadlineMissedCount
|
sif::error << "PST missed " << PollingTask::deadlineMissedCount
|
||||||
<< " deadlines." << std::endl;
|
<< " deadlines." << std::endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -50,7 +51,7 @@ ReturnValue_t PollingTask::startTask() {
|
|||||||
rtems_status_code status = rtems_task_start(id, PollingTask::taskEntryPoint,
|
rtems_status_code status = rtems_task_start(id, PollingTask::taskEntryPoint,
|
||||||
rtems_task_argument((void *) this));
|
rtems_task_argument((void *) this));
|
||||||
if (status != RTEMS_SUCCESSFUL) {
|
if (status != RTEMS_SUCCESSFUL) {
|
||||||
error << "PollingTask::startTask for " << std::hex << this->getId()
|
sif::error << "PollingTask::startTask for " << std::hex << this->getId()
|
||||||
<< std::dec << " failed." << std::endl;
|
<< std::dec << " failed." << std::endl;
|
||||||
}
|
}
|
||||||
switch(status){
|
switch(status){
|
||||||
@ -68,12 +69,13 @@ ReturnValue_t PollingTask::startTask() {
|
|||||||
|
|
||||||
ReturnValue_t PollingTask::addSlot(object_id_t componentId,
|
ReturnValue_t PollingTask::addSlot(object_id_t componentId,
|
||||||
uint32_t slotTimeMs, int8_t executionStep) {
|
uint32_t slotTimeMs, int8_t executionStep) {
|
||||||
if (objectManager->get<ExecutableObjectIF>(componentId) != nullptr) {
|
ExecutableObjectIF* object = objectManager->get<ExecutableObjectIF>(componentId);
|
||||||
pst.addSlot(componentId, slotTimeMs, executionStep, this);
|
if (object != nullptr) {
|
||||||
|
pst.addSlot(componentId, slotTimeMs, executionStep, object, this);
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
return HasReturnvaluesIF::RETURN_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
error << "Component " << std::hex << componentId <<
|
sif::error << "Component " << std::hex << componentId <<
|
||||||
" not found, not adding it to pst" << std::endl;
|
" not found, not adding it to pst" << std::endl;
|
||||||
return HasReturnvaluesIF::RETURN_FAILED;
|
return HasReturnvaluesIF::RETURN_FAILED;
|
||||||
}
|
}
|
||||||
@ -90,11 +92,10 @@ ReturnValue_t PollingTask::checkSequence() const {
|
|||||||
|
|
||||||
void PollingTask::taskFunctionality() {
|
void PollingTask::taskFunctionality() {
|
||||||
// A local iterator for the Polling Sequence Table is created to find the start time for the first entry.
|
// A local iterator for the Polling Sequence Table is created to find the start time for the first entry.
|
||||||
std::list<FixedSequenceSlot*>::iterator it = pst.current;
|
FixedSlotSequence::SlotListIter it = pst.current;
|
||||||
|
|
||||||
//The start time for the first entry is read.
|
//The start time for the first entry is read.
|
||||||
rtems_interval interval = RtemsBasic::convertMsToTicks(
|
rtems_interval interval = RtemsBasic::convertMsToTicks(it->pollingTimeMs);
|
||||||
(*it)->pollingTimeMs);
|
|
||||||
TaskBase::setAndStartPeriod(interval,&periodId);
|
TaskBase::setAndStartPeriod(interval,&periodId);
|
||||||
//The task's "infinite" inner loop is entered.
|
//The task's "infinite" inner loop is entered.
|
||||||
while (1) {
|
while (1) {
|
||||||
@ -107,7 +108,7 @@ void PollingTask::taskFunctionality() {
|
|||||||
//If the deadline was missed, the deadlineMissedFunc is called.
|
//If the deadline was missed, the deadlineMissedFunc is called.
|
||||||
rtems_status_code status = TaskBase::restartPeriod(interval,periodId);
|
rtems_status_code status = TaskBase::restartPeriod(interval,periodId);
|
||||||
if (status == RTEMS_TIMEOUT) {
|
if (status == RTEMS_TIMEOUT) {
|
||||||
if (this->deadlineMissedFunc != NULL) {
|
if (this->deadlineMissedFunc != nullptr) {
|
||||||
this->deadlineMissedFunc();
|
this->deadlineMissedFunc();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#ifndef POLLINGTASK_H_
|
#ifndef FSFW_OSAL_RTEMS_POLLINGTASK_H_
|
||||||
#define POLLINGTASK_H_
|
#define FSFW_OSAL_RTEMS_POLLINGTASK_H_
|
||||||
|
|
||||||
#include "../../devicehandlers/FixedSlotSequence.h"
|
#include "../../tasks/FixedSlotSequence.h"
|
||||||
#include "../../tasks/FixedTimeslotTaskIF.h"
|
#include "../../tasks/FixedTimeslotTaskIF.h"
|
||||||
#include "TaskBase.h"
|
#include "TaskBase.h"
|
||||||
|
|
||||||
@ -82,4 +82,4 @@ protected:
|
|||||||
void taskFunctionality( void );
|
void taskFunctionality( void );
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* POLLINGTASK_H_ */
|
#endif /* FSFW_OSAL_RTEMS_POLLINGTASK_H_ */
|
||||||
|
@ -1,16 +1,17 @@
|
|||||||
#include "../../ipc/QueueFactory.h"
|
#include "../../ipc/QueueFactory.h"
|
||||||
|
#include "../../ipc/MessageQueueSenderIF.h"
|
||||||
#include "MessageQueue.h"
|
#include "MessageQueue.h"
|
||||||
#include "RtemsBasic.h"
|
#include "RtemsBasic.h"
|
||||||
|
|
||||||
QueueFactory* QueueFactory::factoryInstance = NULL;
|
QueueFactory* QueueFactory::factoryInstance = nullptr;
|
||||||
|
|
||||||
|
|
||||||
ReturnValue_t MessageQueueSenderIF::sendMessage(MessageQueueId_t sendTo,
|
ReturnValue_t MessageQueueSenderIF::sendMessage(MessageQueueId_t sendTo,
|
||||||
MessageQueueMessage* message, MessageQueueId_t sentFrom,bool ignoreFault) {
|
MessageQueueMessageIF* message, MessageQueueId_t sentFrom,bool ignoreFault) {
|
||||||
//TODO add ignoreFault functionality
|
//TODO add ignoreFault functionality
|
||||||
message->setSender(sentFrom);
|
message->setSender(sentFrom);
|
||||||
rtems_status_code result = rtems_message_queue_send(sendTo, message->getBuffer(),
|
rtems_status_code result = rtems_message_queue_send(sendTo, message->getBuffer(),
|
||||||
message->messageSize);
|
message->getMessageSize());
|
||||||
switch(result){
|
switch(result){
|
||||||
case RTEMS_SUCCESSFUL:
|
case RTEMS_SUCCESSFUL:
|
||||||
//message sent successfully
|
//message sent successfully
|
||||||
@ -37,7 +38,7 @@ ReturnValue_t MessageQueueSenderIF::sendMessage(MessageQueueId_t sendTo,
|
|||||||
}
|
}
|
||||||
|
|
||||||
QueueFactory* QueueFactory::instance() {
|
QueueFactory* QueueFactory::instance() {
|
||||||
if (factoryInstance == NULL) {
|
if (factoryInstance == nullptr) {
|
||||||
factoryInstance = new QueueFactory;
|
factoryInstance = new QueueFactory;
|
||||||
}
|
}
|
||||||
return factoryInstance;
|
return factoryInstance;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#ifndef OS_RTEMS_RTEMSBASIC_H_
|
#ifndef FSFW_OSAL_RTEMS_RTEMSBASIC_H_
|
||||||
#define OS_RTEMS_RTEMSBASIC_H_
|
#define FSFW_OSAL_RTEMS_RTEMSBASIC_H_
|
||||||
|
|
||||||
#include "../../returnvalues/HasReturnvaluesIF.h"
|
#include "../../returnvalues/HasReturnvaluesIF.h"
|
||||||
#include <rtems.h>
|
#include <rtems.h>
|
||||||
@ -22,4 +22,4 @@ public:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* OS_RTEMS_RTEMSBASIC_H_ */
|
#endif /* FSFW_OSAL_RTEMS_RTEMSBASIC_H_ */
|
||||||
|
@ -22,7 +22,7 @@ TaskBase::TaskBase(rtems_task_priority set_priority, size_t stack_size,
|
|||||||
}
|
}
|
||||||
ReturnValue_t result = convertReturnCode(status);
|
ReturnValue_t result = convertReturnCode(status);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
error << "TaskBase::TaskBase: createTask with name " << std::hex
|
sif::error << "TaskBase::TaskBase: createTask with name " << std::hex
|
||||||
<< osalName << std::dec << " failed with return code "
|
<< osalName << std::dec << " failed with return code "
|
||||||
<< (uint32_t) status << std::endl;
|
<< (uint32_t) status << std::endl;
|
||||||
this->id = 0;
|
this->id = 0;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#ifndef TASKBASE_H_
|
#ifndef FSFW_OSAL_RTEMS_TASKBASE_H_
|
||||||
#define TASKBASE_H_
|
#define FSFW_OSAL_RTEMS_TASKBASE_H_
|
||||||
|
|
||||||
#include "RtemsBasic.h"
|
#include "RtemsBasic.h"
|
||||||
#include "../../tasks/PeriodicTaskIF.h"
|
#include "../../tasks/PeriodicTaskIF.h"
|
||||||
@ -44,4 +44,4 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
#endif /* TASKBASE_H_ */
|
#endif /* FSFW_OSAL_RTEMS_TASKBASE_H_ */
|
||||||
|
148
osal/windows/TcWinUdpPollingTask.cpp
Normal file
148
osal/windows/TcWinUdpPollingTask.cpp
Normal file
@ -0,0 +1,148 @@
|
|||||||
|
#include "TcWinUdpPollingTask.h"
|
||||||
|
#include "../../globalfunctions/arrayprinter.h"
|
||||||
|
#include "../../serviceinterface/ServiceInterfaceStream.h"
|
||||||
|
|
||||||
|
#include <winsock2.h>
|
||||||
|
#include <windows.h>
|
||||||
|
|
||||||
|
TcWinUdpPollingTask::TcWinUdpPollingTask(object_id_t objectId,
|
||||||
|
object_id_t tmtcUnixUdpBridge, size_t frameSize,
|
||||||
|
double timeoutSeconds): SystemObject(objectId),
|
||||||
|
tmtcBridgeId(tmtcUnixUdpBridge) {
|
||||||
|
if(frameSize > 0) {
|
||||||
|
this->frameSize = frameSize;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
this->frameSize = DEFAULT_MAX_FRAME_SIZE;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set up reception buffer with specified frame size.
|
||||||
|
// For now, it is assumed that only one frame is held in the buffer!
|
||||||
|
receptionBuffer.reserve(this->frameSize);
|
||||||
|
receptionBuffer.resize(this->frameSize);
|
||||||
|
|
||||||
|
if(timeoutSeconds == -1) {
|
||||||
|
receptionTimeout = DEFAULT_TIMEOUT;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
receptionTimeout = timevalOperations::toTimeval(timeoutSeconds);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
TcWinUdpPollingTask::~TcWinUdpPollingTask() {}
|
||||||
|
|
||||||
|
ReturnValue_t TcWinUdpPollingTask::performOperation(uint8_t opCode) {
|
||||||
|
// Poll for new UDP datagrams in permanent loop.
|
||||||
|
while(true) {
|
||||||
|
//! Sender Address is cached here.
|
||||||
|
struct sockaddr_in senderAddress;
|
||||||
|
int senderAddressSize = sizeof(senderAddress);
|
||||||
|
ssize_t bytesReceived = recvfrom(serverUdpSocket,
|
||||||
|
reinterpret_cast<char*>(receptionBuffer.data()), frameSize,
|
||||||
|
receptionFlags, reinterpret_cast<sockaddr*>(&senderAddress),
|
||||||
|
&senderAddressSize);
|
||||||
|
if(bytesReceived == SOCKET_ERROR) {
|
||||||
|
// handle error
|
||||||
|
sif::error << "TcWinUdpPollingTask::performOperation: Reception"
|
||||||
|
" error." << std::endl;
|
||||||
|
handleReadError();
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
//sif::debug << "TcWinUdpPollingTask::performOperation: " << bytesReceived
|
||||||
|
// << " bytes received" << std::endl;
|
||||||
|
|
||||||
|
ReturnValue_t result = handleSuccessfullTcRead(bytesReceived);
|
||||||
|
if(result != HasReturnvaluesIF::RETURN_FAILED) {
|
||||||
|
|
||||||
|
}
|
||||||
|
tmtcBridge->registerCommConnect();
|
||||||
|
tmtcBridge->checkAndSetClientAddress(senderAddress);
|
||||||
|
}
|
||||||
|
return HasReturnvaluesIF::RETURN_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
ReturnValue_t TcWinUdpPollingTask::handleSuccessfullTcRead(size_t bytesRead) {
|
||||||
|
store_address_t storeId;
|
||||||
|
ReturnValue_t result = tcStore->addData(&storeId,
|
||||||
|
receptionBuffer.data(), bytesRead);
|
||||||
|
// arrayprinter::print(receptionBuffer.data(), bytesRead);
|
||||||
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
|
sif::error << "TcSerialPollingTask::transferPusToSoftwareBus: Data "
|
||||||
|
"storage failed" << std::endl;
|
||||||
|
sif::error << "Packet size: " << bytesRead << std::endl;
|
||||||
|
return HasReturnvaluesIF::RETURN_FAILED;
|
||||||
|
}
|
||||||
|
|
||||||
|
TmTcMessage message(storeId);
|
||||||
|
|
||||||
|
result = MessageQueueSenderIF::sendMessage(targetTcDestination, &message);
|
||||||
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
|
sif::error << "Serial Polling: Sending message to queue failed"
|
||||||
|
<< std::endl;
|
||||||
|
tcStore->deleteData(storeId);
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
ReturnValue_t TcWinUdpPollingTask::initialize() {
|
||||||
|
tcStore = objectManager->get<StorageManagerIF>(objects::TC_STORE);
|
||||||
|
if (tcStore == nullptr) {
|
||||||
|
sif::error << "TcSerialPollingTask::initialize: TC Store uninitialized!"
|
||||||
|
<< std::endl;
|
||||||
|
return ObjectManagerIF::CHILD_INIT_FAILED;
|
||||||
|
}
|
||||||
|
|
||||||
|
tmtcBridge = objectManager->get<TmTcWinUdpBridge>(tmtcBridgeId);
|
||||||
|
if(tmtcBridge == nullptr) {
|
||||||
|
sif::error << "TcSocketPollingTask::TcSocketPollingTask: Invalid"
|
||||||
|
" TMTC bridge object!" << std::endl;
|
||||||
|
return ObjectManagerIF::CHILD_INIT_FAILED;
|
||||||
|
}
|
||||||
|
|
||||||
|
serverUdpSocket = tmtcBridge->serverSocket;
|
||||||
|
//sif::info << "TcWinUdpPollingTask::initialize: Server UDP socket "
|
||||||
|
// << serverUdpSocket << std::endl;
|
||||||
|
|
||||||
|
return HasReturnvaluesIF::RETURN_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
ReturnValue_t TcWinUdpPollingTask::initializeAfterTaskCreation() {
|
||||||
|
// Initialize the destination after task creation. This ensures
|
||||||
|
// that the destination has already been set in the TMTC bridge.
|
||||||
|
targetTcDestination = tmtcBridge->getRequestQueue();
|
||||||
|
return HasReturnvaluesIF::RETURN_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
void TcWinUdpPollingTask::setTimeout(double timeoutSeconds) {
|
||||||
|
DWORD timeoutMs = timeoutSeconds * 1000.0;
|
||||||
|
int result = setsockopt(serverUdpSocket, SOL_SOCKET, SO_RCVTIMEO,
|
||||||
|
reinterpret_cast<const char*>(&timeoutMs), sizeof(DWORD));
|
||||||
|
if(result == -1) {
|
||||||
|
sif::error << "TcSocketPollingTask::TcSocketPollingTask: Setting "
|
||||||
|
"receive timeout failed with " << strerror(errno) << std::endl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void TcWinUdpPollingTask::handleReadError() {
|
||||||
|
int error = WSAGetLastError();
|
||||||
|
switch(error) {
|
||||||
|
case(WSANOTINITIALISED): {
|
||||||
|
sif::info << "TmTcWinUdpBridge::handleReadError: WSANOTINITIALISED: "
|
||||||
|
<< "WSAStartup(...) call " << "necessary" << std::endl;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case(WSAEFAULT): {
|
||||||
|
sif::info << "TmTcWinUdpBridge::handleReadError: WSADEFAULT: "
|
||||||
|
<< "Bad address " << std::endl;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default: {
|
||||||
|
sif::info << "TmTcWinUdpBridge::handleReadError: Error code: "
|
||||||
|
<< error << std::endl;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// to prevent spam.
|
||||||
|
Sleep(1000);
|
||||||
|
}
|
67
osal/windows/TcWinUdpPollingTask.h
Normal file
67
osal/windows/TcWinUdpPollingTask.h
Normal file
@ -0,0 +1,67 @@
|
|||||||
|
#ifndef FSFW_OSAL_WINDOWS_TCSOCKETPOLLINGTASK_H_
|
||||||
|
#define FSFW_OSAL_WINDOWS_TCSOCKETPOLLINGTASK_H_
|
||||||
|
|
||||||
|
#include "TmTcWinUdpBridge.h"
|
||||||
|
#include "../../objectmanager/SystemObject.h"
|
||||||
|
#include "../../tasks/ExecutableObjectIF.h"
|
||||||
|
#include "../../storagemanager/StorageManagerIF.h"
|
||||||
|
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief This class can be used to implement the polling of a Unix socket,
|
||||||
|
* using UDP for now.
|
||||||
|
* @details
|
||||||
|
* The task will be blocked while the specified number of bytes has not been
|
||||||
|
* received, so TC reception is handled inside a separate task.
|
||||||
|
* This class caches the IP address of the sender. It is assumed there
|
||||||
|
* is only one sender for now.
|
||||||
|
*/
|
||||||
|
class TcWinUdpPollingTask: public SystemObject,
|
||||||
|
public ExecutableObjectIF {
|
||||||
|
friend class TmTcWinUdpBridge;
|
||||||
|
public:
|
||||||
|
static constexpr size_t DEFAULT_MAX_FRAME_SIZE = 2048;
|
||||||
|
//! 0.5 default milliseconds timeout for now.
|
||||||
|
static constexpr timeval DEFAULT_TIMEOUT = {.tv_sec = 0, .tv_usec = 500};
|
||||||
|
|
||||||
|
TcWinUdpPollingTask(object_id_t objectId, object_id_t tmtcUnixUdpBridge,
|
||||||
|
size_t frameSize = 0, double timeoutSeconds = -1);
|
||||||
|
virtual~ TcWinUdpPollingTask();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Turn on optional timeout for UDP polling. In the default mode,
|
||||||
|
* the receive function will block until a packet is received.
|
||||||
|
* @param timeoutSeconds
|
||||||
|
*/
|
||||||
|
void setTimeout(double timeoutSeconds);
|
||||||
|
|
||||||
|
virtual ReturnValue_t performOperation(uint8_t opCode) override;
|
||||||
|
virtual ReturnValue_t initialize() override;
|
||||||
|
virtual ReturnValue_t initializeAfterTaskCreation() override;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
StorageManagerIF* tcStore = nullptr;
|
||||||
|
|
||||||
|
private:
|
||||||
|
//! TMTC bridge is cached.
|
||||||
|
object_id_t tmtcBridgeId = objects::NO_OBJECT;
|
||||||
|
TmTcWinUdpBridge* tmtcBridge = nullptr;
|
||||||
|
MessageQueueId_t targetTcDestination = MessageQueueIF::NO_QUEUE;
|
||||||
|
//! Reception flags: https://linux.die.net/man/2/recvfrom.
|
||||||
|
int receptionFlags = 0;
|
||||||
|
|
||||||
|
//! Server socket, which is member of TMTC bridge and is assigned in
|
||||||
|
//! constructor
|
||||||
|
SOCKET serverUdpSocket = 0;
|
||||||
|
|
||||||
|
std::vector<uint8_t> receptionBuffer;
|
||||||
|
|
||||||
|
size_t frameSize = 0;
|
||||||
|
timeval receptionTimeout;
|
||||||
|
|
||||||
|
ReturnValue_t handleSuccessfullTcRead(size_t bytesRead);
|
||||||
|
void handleReadError();
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif /* FRAMEWORK_OSAL_LINUX_TCSOCKETPOLLINGTASK_H_ */
|
176
osal/windows/TmTcWinUdpBridge.cpp
Normal file
176
osal/windows/TmTcWinUdpBridge.cpp
Normal file
@ -0,0 +1,176 @@
|
|||||||
|
#include <fsfw/ipc/MutexHelper.h>
|
||||||
|
#include "TmTcWinUdpBridge.h"
|
||||||
|
|
||||||
|
TmTcWinUdpBridge::TmTcWinUdpBridge(object_id_t objectId,
|
||||||
|
object_id_t tcDestination, object_id_t tmStoreId, object_id_t tcStoreId,
|
||||||
|
uint16_t serverPort, uint16_t clientPort):
|
||||||
|
TmTcBridge(objectId, tcDestination, tmStoreId, tcStoreId) {
|
||||||
|
mutex = MutexFactory::instance()->createMutex();
|
||||||
|
|
||||||
|
// Initiates Winsock DLL.
|
||||||
|
WSAData wsaData;
|
||||||
|
WORD wVersionRequested = MAKEWORD(2, 2);
|
||||||
|
int err = WSAStartup(wVersionRequested, &wsaData);
|
||||||
|
if (err != 0) {
|
||||||
|
/* Tell the user that we could not find a usable */
|
||||||
|
/* Winsock DLL. */
|
||||||
|
sif::error << "TmTcWinUdpBridge::TmTcWinUdpBridge:"
|
||||||
|
"WSAStartup failed with error: " << err << std::endl;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint16_t setServerPort = DEFAULT_UDP_SERVER_PORT;
|
||||||
|
if(serverPort != 0xFFFF) {
|
||||||
|
setServerPort = serverPort;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint16_t setClientPort = DEFAULT_UDP_CLIENT_PORT;
|
||||||
|
if(clientPort != 0xFFFF) {
|
||||||
|
setClientPort = clientPort;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set up UDP socket: https://man7.org/linux/man-pages/man7/ip.7.html
|
||||||
|
//clientSocket = socket(AF_INET, SOCK_DGRAM, 0);
|
||||||
|
serverSocket = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
|
||||||
|
if(serverSocket == INVALID_SOCKET) {
|
||||||
|
sif::error << "TmTcWinUdpBridge::TmTcWinUdpBridge: Could not open"
|
||||||
|
" UDP socket!" << std::endl;
|
||||||
|
handleSocketError();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
serverAddress.sin_family = AF_INET;
|
||||||
|
|
||||||
|
// Accept packets from any interface. (potentially insecure).
|
||||||
|
serverAddress.sin_addr.s_addr = htonl(INADDR_ANY);
|
||||||
|
serverAddress.sin_port = htons(setServerPort);
|
||||||
|
serverAddressLen = sizeof(serverAddress);
|
||||||
|
setsockopt(serverSocket, SOL_SOCKET, SO_REUSEADDR,
|
||||||
|
reinterpret_cast<const char*>(&serverSocketOptions),
|
||||||
|
sizeof(serverSocketOptions));
|
||||||
|
|
||||||
|
clientAddress.sin_family = AF_INET;
|
||||||
|
clientAddress.sin_addr.s_addr = htonl(INADDR_ANY);
|
||||||
|
clientAddress.sin_port = htons(setClientPort);
|
||||||
|
clientAddressLen = sizeof(clientAddress);
|
||||||
|
|
||||||
|
int result = bind(serverSocket,
|
||||||
|
reinterpret_cast<struct sockaddr*>(&serverAddress),
|
||||||
|
serverAddressLen);
|
||||||
|
if(result != 0) {
|
||||||
|
sif::error << "TmTcWinUdpBridge::TmTcWinUdpBridge: Could not bind "
|
||||||
|
"local port " << setServerPort << " to server socket!"
|
||||||
|
<< std::endl;
|
||||||
|
handleBindError();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
TmTcWinUdpBridge::~TmTcWinUdpBridge() {
|
||||||
|
WSACleanup();
|
||||||
|
}
|
||||||
|
|
||||||
|
ReturnValue_t TmTcWinUdpBridge::sendTm(const uint8_t *data, size_t dataLen) {
|
||||||
|
int flags = 0;
|
||||||
|
|
||||||
|
//clientAddress.sin_addr.s_addr = htons(INADDR_ANY);
|
||||||
|
//clientAddressLen = sizeof(serverAddress);
|
||||||
|
|
||||||
|
// char ipAddress [15];
|
||||||
|
// sif::debug << "IP Address Sender: "<< inet_ntop(AF_INET,
|
||||||
|
// &clientAddress.sin_addr.s_addr, ipAddress, 15) << std::endl;
|
||||||
|
|
||||||
|
ssize_t bytesSent = sendto(serverSocket,
|
||||||
|
reinterpret_cast<const char*>(data), dataLen, flags,
|
||||||
|
reinterpret_cast<sockaddr*>(&clientAddress), clientAddressLen);
|
||||||
|
if(bytesSent == SOCKET_ERROR) {
|
||||||
|
sif::error << "TmTcWinUdpBridge::sendTm: Send operation failed."
|
||||||
|
<< std::endl;
|
||||||
|
handleSendError();
|
||||||
|
}
|
||||||
|
// sif::debug << "TmTcUnixUdpBridge::sendTm: " << bytesSent << " bytes were"
|
||||||
|
// " sent." << std::endl;
|
||||||
|
return HasReturnvaluesIF::RETURN_OK;
|
||||||
|
return HasReturnvaluesIF::RETURN_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
void TmTcWinUdpBridge::checkAndSetClientAddress(sockaddr_in newAddress) {
|
||||||
|
MutexHelper lock(mutex, MutexIF::TimeoutType::WAITING, 10);
|
||||||
|
|
||||||
|
// char ipAddress [15];
|
||||||
|
// sif::debug << "IP Address Sender: "<< inet_ntop(AF_INET,
|
||||||
|
// &newAddress.sin_addr.s_addr, ipAddress, 15) << std::endl;
|
||||||
|
// sif::debug << "IP Address Old: " << inet_ntop(AF_INET,
|
||||||
|
// &clientAddress.sin_addr.s_addr, ipAddress, 15) << std::endl;
|
||||||
|
|
||||||
|
// Set new IP address if it has changed.
|
||||||
|
if(clientAddress.sin_addr.s_addr != newAddress.sin_addr.s_addr) {
|
||||||
|
clientAddress.sin_addr.s_addr = newAddress.sin_addr.s_addr;
|
||||||
|
clientAddressLen = sizeof(clientAddress);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void TmTcWinUdpBridge::handleSocketError() {
|
||||||
|
int errCode = WSAGetLastError();
|
||||||
|
switch(errCode) {
|
||||||
|
case(WSANOTINITIALISED): {
|
||||||
|
sif::info << "TmTcWinUdpBridge::handleSocketError: WSANOTINITIALISED: "
|
||||||
|
<< "WSAStartup(...) call " << "necessary" << std::endl;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default: {
|
||||||
|
/*
|
||||||
|
https://docs.microsoft.com/en-us/windows/win32/winsock/
|
||||||
|
windows-sockets-error-codes-2
|
||||||
|
*/
|
||||||
|
sif::info << "TmTcWinUdpBridge::handleSocketError: Error code: "
|
||||||
|
<< errCode << std::endl;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void TmTcWinUdpBridge::handleBindError() {
|
||||||
|
int errCode = WSAGetLastError();
|
||||||
|
switch(errCode) {
|
||||||
|
case(WSANOTINITIALISED): {
|
||||||
|
sif::info << "TmTcWinUdpBridge::handleBindError: WSANOTINITIALISED: "
|
||||||
|
<< "WSAStartup(...) call " << "necessary" << std::endl;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default: {
|
||||||
|
/*
|
||||||
|
https://docs.microsoft.com/en-us/windows/win32/winsock/
|
||||||
|
windows-sockets-error-codes-2
|
||||||
|
*/
|
||||||
|
sif::info << "TmTcWinUdpBridge::handleBindError: Error code: "
|
||||||
|
<< errCode << std::endl;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void TmTcWinUdpBridge::handleSendError() {
|
||||||
|
int errCode = WSAGetLastError();
|
||||||
|
switch(errCode) {
|
||||||
|
case(WSANOTINITIALISED): {
|
||||||
|
sif::info << "TmTcWinUdpBridge::handleSendError: WSANOTINITIALISED: "
|
||||||
|
<< "WSAStartup(...) call " << "necessary" << std::endl;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case(WSAEADDRNOTAVAIL): {
|
||||||
|
sif::info << "TmTcWinUdpBridge::handleReadError: WSAEADDRNOTAVAIL: "
|
||||||
|
<< "Check target address. " << std::endl;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default: {
|
||||||
|
/*
|
||||||
|
https://docs.microsoft.com/en-us/windows/win32/winsock/
|
||||||
|
windows-sockets-error-codes-2
|
||||||
|
*/
|
||||||
|
sif::info << "TmTcWinUdpBridge::handleSendError: Error code: "
|
||||||
|
<< errCode << std::endl;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
49
osal/windows/TmTcWinUdpBridge.h
Normal file
49
osal/windows/TmTcWinUdpBridge.h
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
#ifndef FSFW_OSAL_WINDOWS_TMTCWINUDPBRIDGE_H_
|
||||||
|
#define FSFW_OSAL_WINDOWS_TMTCWINUDPBRIDGE_H_
|
||||||
|
|
||||||
|
#include "../../tmtcservices/TmTcBridge.h"
|
||||||
|
|
||||||
|
#include <winsock2.h>
|
||||||
|
#include <windows.h>
|
||||||
|
|
||||||
|
class TmTcWinUdpBridge: public TmTcBridge {
|
||||||
|
friend class TcWinUdpPollingTask;
|
||||||
|
public:
|
||||||
|
// The ports chosen here should not be used by any other process.
|
||||||
|
static constexpr uint16_t DEFAULT_UDP_SERVER_PORT = 7301;
|
||||||
|
static constexpr uint16_t DEFAULT_UDP_CLIENT_PORT = 7302;
|
||||||
|
|
||||||
|
TmTcWinUdpBridge(object_id_t objectId, object_id_t tcDestination,
|
||||||
|
object_id_t tmStoreId, object_id_t tcStoreId,
|
||||||
|
uint16_t serverPort = 0xFFFF,uint16_t clientPort = 0xFFFF);
|
||||||
|
virtual~ TmTcWinUdpBridge();
|
||||||
|
|
||||||
|
void checkAndSetClientAddress(sockaddr_in clientAddress);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual ReturnValue_t sendTm(const uint8_t * data, size_t dataLen) override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
SOCKET serverSocket = 0;
|
||||||
|
|
||||||
|
const int serverSocketOptions = 0;
|
||||||
|
|
||||||
|
struct sockaddr_in clientAddress;
|
||||||
|
int clientAddressLen = 0;
|
||||||
|
|
||||||
|
struct sockaddr_in serverAddress;
|
||||||
|
int serverAddressLen = 0;
|
||||||
|
|
||||||
|
//! Access to the client address is mutex protected as it is set
|
||||||
|
//! by another task.
|
||||||
|
MutexIF* mutex;
|
||||||
|
|
||||||
|
void handleSocketError();
|
||||||
|
void handleBindError();
|
||||||
|
void handleSendError();
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#endif /* FSFW_OSAL_HOST_TMTCWINUDPBRIDGE_H_ */
|
||||||
|
|
@ -1,8 +1,8 @@
|
|||||||
#ifndef FRAMEWORK_RETURNVALUES_HASRETURNVALUESIF_H_
|
#ifndef FSFW_RETURNVALUES_HASRETURNVALUESIF_H_
|
||||||
#define FRAMEWORK_RETURNVALUES_HASRETURNVALUESIF_H_
|
#define FSFW_RETURNVALUES_HASRETURNVALUESIF_H_
|
||||||
|
|
||||||
#include "FwClassIds.h"
|
#include "FwClassIds.h"
|
||||||
#include <config/returnvalues/classIds.h>
|
#include <returnvalues/classIds.h>
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
|
|
||||||
#define MAKE_RETURN_CODE( number ) ((INTERFACE_ID << 8) + (number))
|
#define MAKE_RETURN_CODE( number ) ((INTERFACE_ID << 8) + (number))
|
||||||
@ -15,9 +15,17 @@ public:
|
|||||||
static const ReturnValue_t RETURN_FAILED = 1;
|
static const ReturnValue_t RETURN_FAILED = 1;
|
||||||
virtual ~HasReturnvaluesIF() {}
|
virtual ~HasReturnvaluesIF() {}
|
||||||
|
|
||||||
static ReturnValue_t makeReturnCode(uint8_t interfaceId, uint8_t number) {
|
/**
|
||||||
return (interfaceId << 8) + number;
|
* It is discouraged to use the input parameters 0,0 and 0,1 as this
|
||||||
|
* will generate the RETURN_OK and RETURN_FAILED returnvalues.
|
||||||
|
* @param interfaceId
|
||||||
|
* @param number
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
static constexpr ReturnValue_t makeReturnCode(uint8_t interfaceId,
|
||||||
|
uint8_t number) {
|
||||||
|
return (static_cast<ReturnValue_t>(interfaceId) << 8) + number;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* FRAMEWORK_RETURNVALUES_HASRETURNVALUESIF_H_ */
|
#endif /* FSFW_RETURNVALUES_HASRETURNVALUESIF_H_ */
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
#include "../timemanager/CCSDSTime.h"
|
#include "CCSDSTime.h"
|
||||||
|
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
#include <cinttypes>
|
#include <cinttypes>
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
|
#include <FSFWConfig.h>
|
||||||
|
|
||||||
CCSDSTime::CCSDSTime() {
|
CCSDSTime::CCSDSTime() {
|
||||||
}
|
}
|
||||||
@ -158,15 +159,16 @@ ReturnValue_t CCSDSTime::convertFromASCII(Clock::TimeOfDay_t* to, const uint8_t*
|
|||||||
}
|
}
|
||||||
// Newlib nano can't parse uint8, see SCNu8 documentation and https://sourceware.org/newlib/README
|
// Newlib nano can't parse uint8, see SCNu8 documentation and https://sourceware.org/newlib/README
|
||||||
// Suggestion: use uint16 all the time. This should work on all systems.
|
// Suggestion: use uint16 all the time. This should work on all systems.
|
||||||
#ifdef NEWLIB_NANO_NO_C99_IO
|
#if FSFW_NO_C99_IO == 1
|
||||||
uint16_t year;
|
uint16_t year;
|
||||||
uint16_t month;
|
uint16_t month;
|
||||||
uint16_t day;
|
uint16_t day;
|
||||||
uint16_t hour;
|
uint16_t hour;
|
||||||
uint16_t minute;
|
uint16_t minute;
|
||||||
float second;
|
float second;
|
||||||
int count = sscanf((char *) from, "%4" SCNu16 "-%2" SCNu16 "-%2" SCNu16 "T%2" SCNu16 ":%2" SCNu16 ":%fZ", &year,
|
int count = sscanf((char *) from, "%4" SCNu16 "-%2" SCNu16 "-%2" SCNu16 "T%"
|
||||||
&month, &day, &hour, &minute, &second);
|
"2" SCNu16 ":%2" SCNu16 ":%fZ", &year, &month, &day, &hour,
|
||||||
|
&minute, &second);
|
||||||
if (count == 6) {
|
if (count == 6) {
|
||||||
to->year = year;
|
to->year = year;
|
||||||
to->month = month;
|
to->month = month;
|
||||||
@ -179,12 +181,13 @@ ReturnValue_t CCSDSTime::convertFromASCII(Clock::TimeOfDay_t* to, const uint8_t*
|
|||||||
}
|
}
|
||||||
|
|
||||||
// try Code B (yyyy-ddd)
|
// try Code B (yyyy-ddd)
|
||||||
count = sscanf((char *) from, "%4" SCNu16 "-%3" SCNu16 "T%2" SCNu16 ":%2" SCNu16 ":%fZ", &year, &day,
|
count = sscanf((char *) from, "%4" SCNu16 "-%3" SCNu16 "T%2" SCNu16 ":%"
|
||||||
&hour, &minute, &second);
|
"2" SCNu16 ":%fZ", &year, &day, &hour, &minute, &second);
|
||||||
if (count == 5) {
|
if (count == 5) {
|
||||||
uint8_t tempDay;
|
uint8_t tempDay;
|
||||||
ReturnValue_t result = CCSDSTime::convertDaysOfYear(day, year,
|
ReturnValue_t result = CCSDSTime::convertDaysOfYear(day, year,
|
||||||
reinterpret_cast<uint8_t *>(&month), reinterpret_cast<uint8_t *>(&tempDay));
|
reinterpret_cast<uint8_t *>(&month),
|
||||||
|
reinterpret_cast<uint8_t *>(&tempDay));
|
||||||
if (result != RETURN_OK) {
|
if (result != RETURN_OK) {
|
||||||
return RETURN_FAILED;
|
return RETURN_FAILED;
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
#define FRAMEWORK_TIMEMANAGER_CLOCK_H_
|
#define FRAMEWORK_TIMEMANAGER_CLOCK_H_
|
||||||
|
|
||||||
#include "../returnvalues/HasReturnvaluesIF.h"
|
#include "../returnvalues/HasReturnvaluesIF.h"
|
||||||
#include "../ipc/MutexFactory.h"
|
#include "../ipc/MutexHelper.h"
|
||||||
#include "../globalfunctions/timevalOperations.h"
|
#include "../globalfunctions/timevalOperations.h"
|
||||||
|
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
|
@ -14,8 +14,12 @@ public:
|
|||||||
static const uint8_t INTERFACE_ID = CLASS_ID::TIME_STAMPER_IF;
|
static const uint8_t INTERFACE_ID = CLASS_ID::TIME_STAMPER_IF;
|
||||||
static const ReturnValue_t BAD_TIMESTAMP = MAKE_RETURN_CODE(1);
|
static const ReturnValue_t BAD_TIMESTAMP = MAKE_RETURN_CODE(1);
|
||||||
|
|
||||||
static const uint8_t MISSION_TIMESTAMP_SIZE = 8; //!< This is a mission-specific constant and determines the total size reserved for timestamps.
|
//! This is a mission-specific constant and determines the total
|
||||||
virtual ReturnValue_t addTimeStamp(uint8_t* buffer, const uint8_t maxSize) = 0;
|
//! size reserved for timestamps.
|
||||||
|
//! TODO: Default define in FSFWConfig ?
|
||||||
|
static const uint8_t MISSION_TIMESTAMP_SIZE = 8;
|
||||||
|
virtual ReturnValue_t addTimeStamp(uint8_t* buffer,
|
||||||
|
const uint8_t maxSize) = 0;
|
||||||
virtual ~TimeStamperIF() {}
|
virtual ~TimeStamperIF() {}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#include "../serviceinterface/ServiceInterfaceStream.h"
|
|
||||||
#include "SpacePacketBase.h"
|
#include "SpacePacketBase.h"
|
||||||
#include <string.h>
|
#include "../serviceinterface/ServiceInterfaceStream.h"
|
||||||
|
#include <cstring>
|
||||||
|
|
||||||
SpacePacketBase::SpacePacketBase( const uint8_t* set_address ) {
|
SpacePacketBase::SpacePacketBase( const uint8_t* set_address ) {
|
||||||
this->data = (SpacePacketPointer*) set_address;
|
this->data = (SpacePacketPointer*) set_address;
|
||||||
@ -14,7 +14,8 @@ uint8_t SpacePacketBase::getPacketVersionNumber( void ) {
|
|||||||
return (this->data->header.packet_id_h & 0b11100000) >> 5;
|
return (this->data->header.packet_id_h & 0b11100000) >> 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SpacePacketBase::initSpacePacketHeader(bool isTelecommand, bool hasSecondaryHeader, uint16_t apid, uint16_t sequenceCount) {
|
void SpacePacketBase::initSpacePacketHeader(bool isTelecommand,
|
||||||
|
bool hasSecondaryHeader, uint16_t apid, uint16_t sequenceCount) {
|
||||||
//reset header to zero:
|
//reset header to zero:
|
||||||
memset(data,0, sizeof(this->data->header) );
|
memset(data,0, sizeof(this->data->header) );
|
||||||
//Set TC/TM bit.
|
//Set TC/TM bit.
|
||||||
@ -81,7 +82,7 @@ void SpacePacketBase::setPacketDataLength( uint16_t new_length) {
|
|||||||
this->data->header.packet_length_l = ( new_length & 0x00FF );
|
this->data->header.packet_length_l = ( new_length & 0x00FF );
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t SpacePacketBase::getFullSize() {
|
size_t SpacePacketBase::getFullSize() {
|
||||||
//+1 is done because size in packet data length field is: size of data field -1
|
//+1 is done because size in packet data length field is: size of data field -1
|
||||||
return this->getPacketDataLength() + sizeof(this->data->header) + 1;
|
return this->getPacketDataLength() + sizeof(this->data->header) + 1;
|
||||||
}
|
}
|
||||||
|
@ -1,10 +1,11 @@
|
|||||||
#ifndef SPACEPACKETBASE_H_
|
#ifndef FSFW_TMTCPACKET_SPACEPACKETBASE_H_
|
||||||
#define SPACEPACKETBASE_H_
|
#define FSFW_TMTCPACKET_SPACEPACKETBASE_H_
|
||||||
|
|
||||||
#include "ccsds_header.h"
|
#include "ccsds_header.h"
|
||||||
|
#include <cstddef>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \defgroup tmtcpackets Space Packets
|
* @defgroup tmtcpackets Space Packets
|
||||||
* This is the group, where all classes associated with Telecommand and
|
* This is the group, where all classes associated with Telecommand and
|
||||||
* Telemetry packets belong to.
|
* Telemetry packets belong to.
|
||||||
* The class hierarchy resembles the dependency between the different standards
|
* The class hierarchy resembles the dependency between the different standards
|
||||||
@ -81,7 +82,8 @@ public:
|
|||||||
*/
|
*/
|
||||||
bool isTelecommand( void );
|
bool isTelecommand( void );
|
||||||
|
|
||||||
void initSpacePacketHeader(bool isTelecommand, bool hasSecondaryHeader, uint16_t apid, uint16_t sequenceCount = 0);
|
void initSpacePacketHeader(bool isTelecommand, bool hasSecondaryHeader,
|
||||||
|
uint16_t apid, uint16_t sequenceCount = 0);
|
||||||
/**
|
/**
|
||||||
* The CCSDS header provides a secondary header flag (the fifth-highest bit),
|
* The CCSDS header provides a secondary header flag (the fifth-highest bit),
|
||||||
* which is checked with this method.
|
* which is checked with this method.
|
||||||
@ -167,10 +169,10 @@ public:
|
|||||||
* This method returns the full raw packet size.
|
* This method returns the full raw packet size.
|
||||||
* @return The full size of the packet in bytes.
|
* @return The full size of the packet in bytes.
|
||||||
*/
|
*/
|
||||||
uint32_t getFullSize();
|
size_t getFullSize();
|
||||||
|
|
||||||
uint32_t getApidAndSequenceCount() const;
|
uint32_t getApidAndSequenceCount() const;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* SPACEPACKETBASE_H_ */
|
#endif /* FSFW_TMTCPACKET_SPACEPACKETBASE_H_ */
|
||||||
|
@ -7,7 +7,8 @@ class TmPacketMinimal;
|
|||||||
class PacketTimestampInterpreterIF {
|
class PacketTimestampInterpreterIF {
|
||||||
public:
|
public:
|
||||||
virtual ~PacketTimestampInterpreterIF() {}
|
virtual ~PacketTimestampInterpreterIF() {}
|
||||||
virtual ReturnValue_t getPacketTime(TmPacketMinimal* packet, timeval* timestamp) const = 0;
|
virtual ReturnValue_t getPacketTime(TmPacketMinimal* packet,
|
||||||
|
timeval* timestamp) const = 0;
|
||||||
virtual ReturnValue_t getPacketTimeRaw(TmPacketMinimal* packet, const uint8_t** timePtr, uint32_t* size) const = 0;
|
virtual ReturnValue_t getPacketTimeRaw(TmPacketMinimal* packet, const uint8_t** timePtr, uint32_t* size) const = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1,11 +1,14 @@
|
|||||||
#include "../../globalfunctions/CRC.h"
|
|
||||||
#include "../../serviceinterface/ServiceInterfaceStream.h"
|
|
||||||
#include "TcPacketBase.h"
|
#include "TcPacketBase.h"
|
||||||
#include <string.h>
|
|
||||||
|
|
||||||
TcPacketBase::TcPacketBase(const uint8_t* set_data) :
|
#include "../../globalfunctions/CRC.h"
|
||||||
SpacePacketBase(set_data) {
|
#include "../../globalfunctions/arrayprinter.h"
|
||||||
tcData = (TcPacketPointer*) set_data;
|
#include "../../serviceinterface/ServiceInterfaceStream.h"
|
||||||
|
|
||||||
|
#include <cstring>
|
||||||
|
|
||||||
|
TcPacketBase::TcPacketBase(const uint8_t* setData) :
|
||||||
|
SpacePacketBase(setData) {
|
||||||
|
tcData = reinterpret_cast<TcPacketPointer*>(const_cast<uint8_t*>(setData));
|
||||||
}
|
}
|
||||||
|
|
||||||
TcPacketBase::~TcPacketBase() {
|
TcPacketBase::~TcPacketBase() {
|
||||||
@ -13,28 +16,28 @@ TcPacketBase::~TcPacketBase() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
uint8_t TcPacketBase::getService() {
|
uint8_t TcPacketBase::getService() {
|
||||||
return tcData->data_field.service_type;
|
return tcData->dataField.service_type;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t TcPacketBase::getSubService() {
|
uint8_t TcPacketBase::getSubService() {
|
||||||
return tcData->data_field.service_subtype;
|
return tcData->dataField.service_subtype;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t TcPacketBase::getAcknowledgeFlags() {
|
uint8_t TcPacketBase::getAcknowledgeFlags() {
|
||||||
return tcData->data_field.version_type_ack & 0b00001111;
|
return tcData->dataField.version_type_ack & 0b00001111;
|
||||||
}
|
}
|
||||||
|
|
||||||
const uint8_t* TcPacketBase::getApplicationData() const {
|
const uint8_t* TcPacketBase::getApplicationData() const {
|
||||||
return &tcData->data;
|
return &tcData->appData;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint16_t TcPacketBase::getApplicationDataSize() {
|
uint16_t TcPacketBase::getApplicationDataSize() {
|
||||||
return getPacketDataLength() - sizeof(tcData->data_field) - CRC_SIZE + 1;
|
return getPacketDataLength() - sizeof(tcData->dataField) - CRC_SIZE + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint16_t TcPacketBase::getErrorControl() {
|
uint16_t TcPacketBase::getErrorControl() {
|
||||||
uint16_t size = getApplicationDataSize() + CRC_SIZE;
|
uint16_t size = getApplicationDataSize() + CRC_SIZE;
|
||||||
uint8_t* p_to_buffer = &tcData->data;
|
uint8_t* p_to_buffer = &tcData->appData;
|
||||||
return (p_to_buffer[size - 2] << 8) + p_to_buffer[size - 1];
|
return (p_to_buffer[size - 2] << 8) + p_to_buffer[size - 1];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -42,41 +45,42 @@ void TcPacketBase::setErrorControl() {
|
|||||||
uint32_t full_size = getFullSize();
|
uint32_t full_size = getFullSize();
|
||||||
uint16_t crc = CRC::crc16ccitt(getWholeData(), full_size - CRC_SIZE);
|
uint16_t crc = CRC::crc16ccitt(getWholeData(), full_size - CRC_SIZE);
|
||||||
uint32_t size = getApplicationDataSize();
|
uint32_t size = getApplicationDataSize();
|
||||||
(&tcData->data)[size] = (crc & 0XFF00) >> 8; // CRCH
|
(&tcData->appData)[size] = (crc & 0XFF00) >> 8; // CRCH
|
||||||
(&tcData->data)[size + 1] = (crc) & 0X00FF; // CRCL
|
(&tcData->appData)[size + 1] = (crc) & 0X00FF; // CRCL
|
||||||
}
|
}
|
||||||
|
|
||||||
void TcPacketBase::setData(const uint8_t* p_Data) {
|
void TcPacketBase::setData(const uint8_t* pData) {
|
||||||
SpacePacketBase::setData(p_Data);
|
SpacePacketBase::setData(pData);
|
||||||
tcData = (TcPacketPointer*) p_Data;
|
tcData = (TcPacketPointer*) pData;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t TcPacketBase::getSecondaryHeaderFlag() {
|
uint8_t TcPacketBase::getSecondaryHeaderFlag() {
|
||||||
return (tcData->data_field.version_type_ack & 0b10000000) >> 7;
|
return (tcData->dataField.version_type_ack & 0b10000000) >> 7;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t TcPacketBase::getPusVersionNumber() {
|
uint8_t TcPacketBase::getPusVersionNumber() {
|
||||||
return (tcData->data_field.version_type_ack & 0b01110000) >> 4;
|
return (tcData->dataField.version_type_ack & 0b01110000) >> 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TcPacketBase::print() {
|
void TcPacketBase::print() {
|
||||||
uint8_t * wholeData = getWholeData();
|
sif::debug << "TcPacketBase::print: " << std::endl;
|
||||||
sif::debug << "TcPacket contains: " << std::endl;
|
arrayprinter::print(getWholeData(), getFullSize());
|
||||||
for (uint8_t count = 0; count < getFullSize(); ++count) {
|
|
||||||
sif::debug << std::hex << (uint16_t) wholeData[count] << " ";
|
|
||||||
}
|
|
||||||
sif::debug << std::dec << std::endl;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void TcPacketBase::initializeTcPacket(uint16_t apid, uint16_t sequenceCount,
|
void TcPacketBase::initializeTcPacket(uint16_t apid, uint16_t sequenceCount,
|
||||||
uint8_t ack, uint8_t service, uint8_t subservice) {
|
uint8_t ack, uint8_t service, uint8_t subservice) {
|
||||||
initSpacePacketHeader(true, true, apid, sequenceCount);
|
initSpacePacketHeader(true, true, apid, sequenceCount);
|
||||||
memset(&tcData->data_field, 0, sizeof(tcData->data_field));
|
std::memset(&tcData->dataField, 0, sizeof(tcData->dataField));
|
||||||
setPacketDataLength(sizeof(tcData->data_field) + CRC_SIZE);
|
setPacketDataLength(sizeof(PUSTcDataFieldHeader) + CRC_SIZE - 1);
|
||||||
//Data Field Header:
|
//Data Field Header:
|
||||||
//Set CCSDS_secondary_header_flag to 0, version number to 001 and ack to 0000
|
//Set CCSDS_secondary_header_flag to 0 and version number to 001
|
||||||
tcData->data_field.version_type_ack = 0b00010000;
|
tcData->dataField.version_type_ack = 0b00010000;
|
||||||
tcData->data_field.version_type_ack |= (ack & 0x0F);
|
tcData->dataField.version_type_ack |= (ack & 0x0F);
|
||||||
tcData->data_field.service_type = service;
|
tcData->dataField.service_type = service;
|
||||||
tcData->data_field.service_subtype = subservice;
|
tcData->dataField.service_subtype = subservice;
|
||||||
|
}
|
||||||
|
|
||||||
|
size_t TcPacketBase::calculateFullPacketLength(size_t appDataLen) {
|
||||||
|
return sizeof(CCSDSPrimaryHeader) + sizeof(PUSTcDataFieldHeader) +
|
||||||
|
appDataLen + TcPacketBase::CRC_SIZE;
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
#ifndef TCPACKETBASE_H_
|
#ifndef TMTCPACKET_PUS_TCPACKETBASE_H_
|
||||||
#define TCPACKETBASE_H_
|
#define TMTCPACKET_PUS_TCPACKETBASE_H_
|
||||||
|
|
||||||
#include "../../tmtcpacket/SpacePacketBase.h"
|
#include "../../tmtcpacket/SpacePacketBase.h"
|
||||||
|
#include <cstddef>
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This struct defines a byte-wise structured PUS TC Data Field Header.
|
* This struct defines a byte-wise structured PUS TC Data Field Header.
|
||||||
@ -23,14 +25,14 @@ struct PUSTcDataFieldHeader {
|
|||||||
*/
|
*/
|
||||||
struct TcPacketPointer {
|
struct TcPacketPointer {
|
||||||
CCSDSPrimaryHeader primary;
|
CCSDSPrimaryHeader primary;
|
||||||
PUSTcDataFieldHeader data_field;
|
PUSTcDataFieldHeader dataField;
|
||||||
uint8_t data;
|
uint8_t appData;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class is the basic data handler for any ECSS PUS Telecommand packet.
|
* This class is the basic data handler for any ECSS PUS Telecommand packet.
|
||||||
*
|
*
|
||||||
* In addition to \SpacePacketBase, the class provides methods to handle
|
* In addition to #SpacePacketBase, the class provides methods to handle
|
||||||
* the standardized entries of the PUS TC Packet Data Field Header.
|
* the standardized entries of the PUS TC Packet Data Field Header.
|
||||||
* It does not contain the packet data itself but a pointer to the
|
* It does not contain the packet data itself but a pointer to the
|
||||||
* data must be set on instantiation. An invalid pointer may cause
|
* data must be set on instantiation. An invalid pointer may cause
|
||||||
@ -39,67 +41,38 @@ struct TcPacketPointer {
|
|||||||
* @ingroup tmtcpackets
|
* @ingroup tmtcpackets
|
||||||
*/
|
*/
|
||||||
class TcPacketBase : public SpacePacketBase {
|
class TcPacketBase : public SpacePacketBase {
|
||||||
protected:
|
|
||||||
/**
|
|
||||||
* A pointer to a structure which defines the data structure of
|
|
||||||
* the packet's data.
|
|
||||||
*
|
|
||||||
* To be hardware-safe, all elements are of byte size.
|
|
||||||
*/
|
|
||||||
TcPacketPointer* tcData;
|
|
||||||
public:
|
public:
|
||||||
static const uint16_t TC_PACKET_MIN_SIZE = (sizeof(CCSDSPrimaryHeader) + sizeof(PUSTcDataFieldHeader) + 2);
|
static const uint16_t TC_PACKET_MIN_SIZE = (sizeof(CCSDSPrimaryHeader) +
|
||||||
/**
|
sizeof(PUSTcDataFieldHeader) + 2);
|
||||||
* With this constant for the acknowledge field responses on all levels are expected.
|
|
||||||
*/
|
enum AckField {
|
||||||
static const uint8_t ACK_ALL = 0b1111;
|
//! No acknowledgements are expected.
|
||||||
/**
|
ACK_NONE = 0b0000,
|
||||||
* With this constant for the acknowledge field a response on acceptance is expected.
|
//! Acknowledgements on acceptance are expected.
|
||||||
*/
|
ACK_ACCEPTANCE = 0b0001,
|
||||||
static const uint8_t ACK_ACCEPTANCE = 0b0001;
|
//! Acknowledgements on start are expected.
|
||||||
/**
|
ACK_START = 0b0010,
|
||||||
* With this constant for the acknowledge field a response on start of execution is expected.
|
//! Acknowledgements on step are expected.
|
||||||
*/
|
ACK_STEP = 0b0100,
|
||||||
static const uint8_t ACK_START = 0b0010;
|
//! Acknowledfgement on completion are expected.
|
||||||
/**
|
ACK_COMPLETION = 0b1000
|
||||||
* With this constant for the acknowledge field responses on execution steps are expected.
|
};
|
||||||
*/
|
|
||||||
static const uint8_t ACK_STEP = 0b0100;
|
static constexpr uint8_t ACK_ALL = ACK_ACCEPTANCE | ACK_START | ACK_STEP |
|
||||||
/**
|
ACK_COMPLETION;
|
||||||
* With this constant for the acknowledge field a response on completion is expected.
|
|
||||||
*/
|
|
||||||
static const uint8_t ACK_COMPLETION = 0b1000;
|
|
||||||
/**
|
|
||||||
* With this constant for the acknowledge field no responses are expected.
|
|
||||||
*/
|
|
||||||
static const uint8_t ACK_NONE = 0b000;
|
|
||||||
/**
|
/**
|
||||||
* This is the default constructor.
|
* This is the default constructor.
|
||||||
* It sets its internal data pointer to the address passed and also
|
* It sets its internal data pointer to the address passed and also
|
||||||
* forwards the data pointer to the parent SpacePacketBase class.
|
* forwards the data pointer to the parent SpacePacketBase class.
|
||||||
* @param set_address The position where the packet data lies.
|
* @param setData The position where the packet data lies.
|
||||||
*/
|
*/
|
||||||
TcPacketBase( const uint8_t* set_data );
|
TcPacketBase( const uint8_t* setData );
|
||||||
/**
|
/**
|
||||||
* This is the empty default destructor.
|
* This is the empty default destructor.
|
||||||
*/
|
*/
|
||||||
virtual ~TcPacketBase();
|
virtual ~TcPacketBase();
|
||||||
/**
|
|
||||||
* Initializes the Tc Packet header.
|
|
||||||
* @param apid APID used.
|
|
||||||
* @param service PUS Service
|
|
||||||
* @param subservice PUS Subservice
|
|
||||||
* @param packetSubcounter Additional subcounter used.
|
|
||||||
*/
|
|
||||||
/**
|
|
||||||
* Initializes the Tc Packet header.
|
|
||||||
* @param apid APID used.
|
|
||||||
* @param sequenceCount Sequence Count in the primary header.
|
|
||||||
* @param ack Which acknowledeges are expected from the receiver.
|
|
||||||
* @param service PUS Service
|
|
||||||
* @param subservice PUS Subservice
|
|
||||||
*/
|
|
||||||
void initializeTcPacket(uint16_t apid, uint16_t sequenceCount, uint8_t ack, uint8_t service, uint8_t subservice);
|
|
||||||
/**
|
/**
|
||||||
* This command returns the CCSDS Secondary Header Flag.
|
* This command returns the CCSDS Secondary Header Flag.
|
||||||
* It shall always be zero for PUS Packets. This is the
|
* It shall always be zero for PUS Packets. This is the
|
||||||
@ -166,22 +139,49 @@ public:
|
|||||||
* current content of the packet.
|
* current content of the packet.
|
||||||
*/
|
*/
|
||||||
void setErrorControl();
|
void setErrorControl();
|
||||||
/**
|
|
||||||
* With this method, the packet data pointer can be redirected to another
|
|
||||||
* location.
|
|
||||||
*
|
|
||||||
* This call overwrites the parent's setData method to set both its
|
|
||||||
* \c tc_data pointer and the parent's \c data pointer.
|
|
||||||
*
|
|
||||||
* @param p_data A pointer to another PUS Telecommand Packet.
|
|
||||||
*/
|
|
||||||
void setData( const uint8_t* p_data );
|
|
||||||
/**
|
/**
|
||||||
* This is a debugging helper method that prints the whole packet content
|
* This is a debugging helper method that prints the whole packet content
|
||||||
* to the screen.
|
* to the screen.
|
||||||
*/
|
*/
|
||||||
void print();
|
void print();
|
||||||
|
/**
|
||||||
|
* Calculate full packet length from application data length.
|
||||||
|
* @param appDataLen
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
static size_t calculateFullPacketLength(size_t appDataLen);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
/**
|
||||||
|
* A pointer to a structure which defines the data structure of
|
||||||
|
* the packet's data.
|
||||||
|
*
|
||||||
|
* To be hardware-safe, all elements are of byte size.
|
||||||
|
*/
|
||||||
|
TcPacketPointer* tcData;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Initializes the Tc Packet header.
|
||||||
|
* @param apid APID used.
|
||||||
|
* @param sequenceCount Sequence Count in the primary header.
|
||||||
|
* @param ack Which acknowledeges are expected from the receiver.
|
||||||
|
* @param service PUS Service
|
||||||
|
* @param subservice PUS Subservice
|
||||||
|
*/
|
||||||
|
void initializeTcPacket(uint16_t apid, uint16_t sequenceCount, uint8_t ack,
|
||||||
|
uint8_t service, uint8_t subservice);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* With this method, the packet data pointer can be redirected to another
|
||||||
|
* location.
|
||||||
|
* This call overwrites the parent's setData method to set both its
|
||||||
|
* @c tc_data pointer and the parent's @c data pointer.
|
||||||
|
*
|
||||||
|
* @param p_data A pointer to another PUS Telecommand Packet.
|
||||||
|
*/
|
||||||
|
void setData( const uint8_t* pData );
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
#endif /* TCPACKETBASE_H_ */
|
#endif /* TMTCPACKET_PUS_TCPACKETBASE_H_ */
|
||||||
|
@ -1,37 +1,50 @@
|
|||||||
|
#include "TcPacketStored.h"
|
||||||
#include "../../objectmanager/ObjectManagerIF.h"
|
#include "../../objectmanager/ObjectManagerIF.h"
|
||||||
#include "../../serviceinterface/ServiceInterfaceStream.h"
|
#include "../../serviceinterface/ServiceInterfaceStream.h"
|
||||||
#include "TcPacketStored.h"
|
|
||||||
#include <string.h>
|
#include <cstring>
|
||||||
|
|
||||||
|
StorageManagerIF* TcPacketStored::store = nullptr;
|
||||||
|
|
||||||
TcPacketStored::TcPacketStored(store_address_t setAddress) :
|
TcPacketStored::TcPacketStored(store_address_t setAddress) :
|
||||||
TcPacketBase(NULL), storeAddress(setAddress) {
|
TcPacketBase(nullptr), storeAddress(setAddress) {
|
||||||
this->setStoreAddress(this->storeAddress);
|
setStoreAddress(storeAddress);
|
||||||
}
|
}
|
||||||
|
|
||||||
TcPacketStored::TcPacketStored(uint16_t apid, uint8_t ack, uint8_t service,
|
TcPacketStored::TcPacketStored(uint16_t apid, uint8_t service,
|
||||||
uint8_t subservice, uint8_t sequence_count, const uint8_t* data,
|
uint8_t subservice, uint8_t sequenceCount, const uint8_t* data,
|
||||||
uint32_t size) :
|
size_t size, uint8_t ack) :
|
||||||
TcPacketBase(NULL) {
|
TcPacketBase(nullptr) {
|
||||||
this->storeAddress.raw = StorageManagerIF::INVALID_ADDRESS;
|
this->storeAddress.raw = StorageManagerIF::INVALID_ADDRESS;
|
||||||
if (!this->checkAndSetStore()) {
|
if (not this->checkAndSetStore()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
uint8_t* p_data = NULL;
|
uint8_t* pData = nullptr;
|
||||||
ReturnValue_t returnValue = this->store->getFreeElement(&this->storeAddress,
|
ReturnValue_t returnValue = this->store->getFreeElement(&this->storeAddress,
|
||||||
(TC_PACKET_MIN_SIZE + size), &p_data);
|
(TC_PACKET_MIN_SIZE + size), &pData);
|
||||||
if (returnValue != this->store->RETURN_OK) {
|
if (returnValue != this->store->RETURN_OK) {
|
||||||
|
sif::warning << "TcPacketStored: Could not get free element from store!"
|
||||||
|
<< std::endl;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this->setData(p_data);
|
this->setData(pData);
|
||||||
initializeTcPacket(apid, sequence_count, ack, service, subservice);
|
initializeTcPacket(apid, sequenceCount, ack, service, subservice);
|
||||||
memcpy(&tcData->data, data, size);
|
memcpy(&tcData->appData, data, size);
|
||||||
this->setPacketDataLength(
|
this->setPacketDataLength(
|
||||||
size + sizeof(PUSTcDataFieldHeader) + CRC_SIZE - 1);
|
size + sizeof(PUSTcDataFieldHeader) + CRC_SIZE - 1);
|
||||||
this->setErrorControl();
|
this->setErrorControl();
|
||||||
}
|
}
|
||||||
|
|
||||||
TcPacketStored::TcPacketStored() :
|
ReturnValue_t TcPacketStored::getData(const uint8_t ** dataPtr,
|
||||||
TcPacketBase(NULL) {
|
size_t* dataSize) {
|
||||||
|
auto result = this->store->getData(storeAddress, dataPtr, dataSize);
|
||||||
|
if(result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
|
sif::warning << "TcPacketStored: Could not get data!" << std::endl;
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
TcPacketStored::TcPacketStored(): TcPacketBase(nullptr) {
|
||||||
this->storeAddress.raw = StorageManagerIF::INVALID_ADDRESS;
|
this->storeAddress.raw = StorageManagerIF::INVALID_ADDRESS;
|
||||||
this->checkAndSetStore();
|
this->checkAndSetStore();
|
||||||
|
|
||||||
@ -40,14 +53,14 @@ TcPacketStored::TcPacketStored() :
|
|||||||
ReturnValue_t TcPacketStored::deletePacket() {
|
ReturnValue_t TcPacketStored::deletePacket() {
|
||||||
ReturnValue_t result = this->store->deleteData(this->storeAddress);
|
ReturnValue_t result = this->store->deleteData(this->storeAddress);
|
||||||
this->storeAddress.raw = StorageManagerIF::INVALID_ADDRESS;
|
this->storeAddress.raw = StorageManagerIF::INVALID_ADDRESS;
|
||||||
this->setData( NULL);
|
this->setData(nullptr);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TcPacketStored::checkAndSetStore() {
|
bool TcPacketStored::checkAndSetStore() {
|
||||||
if (this->store == NULL) {
|
if (this->store == nullptr) {
|
||||||
this->store = objectManager->get<StorageManagerIF>(objects::TC_STORE);
|
this->store = objectManager->get<StorageManagerIF>(objects::TC_STORE);
|
||||||
if (this->store == NULL) {
|
if (this->store == nullptr) {
|
||||||
sif::error << "TcPacketStored::TcPacketStored: TC Store not found!"
|
sif::error << "TcPacketStored::TcPacketStored: TC Store not found!"
|
||||||
<< std::endl;
|
<< std::endl;
|
||||||
return false;
|
return false;
|
||||||
@ -58,17 +71,17 @@ bool TcPacketStored::checkAndSetStore() {
|
|||||||
|
|
||||||
void TcPacketStored::setStoreAddress(store_address_t setAddress) {
|
void TcPacketStored::setStoreAddress(store_address_t setAddress) {
|
||||||
this->storeAddress = setAddress;
|
this->storeAddress = setAddress;
|
||||||
const uint8_t* temp_data = NULL;
|
const uint8_t* tempData = nullptr;
|
||||||
size_t temp_size;
|
size_t temp_size;
|
||||||
ReturnValue_t status = StorageManagerIF::RETURN_FAILED;
|
ReturnValue_t status = StorageManagerIF::RETURN_FAILED;
|
||||||
if (this->checkAndSetStore()) {
|
if (this->checkAndSetStore()) {
|
||||||
status = this->store->getData(this->storeAddress, &temp_data,
|
status = this->store->getData(this->storeAddress, &tempData,
|
||||||
&temp_size);
|
&temp_size);
|
||||||
}
|
}
|
||||||
if (status == StorageManagerIF::RETURN_OK) {
|
if (status == StorageManagerIF::RETURN_OK) {
|
||||||
this->setData(temp_data);
|
this->setData(tempData);
|
||||||
} else {
|
} else {
|
||||||
this->setData(NULL);
|
this->setData(nullptr);
|
||||||
this->storeAddress.raw = StorageManagerIF::INVALID_ADDRESS;
|
this->storeAddress.raw = StorageManagerIF::INVALID_ADDRESS;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -78,7 +91,7 @@ store_address_t TcPacketStored::getStoreAddress() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool TcPacketStored::isSizeCorrect() {
|
bool TcPacketStored::isSizeCorrect() {
|
||||||
const uint8_t* temp_data = NULL;
|
const uint8_t* temp_data = nullptr;
|
||||||
size_t temp_size;
|
size_t temp_size;
|
||||||
ReturnValue_t status = this->store->getData(this->storeAddress, &temp_data,
|
ReturnValue_t status = this->store->getData(this->storeAddress, &temp_data,
|
||||||
&temp_size);
|
&temp_size);
|
||||||
@ -90,8 +103,6 @@ bool TcPacketStored::isSizeCorrect() {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
StorageManagerIF* TcPacketStored::store = NULL;
|
|
||||||
|
|
||||||
TcPacketStored::TcPacketStored(const uint8_t* data, uint32_t size) :
|
TcPacketStored::TcPacketStored(const uint8_t* data, uint32_t size) :
|
||||||
TcPacketBase(data) {
|
TcPacketBase(data) {
|
||||||
if (getFullSize() != size) {
|
if (getFullSize() != size) {
|
||||||
@ -100,7 +111,7 @@ TcPacketStored::TcPacketStored(const uint8_t* data, uint32_t size) :
|
|||||||
if (this->checkAndSetStore()) {
|
if (this->checkAndSetStore()) {
|
||||||
ReturnValue_t status = store->addData(&storeAddress, data, size);
|
ReturnValue_t status = store->addData(&storeAddress, data, size);
|
||||||
if (status != HasReturnvaluesIF::RETURN_OK) {
|
if (status != HasReturnvaluesIF::RETURN_OK) {
|
||||||
this->setData(NULL);
|
this->setData(nullptr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
#ifndef TCPACKETSTORED_H_
|
#ifndef TMTCPACKET_PUS_TCPACKETSTORED_H_
|
||||||
#define TCPACKETSTORED_H_
|
#define TMTCPACKET_PUS_TCPACKETSTORED_H_
|
||||||
|
|
||||||
#include "../../storagemanager/StorageManagerIF.h"
|
|
||||||
#include "TcPacketBase.h"
|
#include "TcPacketBase.h"
|
||||||
|
#include "../../storagemanager/StorageManagerIF.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class generates a ECSS PUS Telecommand packet within a given
|
* This class generates a ECSS PUS Telecommand packet within a given
|
||||||
@ -15,26 +15,6 @@
|
|||||||
* @ingroup tmtcpackets
|
* @ingroup tmtcpackets
|
||||||
*/
|
*/
|
||||||
class TcPacketStored : public TcPacketBase {
|
class TcPacketStored : public TcPacketBase {
|
||||||
private:
|
|
||||||
/**
|
|
||||||
* This is a pointer to the store all instances of the class use.
|
|
||||||
* If the store is not yet set (i.e. \c store is NULL), every constructor
|
|
||||||
* call tries to set it and throws an error message in case of failures.
|
|
||||||
* The default store is objects::TC_STORE.
|
|
||||||
*/
|
|
||||||
static StorageManagerIF* store;
|
|
||||||
/**
|
|
||||||
* The address where the packet data of the object instance is stored.
|
|
||||||
*/
|
|
||||||
store_address_t storeAddress;
|
|
||||||
/**
|
|
||||||
* A helper method to check if a store is assigned to the class.
|
|
||||||
* If not, the method tries to retrieve the store from the global
|
|
||||||
* ObjectManager.
|
|
||||||
* @return @li \c true if the store is linked or could be created.
|
|
||||||
* @li \c false otherwise.
|
|
||||||
*/
|
|
||||||
bool checkAndSetStore();
|
|
||||||
public:
|
public:
|
||||||
/**
|
/**
|
||||||
* This is a default constructor which does not set the data pointer.
|
* This is a default constructor which does not set the data pointer.
|
||||||
@ -53,18 +33,20 @@ public:
|
|||||||
* a new PUS Telecommand Packet is created there.
|
* a new PUS Telecommand Packet is created there.
|
||||||
* Packet Application Data passed in data is copied into the packet.
|
* Packet Application Data passed in data is copied into the packet.
|
||||||
* @param apid Sets the packet's APID field.
|
* @param apid Sets the packet's APID field.
|
||||||
* @param ack Set's the packet's Ack field,
|
|
||||||
* which specifies number and size of verification packets returned
|
|
||||||
* for this command.
|
|
||||||
* @param service Sets the packet's Service ID field.
|
* @param service Sets the packet's Service ID field.
|
||||||
* This specifies the destination service.
|
* This specifies the destination service.
|
||||||
* @param subservice Sets the packet's Service Subtype field.
|
* @param subservice Sets the packet's Service Subtype field.
|
||||||
* This specifies the destination sub-service.
|
* This specifies the destination sub-service.
|
||||||
* @param sequence_count Sets the packet's Source Sequence Count field.
|
* @param sequence_count Sets the packet's Source Sequence Count field.
|
||||||
* @param data The data to be copied to the Application Data Field.
|
* @param data The data to be copied to the Application Data Field.
|
||||||
* @param size The amount of data to be copied.
|
* @param size The amount of data to be copied.
|
||||||
|
* @param ack Set's the packet's Ack field, which specifies
|
||||||
|
* number of verification packets returned
|
||||||
|
* for this command.
|
||||||
*/
|
*/
|
||||||
TcPacketStored( uint16_t apid, uint8_t ack, uint8_t service, uint8_t subservice, uint8_t sequence_count = 0, const uint8_t* data = NULL, uint32_t size = 0 );
|
TcPacketStored(uint16_t apid, uint8_t service, uint8_t subservice,
|
||||||
|
uint8_t sequence_count = 0, const uint8_t* data = nullptr,
|
||||||
|
size_t size = 0, uint8_t ack = TcPacketBase::ACK_ALL);
|
||||||
/**
|
/**
|
||||||
* Another constructor to create a TcPacket from a raw packet stream.
|
* Another constructor to create a TcPacket from a raw packet stream.
|
||||||
* Takes the data and adds it unchecked to the TcStore.
|
* Takes the data and adds it unchecked to the TcStore.
|
||||||
@ -72,10 +54,19 @@ public:
|
|||||||
* @param Size size of the packet.
|
* @param Size size of the packet.
|
||||||
*/
|
*/
|
||||||
TcPacketStored( const uint8_t* data, uint32_t size);
|
TcPacketStored( const uint8_t* data, uint32_t size);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Getter function for the raw data.
|
||||||
|
* @param dataPtr [out] Pointer to the data pointer to set
|
||||||
|
* @param dataSize [out] Address of size to set.
|
||||||
|
* @return -@c RETURN_OK if data was retrieved successfully.
|
||||||
|
*/
|
||||||
|
ReturnValue_t getData(const uint8_t ** dataPtr,
|
||||||
|
size_t* dataSize);
|
||||||
/**
|
/**
|
||||||
* This is a getter for the current store address of the packet.
|
* This is a getter for the current store address of the packet.
|
||||||
* @return The current store address. The (raw) value is \c StorageManagerIF::INVALID_ADDRESS if
|
* @return The current store address. The (raw) value is
|
||||||
* the packet is not linked.
|
* @c StorageManagerIF::INVALID_ADDRESS if the packet is not linked.
|
||||||
*/
|
*/
|
||||||
store_address_t getStoreAddress();
|
store_address_t getStoreAddress();
|
||||||
/**
|
/**
|
||||||
@ -99,7 +90,28 @@ public:
|
|||||||
* store or size is incorrect.
|
* store or size is incorrect.
|
||||||
*/
|
*/
|
||||||
bool isSizeCorrect();
|
bool isSizeCorrect();
|
||||||
|
|
||||||
|
private:
|
||||||
|
/**
|
||||||
|
* This is a pointer to the store all instances of the class use.
|
||||||
|
* If the store is not yet set (i.e. @c store is NULL), every constructor
|
||||||
|
* call tries to set it and throws an error message in case of failures.
|
||||||
|
* The default store is objects::TC_STORE.
|
||||||
|
*/
|
||||||
|
static StorageManagerIF* store;
|
||||||
|
/**
|
||||||
|
* The address where the packet data of the object instance is stored.
|
||||||
|
*/
|
||||||
|
store_address_t storeAddress;
|
||||||
|
/**
|
||||||
|
* A helper method to check if a store is assigned to the class.
|
||||||
|
* If not, the method tries to retrieve the store from the global
|
||||||
|
* ObjectManager.
|
||||||
|
* @return @li @c true if the store is linked or could be created.
|
||||||
|
* @li @c false otherwise.
|
||||||
|
*/
|
||||||
|
bool checkAndSetStore();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
#endif /* TCPACKETSTORED_H_ */
|
#endif /* TMTCPACKET_PUS_TCPACKETSTORED_H_ */
|
||||||
|
@ -1,13 +1,19 @@
|
|||||||
|
#include "TmPacketBase.h"
|
||||||
|
|
||||||
#include "../../globalfunctions/CRC.h"
|
#include "../../globalfunctions/CRC.h"
|
||||||
|
#include "../../globalfunctions/arrayprinter.h"
|
||||||
#include "../../objectmanager/ObjectManagerIF.h"
|
#include "../../objectmanager/ObjectManagerIF.h"
|
||||||
#include "../../serviceinterface/ServiceInterfaceStream.h"
|
#include "../../serviceinterface/ServiceInterfaceStream.h"
|
||||||
#include "TmPacketBase.h"
|
|
||||||
#include "../../timemanager/CCSDSTime.h"
|
#include "../../timemanager/CCSDSTime.h"
|
||||||
#include <string.h>
|
|
||||||
|
|
||||||
TmPacketBase::TmPacketBase(uint8_t* set_data) :
|
#include <cstring>
|
||||||
SpacePacketBase(set_data) {
|
|
||||||
tm_data = (TmPacketPointer*) set_data;
|
TimeStamperIF* TmPacketBase::timeStamper = nullptr;
|
||||||
|
object_id_t TmPacketBase::timeStamperId = 0;
|
||||||
|
|
||||||
|
TmPacketBase::TmPacketBase(uint8_t* setData) :
|
||||||
|
SpacePacketBase(setData) {
|
||||||
|
tmData = reinterpret_cast<TmPacketPointer*>(setData);
|
||||||
}
|
}
|
||||||
|
|
||||||
TmPacketBase::~TmPacketBase() {
|
TmPacketBase::~TmPacketBase() {
|
||||||
@ -15,25 +21,25 @@ TmPacketBase::~TmPacketBase() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
uint8_t TmPacketBase::getService() {
|
uint8_t TmPacketBase::getService() {
|
||||||
return tm_data->data_field.service_type;
|
return tmData->data_field.service_type;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t TmPacketBase::getSubService() {
|
uint8_t TmPacketBase::getSubService() {
|
||||||
return tm_data->data_field.service_subtype;
|
return tmData->data_field.service_subtype;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t* TmPacketBase::getSourceData() {
|
uint8_t* TmPacketBase::getSourceData() {
|
||||||
return &tm_data->data;
|
return &tmData->data;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint16_t TmPacketBase::getSourceDataSize() {
|
uint16_t TmPacketBase::getSourceDataSize() {
|
||||||
return getPacketDataLength() - sizeof(tm_data->data_field)
|
return getPacketDataLength() - sizeof(tmData->data_field)
|
||||||
- CRC_SIZE + 1;
|
- CRC_SIZE + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint16_t TmPacketBase::getErrorControl() {
|
uint16_t TmPacketBase::getErrorControl() {
|
||||||
uint32_t size = getSourceDataSize() + CRC_SIZE;
|
uint32_t size = getSourceDataSize() + CRC_SIZE;
|
||||||
uint8_t* p_to_buffer = &tm_data->data;
|
uint8_t* p_to_buffer = &tmData->data;
|
||||||
return (p_to_buffer[size - 2] << 8) + p_to_buffer[size - 1];
|
return (p_to_buffer[size - 2] << 8) + p_to_buffer[size - 1];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -47,16 +53,12 @@ void TmPacketBase::setErrorControl() {
|
|||||||
|
|
||||||
void TmPacketBase::setData(const uint8_t* p_Data) {
|
void TmPacketBase::setData(const uint8_t* p_Data) {
|
||||||
SpacePacketBase::setData(p_Data);
|
SpacePacketBase::setData(p_Data);
|
||||||
tm_data = (TmPacketPointer*) p_Data;
|
tmData = (TmPacketPointer*) p_Data;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TmPacketBase::print() {
|
void TmPacketBase::print() {
|
||||||
/*uint8_t * wholeData = getWholeData();
|
sif::debug << "TmPacketBase::print: " << std::endl;
|
||||||
debug << "TmPacket contains: " << std::endl;
|
arrayprinter::print(getWholeData(), getFullSize());
|
||||||
for (uint8_t count = 0; count < getFullSize(); ++count ) {
|
|
||||||
debug << std::hex << (uint16_t)wholeData[count] << " ";
|
|
||||||
}
|
|
||||||
debug << std::dec << std::endl;*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TmPacketBase::checkAndSetStamper() {
|
bool TmPacketBase::checkAndSetStamper() {
|
||||||
@ -73,32 +75,36 @@ bool TmPacketBase::checkAndSetStamper() {
|
|||||||
|
|
||||||
ReturnValue_t TmPacketBase::getPacketTime(timeval* timestamp) const {
|
ReturnValue_t TmPacketBase::getPacketTime(timeval* timestamp) const {
|
||||||
uint32_t tempSize = 0;
|
uint32_t tempSize = 0;
|
||||||
return CCSDSTime::convertFromCcsds(timestamp, tm_data->data_field.time,
|
return CCSDSTime::convertFromCcsds(timestamp, tmData->data_field.time,
|
||||||
&tempSize, sizeof(tm_data->data_field.time));
|
&tempSize, sizeof(tmData->data_field.time));
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t* TmPacketBase::getPacketTimeRaw() const{
|
uint8_t* TmPacketBase::getPacketTimeRaw() const{
|
||||||
return tm_data->data_field.time;
|
return tmData->data_field.time;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void TmPacketBase::initializeTmPacket(uint16_t apid, uint8_t service, uint8_t subservice, uint8_t packetSubcounter) {
|
void TmPacketBase::initializeTmPacket(uint16_t apid, uint8_t service,
|
||||||
|
uint8_t subservice, uint8_t packetSubcounter) {
|
||||||
//Set primary header:
|
//Set primary header:
|
||||||
initSpacePacketHeader(false, true, apid);
|
initSpacePacketHeader(false, true, apid);
|
||||||
//Set data Field Header:
|
//Set data Field Header:
|
||||||
//First, set to zero.
|
//First, set to zero.
|
||||||
memset(&tm_data->data_field, 0, sizeof(tm_data->data_field));
|
memset(&tmData->data_field, 0, sizeof(tmData->data_field));
|
||||||
//Set CCSDS_secondary header flag to 0, version number to 001 and ack to 0000
|
|
||||||
// NOTE: In PUS-C, the PUS Version is 2 and specified for the first 4 bits.
|
// NOTE: In PUS-C, the PUS Version is 2 and specified for the first 4 bits.
|
||||||
// The other 4 bits of the first byte are the spacecraft time reference status
|
// The other 4 bits of the first byte are the spacecraft time reference
|
||||||
// To change to PUS-C, set 0b00100000
|
// status. To change to PUS-C, set 0b00100000.
|
||||||
tm_data->data_field.version_type_ack = 0b00010000;
|
// Set CCSDS_secondary header flag to 0, version number to 001 and ack
|
||||||
tm_data->data_field.service_type = service;
|
// to 0000
|
||||||
tm_data->data_field.service_subtype = subservice;
|
tmData->data_field.version_type_ack = 0b00010000;
|
||||||
tm_data->data_field.subcounter = packetSubcounter;
|
tmData->data_field.service_type = service;
|
||||||
|
tmData->data_field.service_subtype = subservice;
|
||||||
|
tmData->data_field.subcounter = packetSubcounter;
|
||||||
//Timestamp packet
|
//Timestamp packet
|
||||||
if (checkAndSetStamper()) {
|
if (checkAndSetStamper()) {
|
||||||
timeStamper->addTimeStamp(tm_data->data_field.time, sizeof(tm_data->data_field.time));
|
timeStamper->addTimeStamp(tmData->data_field.time,
|
||||||
|
sizeof(tmData->data_field.time));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -106,9 +112,6 @@ void TmPacketBase::setSourceDataSize(uint16_t size) {
|
|||||||
setPacketDataLength(size + sizeof(PUSTmDataFieldHeader) + CRC_SIZE - 1);
|
setPacketDataLength(size + sizeof(PUSTmDataFieldHeader) + CRC_SIZE - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t TmPacketBase::getTimestampSize() const {
|
size_t TmPacketBase::getTimestampSize() const {
|
||||||
return sizeof(tm_data->data_field.time);
|
return sizeof(tmData->data_field.time);
|
||||||
}
|
}
|
||||||
|
|
||||||
TimeStamperIF* TmPacketBase::timeStamper = NULL;
|
|
||||||
object_id_t TmPacketBase::timeStamperId = 0;
|
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
#ifndef TMPACKETBASE_H_
|
#ifndef TMTCPACKET_PUS_TMPACKETBASE_H_
|
||||||
#define TMPACKETBASE_H_
|
#define TMTCPACKET_PUS_TMPACKETBASE_H_
|
||||||
|
|
||||||
|
#include "../SpacePacketBase.h"
|
||||||
#include "../../timemanager/TimeStamperIF.h"
|
#include "../../timemanager/TimeStamperIF.h"
|
||||||
#include "../../tmtcpacket/SpacePacketBase.h"
|
|
||||||
#include "../../timemanager/Clock.h"
|
#include "../../timemanager/Clock.h"
|
||||||
#include "../../objectmanager/SystemObjectIF.h"
|
#include "../../objectmanager/SystemObjectIF.h"
|
||||||
|
|
||||||
@ -14,7 +14,7 @@ void setStaticFrameworkObjectIds();
|
|||||||
* This struct defines a byte-wise structured PUS TM Data Field Header.
|
* This struct defines a byte-wise structured PUS TM Data Field Header.
|
||||||
* Any optional fields in the header must be added or removed here.
|
* Any optional fields in the header must be added or removed here.
|
||||||
* Currently, no Destination field is present, but an eigth-byte representation
|
* Currently, no Destination field is present, but an eigth-byte representation
|
||||||
* for a time tag [TBD].
|
* for a time tag.
|
||||||
* @ingroup tmtcpackets
|
* @ingroup tmtcpackets
|
||||||
*/
|
*/
|
||||||
struct PUSTmDataFieldHeader {
|
struct PUSTmDataFieldHeader {
|
||||||
@ -40,7 +40,7 @@ struct TmPacketPointer {
|
|||||||
/**
|
/**
|
||||||
* This class is the basic data handler for any ECSS PUS Telemetry packet.
|
* This class is the basic data handler for any ECSS PUS Telemetry packet.
|
||||||
*
|
*
|
||||||
* In addition to \SpacePacketBase, the class provides methods to handle
|
* In addition to #SpacePacketBase, the class provides methods to handle
|
||||||
* the standardized entries of the PUS TM Packet Data Field Header.
|
* the standardized entries of the PUS TM Packet Data Field Header.
|
||||||
* It does not contain the packet data itself but a pointer to the
|
* It does not contain the packet data itself but a pointer to the
|
||||||
* data must be set on instantiation. An invalid pointer may cause
|
* data must be set on instantiation. An invalid pointer may cause
|
||||||
@ -54,29 +54,27 @@ public:
|
|||||||
/**
|
/**
|
||||||
* This constant defines the minimum size of a valid PUS Telemetry Packet.
|
* This constant defines the minimum size of a valid PUS Telemetry Packet.
|
||||||
*/
|
*/
|
||||||
static const uint32_t TM_PACKET_MIN_SIZE = (sizeof(CCSDSPrimaryHeader) + sizeof(PUSTmDataFieldHeader) + 2); //!< Minimum size of a valid PUS Telemetry Packet.
|
static const uint32_t TM_PACKET_MIN_SIZE = (sizeof(CCSDSPrimaryHeader) +
|
||||||
static const uint32_t MISSION_TM_PACKET_MAX_SIZE = 2048; //!< Maximum size of a TM Packet in this mission.
|
sizeof(PUSTmDataFieldHeader) + 2);
|
||||||
static const uint8_t VERSION_NUMBER_BYTE_PUS_A = 0b00010000; //!< First byte of secondary header for PUS-A packets.
|
//! Maximum size of a TM Packet in this mission.
|
||||||
|
//! TODO: Make this dependant on a config variable.
|
||||||
|
static const uint32_t MISSION_TM_PACKET_MAX_SIZE = 2048;
|
||||||
|
//! First byte of secondary header for PUS-A packets.
|
||||||
|
//! TODO: Maybe also support PUS-C via config?
|
||||||
|
static const uint8_t VERSION_NUMBER_BYTE_PUS_A = 0b00010000;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This is the default constructor.
|
* This is the default constructor.
|
||||||
* It sets its internal data pointer to the address passed and also
|
* It sets its internal data pointer to the address passed and also
|
||||||
* forwards the data pointer to the parent SpacePacketBase class.
|
* forwards the data pointer to the parent SpacePacketBase class.
|
||||||
* @param set_address The position where the packet data lies.
|
* @param set_address The position where the packet data lies.
|
||||||
*/
|
*/
|
||||||
TmPacketBase( uint8_t* set_data );
|
TmPacketBase( uint8_t* setData );
|
||||||
/**
|
/**
|
||||||
* This is the empty default destructor.
|
* This is the empty default destructor.
|
||||||
*/
|
*/
|
||||||
virtual ~TmPacketBase();
|
virtual ~TmPacketBase();
|
||||||
/**
|
|
||||||
* Initializes the Tm Packet header.
|
|
||||||
* Does set the timestamp (to now), but not the error control field.
|
|
||||||
* @param apid APID used.
|
|
||||||
* @param service PUS Service
|
|
||||||
* @param subservice PUS Subservice
|
|
||||||
* @param packetSubcounter Additional subcounter used.
|
|
||||||
*/
|
|
||||||
void initializeTmPacket(uint16_t apid, uint8_t service, uint8_t subservice, uint8_t packetSubcounter);
|
|
||||||
/**
|
/**
|
||||||
* This is a getter for the packet's PUS Service ID, which is the second
|
* This is a getter for the packet's PUS Service ID, which is the second
|
||||||
* byte of the Data Field Header.
|
* byte of the Data Field Header.
|
||||||
@ -106,11 +104,14 @@ public:
|
|||||||
*/
|
*/
|
||||||
uint16_t getSourceDataSize();
|
uint16_t getSourceDataSize();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* In case data was filled manually (almost never the case).
|
* With this method, the Error Control Field is updated to match the
|
||||||
* @param size Size of source data (without CRC and data filed header!).
|
* current content of the packet. This method is not protected because
|
||||||
*/
|
* a recalculation by the user might be necessary when manipulating fields
|
||||||
void setSourceDataSize(uint16_t size);
|
* like the sequence count.
|
||||||
|
*/
|
||||||
|
void setErrorControl();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This getter returns the Error Control Field of the packet.
|
* This getter returns the Error Control Field of the packet.
|
||||||
*
|
*
|
||||||
@ -120,28 +121,15 @@ public:
|
|||||||
* @return The PUS Error Control
|
* @return The PUS Error Control
|
||||||
*/
|
*/
|
||||||
uint16_t getErrorControl();
|
uint16_t getErrorControl();
|
||||||
/**
|
|
||||||
* With this method, the Error Control Field is updated to match the
|
|
||||||
* current content of the packet.
|
|
||||||
*/
|
|
||||||
void setErrorControl();
|
|
||||||
/**
|
|
||||||
* With this method, the packet data pointer can be redirected to another
|
|
||||||
* location.
|
|
||||||
*
|
|
||||||
* This call overwrites the parent's setData method to set both its
|
|
||||||
* \c tc_data pointer and the parent's \c data pointer.
|
|
||||||
*
|
|
||||||
* @param p_data A pointer to another PUS Telemetry Packet.
|
|
||||||
*/
|
|
||||||
void setData( const uint8_t* p_Data );
|
|
||||||
/**
|
/**
|
||||||
* This is a debugging helper method that prints the whole packet content
|
* This is a debugging helper method that prints the whole packet content
|
||||||
* to the screen.
|
* to the screen.
|
||||||
*/
|
*/
|
||||||
void print();
|
void print();
|
||||||
/**
|
/**
|
||||||
* Interprets the "time"-field in the secondary header and returns it in timeval format.
|
* Interprets the "time"-field in the secondary header and returns it in
|
||||||
|
* timeval format.
|
||||||
* @return Converted timestamp of packet.
|
* @return Converted timestamp of packet.
|
||||||
*/
|
*/
|
||||||
ReturnValue_t getPacketTime(timeval* timestamp) const;
|
ReturnValue_t getPacketTime(timeval* timestamp) const;
|
||||||
@ -151,7 +139,7 @@ public:
|
|||||||
*/
|
*/
|
||||||
uint8_t* getPacketTimeRaw() const;
|
uint8_t* getPacketTimeRaw() const;
|
||||||
|
|
||||||
uint32_t getTimestampSize() const;
|
size_t getTimestampSize() const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
/**
|
/**
|
||||||
@ -160,20 +148,49 @@ protected:
|
|||||||
*
|
*
|
||||||
* To be hardware-safe, all elements are of byte size.
|
* To be hardware-safe, all elements are of byte size.
|
||||||
*/
|
*/
|
||||||
TmPacketPointer* tm_data;
|
TmPacketPointer* tmData;
|
||||||
/**
|
/**
|
||||||
* The timeStamper is responsible for adding a timestamp to the packet.
|
* The timeStamper is responsible for adding a timestamp to the packet.
|
||||||
* It is initialized lazy.
|
* It is initialized lazy.
|
||||||
*/
|
*/
|
||||||
static TimeStamperIF* timeStamper;
|
static TimeStamperIF* timeStamper;
|
||||||
|
//! The ID to use when looking for a time stamper.
|
||||||
|
static object_id_t timeStamperId;
|
||||||
|
|
||||||
static object_id_t timeStamperId; //!< The ID to use when looking for a time stamper.
|
/**
|
||||||
/**
|
* Initializes the Tm Packet header.
|
||||||
* Checks if a time stamper is available and tries to set it if not.
|
* Does set the timestamp (to now), but not the error control field.
|
||||||
* @return Returns false if setting failed.
|
* @param apid APID used.
|
||||||
*/
|
* @param service PUS Service
|
||||||
bool checkAndSetStamper();
|
* @param subservice PUS Subservice
|
||||||
|
* @param packetSubcounter Additional subcounter used.
|
||||||
|
*/
|
||||||
|
void initializeTmPacket(uint16_t apid, uint8_t service, uint8_t subservice,
|
||||||
|
uint8_t packetSubcounter);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* With this method, the packet data pointer can be redirected to another
|
||||||
|
* location.
|
||||||
|
*
|
||||||
|
* This call overwrites the parent's setData method to set both its
|
||||||
|
* @c tc_data pointer and the parent's @c data pointer.
|
||||||
|
*
|
||||||
|
* @param p_data A pointer to another PUS Telemetry Packet.
|
||||||
|
*/
|
||||||
|
void setData( const uint8_t* pData );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* In case data was filled manually (almost never the case).
|
||||||
|
* @param size Size of source data (without CRC and data filed header!).
|
||||||
|
*/
|
||||||
|
void setSourceDataSize(uint16_t size);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks if a time stamper is available and tries to set it if not.
|
||||||
|
* @return Returns false if setting failed.
|
||||||
|
*/
|
||||||
|
bool checkAndSetStamper();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
#endif /* TMPACKETBASE_H_ */
|
#endif /* TMTCPACKET_PUS_TMPACKETBASE_H_ */
|
||||||
|
@ -1,11 +1,16 @@
|
|||||||
|
#include "TmPacketStored.h"
|
||||||
|
|
||||||
#include "../../objectmanager/ObjectManagerIF.h"
|
#include "../../objectmanager/ObjectManagerIF.h"
|
||||||
#include "../../serviceinterface/ServiceInterfaceStream.h"
|
#include "../../serviceinterface/ServiceInterfaceStream.h"
|
||||||
#include "TmPacketStored.h"
|
|
||||||
#include "../../tmtcservices/TmTcMessage.h"
|
#include "../../tmtcservices/TmTcMessage.h"
|
||||||
#include <string.h>
|
|
||||||
|
#include <cstring>
|
||||||
|
|
||||||
|
StorageManagerIF *TmPacketStored::store = nullptr;
|
||||||
|
InternalErrorReporterIF *TmPacketStored::internalErrorReporter = nullptr;
|
||||||
|
|
||||||
TmPacketStored::TmPacketStored(store_address_t setAddress) :
|
TmPacketStored::TmPacketStored(store_address_t setAddress) :
|
||||||
TmPacketBase(NULL), storeAddress(setAddress) {
|
TmPacketBase(nullptr), storeAddress(setAddress) {
|
||||||
setStoreAddress(storeAddress);
|
setStoreAddress(storeAddress);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -14,10 +19,10 @@ TmPacketStored::TmPacketStored(uint16_t apid, uint8_t service,
|
|||||||
uint32_t size, const uint8_t *headerData, uint32_t headerSize) :
|
uint32_t size, const uint8_t *headerData, uint32_t headerSize) :
|
||||||
TmPacketBase(NULL) {
|
TmPacketBase(NULL) {
|
||||||
storeAddress.raw = StorageManagerIF::INVALID_ADDRESS;
|
storeAddress.raw = StorageManagerIF::INVALID_ADDRESS;
|
||||||
if (!checkAndSetStore()) {
|
if (not checkAndSetStore()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
uint8_t *pData = NULL;
|
uint8_t *pData = nullptr;
|
||||||
ReturnValue_t returnValue = store->getFreeElement(&storeAddress,
|
ReturnValue_t returnValue = store->getFreeElement(&storeAddress,
|
||||||
(TmPacketBase::TM_PACKET_MIN_SIZE + size + headerSize), &pData);
|
(TmPacketBase::TM_PACKET_MIN_SIZE + size + headerSize), &pData);
|
||||||
|
|
||||||
@ -38,7 +43,7 @@ TmPacketStored::TmPacketStored(uint16_t apid, uint8_t service,
|
|||||||
SerializeIF *header) :
|
SerializeIF *header) :
|
||||||
TmPacketBase(NULL) {
|
TmPacketBase(NULL) {
|
||||||
storeAddress.raw = StorageManagerIF::INVALID_ADDRESS;
|
storeAddress.raw = StorageManagerIF::INVALID_ADDRESS;
|
||||||
if (!checkAndSetStore()) {
|
if (not checkAndSetStore()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
size_t sourceDataSize = 0;
|
size_t sourceDataSize = 0;
|
||||||
@ -77,29 +82,29 @@ store_address_t TmPacketStored::getStoreAddress() {
|
|||||||
void TmPacketStored::deletePacket() {
|
void TmPacketStored::deletePacket() {
|
||||||
store->deleteData(storeAddress);
|
store->deleteData(storeAddress);
|
||||||
storeAddress.raw = StorageManagerIF::INVALID_ADDRESS;
|
storeAddress.raw = StorageManagerIF::INVALID_ADDRESS;
|
||||||
setData(NULL);
|
setData(nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TmPacketStored::setStoreAddress(store_address_t setAddress) {
|
void TmPacketStored::setStoreAddress(store_address_t setAddress) {
|
||||||
storeAddress = setAddress;
|
storeAddress = setAddress;
|
||||||
const uint8_t* temp_data = NULL;
|
const uint8_t* tempData = nullptr;
|
||||||
size_t temp_size;
|
size_t tempSize;
|
||||||
if (!checkAndSetStore()) {
|
if (not checkAndSetStore()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
ReturnValue_t status = store->getData(storeAddress, &temp_data, &temp_size);
|
ReturnValue_t status = store->getData(storeAddress, &tempData, &tempSize);
|
||||||
if (status == StorageManagerIF::RETURN_OK) {
|
if (status == StorageManagerIF::RETURN_OK) {
|
||||||
setData(temp_data);
|
setData(tempData);
|
||||||
} else {
|
} else {
|
||||||
setData(NULL);
|
setData(nullptr);
|
||||||
storeAddress.raw = StorageManagerIF::INVALID_ADDRESS;
|
storeAddress.raw = StorageManagerIF::INVALID_ADDRESS;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TmPacketStored::checkAndSetStore() {
|
bool TmPacketStored::checkAndSetStore() {
|
||||||
if (store == NULL) {
|
if (store == nullptr) {
|
||||||
store = objectManager->get<StorageManagerIF>(objects::TM_STORE);
|
store = objectManager->get<StorageManagerIF>(objects::TM_STORE);
|
||||||
if (store == NULL) {
|
if (store == nullptr) {
|
||||||
sif::error << "TmPacketStored::TmPacketStored: TM Store not found!"
|
sif::error << "TmPacketStored::TmPacketStored: TM Store not found!"
|
||||||
<< std::endl;
|
<< std::endl;
|
||||||
return false;
|
return false;
|
||||||
@ -108,12 +113,9 @@ bool TmPacketStored::checkAndSetStore() {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
StorageManagerIF *TmPacketStored::store = NULL;
|
|
||||||
InternalErrorReporterIF *TmPacketStored::internalErrorReporter = NULL;
|
|
||||||
|
|
||||||
ReturnValue_t TmPacketStored::sendPacket(MessageQueueId_t destination,
|
ReturnValue_t TmPacketStored::sendPacket(MessageQueueId_t destination,
|
||||||
MessageQueueId_t sentFrom, bool doErrorReporting) {
|
MessageQueueId_t sentFrom, bool doErrorReporting) {
|
||||||
if (getWholeData() == NULL) {
|
if (getWholeData() == nullptr) {
|
||||||
//SHOULDDO: More decent code.
|
//SHOULDDO: More decent code.
|
||||||
return HasReturnvaluesIF::RETURN_FAILED;
|
return HasReturnvaluesIF::RETURN_FAILED;
|
||||||
}
|
}
|
||||||
@ -133,11 +135,11 @@ ReturnValue_t TmPacketStored::sendPacket(MessageQueueId_t destination,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void TmPacketStored::checkAndReportLostTm() {
|
void TmPacketStored::checkAndReportLostTm() {
|
||||||
if (internalErrorReporter == NULL) {
|
if (internalErrorReporter == nullptr) {
|
||||||
internalErrorReporter = objectManager->get<InternalErrorReporterIF>(
|
internalErrorReporter = objectManager->get<InternalErrorReporterIF>(
|
||||||
objects::INTERNAL_ERROR_REPORTER);
|
objects::INTERNAL_ERROR_REPORTER);
|
||||||
}
|
}
|
||||||
if (internalErrorReporter != NULL) {
|
if (internalErrorReporter != nullptr) {
|
||||||
internalErrorReporter->lostTm();
|
internalErrorReporter->lostTm();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,9 +1,10 @@
|
|||||||
#ifndef TMPACKETSTORED_H_
|
#ifndef TMTCPACKET_PUS_TMPACKETSTORED_H_
|
||||||
#define TMPACKETSTORED_H_
|
#define TMTCPACKET_PUS_TMPACKETSTORED_H_
|
||||||
|
|
||||||
|
#include "TmPacketBase.h"
|
||||||
|
|
||||||
#include "../../serialize/SerializeIF.h"
|
#include "../../serialize/SerializeIF.h"
|
||||||
#include "../../storagemanager/StorageManagerIF.h"
|
#include "../../storagemanager/StorageManagerIF.h"
|
||||||
#include "TmPacketBase.h"
|
|
||||||
#include "../../internalError/InternalErrorReporterIF.h"
|
#include "../../internalError/InternalErrorReporterIF.h"
|
||||||
#include "../../ipc/MessageQueueSenderIF.h"
|
#include "../../ipc/MessageQueueSenderIF.h"
|
||||||
|
|
||||||
@ -18,31 +19,6 @@
|
|||||||
* @ingroup tmtcpackets
|
* @ingroup tmtcpackets
|
||||||
*/
|
*/
|
||||||
class TmPacketStored : public TmPacketBase {
|
class TmPacketStored : public TmPacketBase {
|
||||||
private:
|
|
||||||
/**
|
|
||||||
* This is a pointer to the store all instances of the class use.
|
|
||||||
* If the store is not yet set (i.e. \c store is NULL), every constructor
|
|
||||||
* call tries to set it and throws an error message in case of failures.
|
|
||||||
* The default store is objects::TM_STORE.
|
|
||||||
*/
|
|
||||||
static StorageManagerIF* store;
|
|
||||||
|
|
||||||
static InternalErrorReporterIF *internalErrorReporter;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The address where the packet data of the object instance is stored.
|
|
||||||
*/
|
|
||||||
store_address_t storeAddress;
|
|
||||||
/**
|
|
||||||
* A helper method to check if a store is assigned to the class.
|
|
||||||
* If not, the method tries to retrieve the store from the global
|
|
||||||
* ObjectManager.
|
|
||||||
* @return @li \c true if the store is linked or could be created.
|
|
||||||
* @li \c false otherwise.
|
|
||||||
*/
|
|
||||||
bool checkAndSetStore();
|
|
||||||
|
|
||||||
void checkAndReportLostTm();
|
|
||||||
public:
|
public:
|
||||||
/**
|
/**
|
||||||
* This is a default constructor which does not set the data pointer.
|
* This is a default constructor which does not set the data pointer.
|
||||||
@ -52,28 +28,38 @@ public:
|
|||||||
/**
|
/**
|
||||||
* With this constructor, new space is allocated in the packet store and
|
* With this constructor, new space is allocated in the packet store and
|
||||||
* a new PUS Telemetry Packet is created there.
|
* a new PUS Telemetry Packet is created there.
|
||||||
* Packet Application Data passed in data is copied into the packet. The Application data is
|
* Packet Application Data passed in data is copied into the packet.
|
||||||
* passed in two parts, first a header, then a data field. This allows building a Telemetry
|
* The Application data is passed in two parts, first a header, then a
|
||||||
* Packet from two separate data sources.
|
* data field. This allows building a Telemetry Packet from two separate
|
||||||
|
* data sources.
|
||||||
* @param apid Sets the packet's APID field.
|
* @param apid Sets the packet's APID field.
|
||||||
* @param service Sets the packet's Service ID field.
|
* @param service Sets the packet's Service ID field.
|
||||||
* This specifies the source service.
|
* This specifies the source service.
|
||||||
* @param subservice Sets the packet's Service Subtype field.
|
* @param subservice Sets the packet's Service Subtype field.
|
||||||
* This specifies the source sub-service.
|
* This specifies the source sub-service.
|
||||||
* @param packet_counter Sets the Packet counter field of this packet
|
* @param packet_counter Sets the Packet counter field of this packet
|
||||||
* @param data The payload data to be copied to the Application Data Field
|
* @param data The payload data to be copied to the
|
||||||
|
* Application Data Field
|
||||||
* @param size The amount of data to be copied.
|
* @param size The amount of data to be copied.
|
||||||
* @param headerData The header Data of the Application field; will be copied in front of data
|
* @param headerData The header Data of the Application field,
|
||||||
|
* will be copied in front of data
|
||||||
* @param headerSize The size of the headerDataF
|
* @param headerSize The size of the headerDataF
|
||||||
*/
|
*/
|
||||||
TmPacketStored( uint16_t apid, uint8_t service, uint8_t subservice, uint8_t packet_counter = 0, const uint8_t* data = NULL, uint32_t size = 0, const uint8_t* headerData = NULL, uint32_t headerSize = 0);
|
TmPacketStored( uint16_t apid, uint8_t service, uint8_t subservice,
|
||||||
|
uint8_t packet_counter = 0, const uint8_t* data = nullptr,
|
||||||
|
uint32_t size = 0, const uint8_t* headerData = nullptr,
|
||||||
|
uint32_t headerSize = 0);
|
||||||
/**
|
/**
|
||||||
* Another ctor to directly pass structured content and header data to the packet to avoid additional buffers.
|
* Another ctor to directly pass structured content and header data to the
|
||||||
|
* packet to avoid additional buffers.
|
||||||
*/
|
*/
|
||||||
TmPacketStored( uint16_t apid, uint8_t service, uint8_t subservice, uint8_t packet_counter, SerializeIF* content, SerializeIF* header = NULL);
|
TmPacketStored( uint16_t apid, uint8_t service, uint8_t subservice,
|
||||||
|
uint8_t packet_counter, SerializeIF* content,
|
||||||
|
SerializeIF* header = nullptr);
|
||||||
/**
|
/**
|
||||||
* This is a getter for the current store address of the packet.
|
* This is a getter for the current store address of the packet.
|
||||||
* @return The current store address. The (raw) value is \c StorageManagerIF::INVALID_ADDRESS if
|
* @return The current store address. The (raw) value is
|
||||||
|
* @c StorageManagerIF::INVALID_ADDRESS if
|
||||||
* the packet is not linked.
|
* the packet is not linked.
|
||||||
*/
|
*/
|
||||||
store_address_t getStoreAddress();
|
store_address_t getStoreAddress();
|
||||||
@ -89,8 +75,34 @@ public:
|
|||||||
*/
|
*/
|
||||||
void setStoreAddress( store_address_t setAddress );
|
void setStoreAddress( store_address_t setAddress );
|
||||||
|
|
||||||
ReturnValue_t sendPacket( MessageQueueId_t destination, MessageQueueId_t sentFrom, bool doErrorReporting = true );
|
ReturnValue_t sendPacket( MessageQueueId_t destination,
|
||||||
|
MessageQueueId_t sentFrom, bool doErrorReporting = true );
|
||||||
|
private:
|
||||||
|
/**
|
||||||
|
* This is a pointer to the store all instances of the class use.
|
||||||
|
* If the store is not yet set (i.e. @c store is NULL), every constructor
|
||||||
|
* call tries to set it and throws an error message in case of failures.
|
||||||
|
* The default store is objects::TM_STORE.
|
||||||
|
*/
|
||||||
|
static StorageManagerIF* store;
|
||||||
|
|
||||||
|
static InternalErrorReporterIF *internalErrorReporter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The address where the packet data of the object instance is stored.
|
||||||
|
*/
|
||||||
|
store_address_t storeAddress;
|
||||||
|
/**
|
||||||
|
* A helper method to check if a store is assigned to the class.
|
||||||
|
* If not, the method tries to retrieve the store from the global
|
||||||
|
* ObjectManager.
|
||||||
|
* @return @li @c true if the store is linked or could be created.
|
||||||
|
* @li @c false otherwise.
|
||||||
|
*/
|
||||||
|
bool checkAndSetStore();
|
||||||
|
|
||||||
|
void checkAndReportLostTm();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
#endif /* TMPACKETSTORED_H_ */
|
#endif /* TMTCPACKET_PUS_TMPACKETSTORED_H_ */
|
||||||
|
59
unittest/README.md
Normal file
59
unittest/README.md
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
## FSFW Testing
|
||||||
|
This repository contains testing and unit testing components.
|
||||||
|
|
||||||
|
[Catch2](https://github.com/catchorg/Catch2) has been used as a framework,
|
||||||
|
and these unit tests can only be run on a linux host machine.
|
||||||
|
The makefile with default settings creates the unit test binary which can be
|
||||||
|
run in the terminal or in eclipse.
|
||||||
|
|
||||||
|
### Instructions
|
||||||
|
|
||||||
|
To run the fsfw unittests in the project, perform following steps:
|
||||||
|
|
||||||
|
1. Copy the testcfg folder the project root (folder containing the FSFW).
|
||||||
|
2. There is a makefile inside the testcfg folder which can be used to have
|
||||||
|
a starting point to compile the unit tests. Copy that Makefile to the project
|
||||||
|
root
|
||||||
|
3. Create a folder named catch2 (can have other name which requires Makefile
|
||||||
|
adaption) and copy the Catch2 header files there (NOTE: CMake support
|
||||||
|
not enabled yet!)
|
||||||
|
|
||||||
|
### Eclipse CDT settings
|
||||||
|
|
||||||
|
The default eclipse terminal has issues displaying the colors used
|
||||||
|
when running the unit test binary by catch2. To fix this issue,
|
||||||
|
install the ANSI Escape In Console package from the eclipse marketplace.
|
||||||
|
|
||||||
|
### GCOV integration
|
||||||
|
|
||||||
|
GCOV has been integrated as a code coverage tool.
|
||||||
|
It can be enabled by adding `GCOV=1` to the build process as an additional argument.
|
||||||
|
Coverage data will be provided in form of .gcno and .gcda files.
|
||||||
|
These can be displayed in eclipse by looking
|
||||||
|
for a .gcno or .gcda file in the \_obj folder, double-clicking it
|
||||||
|
and picking the right source-binary. This will generate
|
||||||
|
information about which lines of a file have run, provided it is open in
|
||||||
|
eclipse.
|
||||||
|
|
||||||
|
### LCOV integration
|
||||||
|
|
||||||
|
The files generated by GCOV can also be processed by the tool LCOV.
|
||||||
|
On ubuntu, the tool can be installed with the following command:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
sudo apt-get install lcov
|
||||||
|
````
|
||||||
|
|
||||||
|
After that, the tool can be run by building the unit tests with `GCOV=1`,
|
||||||
|
running them at least one time and then executing the `lcov.sh` script.
|
||||||
|
|
||||||
|
### Adding unit tests
|
||||||
|
|
||||||
|
The catch unit tests are located in unittest/testfw. To add new unit tests,
|
||||||
|
add them to the UnitTestCatch.cpp file or add a new source file which
|
||||||
|
includes catch.hpp.
|
||||||
|
|
||||||
|
For writing basics tests, the [assertion documentation](https://github.com/catchorg/Catch2/blob/master/docs/assertions.md#top)
|
||||||
|
or the existing examples are a good guideliens.
|
||||||
|
For more advanced tests, refer to the [catch2 documentation](https://github.com/catchorg/Catch2/blob/master/docs/Readme.md#top).
|
||||||
|
|
11
unittest/core/CatchDefinitions.cpp
Normal file
11
unittest/core/CatchDefinitions.cpp
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
#include "CatchDefinitions.h"
|
||||||
|
#include <fsfw/objectmanager/ObjectManagerIF.h>
|
||||||
|
|
||||||
|
StorageManagerIF* tglob::getIpcStoreHandle() {
|
||||||
|
if(objectManager != nullptr) {
|
||||||
|
return objectManager->get<StorageManagerIF>(objects::IPC_STORE);
|
||||||
|
} else {
|
||||||
|
sif::error << "Global object manager uninitialized" << std::endl;
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
}
|
21
unittest/core/CatchDefinitions.h
Normal file
21
unittest/core/CatchDefinitions.h
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
#ifndef FSFW_UNITTEST_CORE_CATCHDEFINITIONS_H_
|
||||||
|
#define FSFW_UNITTEST_CORE_CATCHDEFINITIONS_H_
|
||||||
|
|
||||||
|
#include <fsfw/ipc/messageQueueDefinitions.h>
|
||||||
|
#include <fsfw/returnvalues/HasReturnvaluesIF.h>
|
||||||
|
#include <fsfw/storagemanager/StorageManagerIF.h>
|
||||||
|
|
||||||
|
namespace retval {
|
||||||
|
static constexpr int CATCH_OK = static_cast<int>(HasReturnvaluesIF::RETURN_OK);
|
||||||
|
static constexpr int CATCH_FAILED = static_cast<int>(HasReturnvaluesIF::RETURN_FAILED);
|
||||||
|
}
|
||||||
|
|
||||||
|
namespace tconst {
|
||||||
|
static constexpr MessageQueueId_t testQueueId = 42;
|
||||||
|
}
|
||||||
|
|
||||||
|
namespace tglob {
|
||||||
|
StorageManagerIF* getIpcStoreHandle();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* FSFW_UNITTEST_CORE_CATCHDEFINITIONS_H_ */
|
31
unittest/core/CatchRunner.cpp
Normal file
31
unittest/core/CatchRunner.cpp
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
/**
|
||||||
|
* @file CatchSource.cpp
|
||||||
|
* @brief Source file to compile catch framework.
|
||||||
|
* @details All tests should be written in other files.
|
||||||
|
* For eclipse console output, install ANSI Escape in Console
|
||||||
|
* from the eclipse market place to get colored characters.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef NO_UNIT_TEST_FRAMEWORK
|
||||||
|
|
||||||
|
#define CATCH_CONFIG_RUNNER
|
||||||
|
#include <catch2/catch.hpp>
|
||||||
|
|
||||||
|
#if CUSTOM_UNITTEST_RUNNER == 0
|
||||||
|
|
||||||
|
extern int customSetup();
|
||||||
|
|
||||||
|
int main( int argc, char* argv[] ) {
|
||||||
|
customSetup();
|
||||||
|
|
||||||
|
// Catch internal function call
|
||||||
|
int result = Catch::Session().run( argc, argv );
|
||||||
|
|
||||||
|
// global clean-up
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
42
unittest/core/CatchSetup.cpp
Normal file
42
unittest/core/CatchSetup.cpp
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
#include "CatchDefinitions.h"
|
||||||
|
|
||||||
|
#include <testcfg/cdatapool/dataPoolInit.h>
|
||||||
|
#include <testcfg/objects/Factory.h>
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef GCOV
|
||||||
|
#include <gcov.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include "../../objectmanager/ObjectManager.h"
|
||||||
|
#include "../../objectmanager/ObjectManagerIF.h"
|
||||||
|
#include "../../storagemanager/StorageManagerIF.h"
|
||||||
|
#include "../../datapool/DataPool.h"
|
||||||
|
#include "../../serviceinterface/ServiceInterfaceStream.h"
|
||||||
|
|
||||||
|
|
||||||
|
/* Global instantiations normally done in main.cpp */
|
||||||
|
/* Initialize Data Pool */
|
||||||
|
//namespace glob {
|
||||||
|
DataPool dataPool(datapool::dataPoolInit);
|
||||||
|
//}
|
||||||
|
|
||||||
|
|
||||||
|
namespace sif {
|
||||||
|
/* Set up output streams */
|
||||||
|
ServiceInterfaceStream debug("DEBUG");
|
||||||
|
ServiceInterfaceStream info("INFO");
|
||||||
|
ServiceInterfaceStream error("ERROR");
|
||||||
|
ServiceInterfaceStream warning("WARNING");
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Global object manager */
|
||||||
|
ObjectManagerIF *objectManager;
|
||||||
|
|
||||||
|
int customSetup() {
|
||||||
|
// global setup
|
||||||
|
objectManager = new ObjectManager(Factory::produce);
|
||||||
|
objectManager -> initialize();
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
3
unittest/core/core.mk
Normal file
3
unittest/core/core.mk
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
CXXSRC += $(wildcard $(CURRENTPATH)/*.cpp)
|
||||||
|
|
||||||
|
INCLUDES += $(CURRENTPATH)
|
10
unittest/core/printChar.cpp
Normal file
10
unittest/core/printChar.cpp
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
#include <fsfw/unittest/core/printChar.h>
|
||||||
|
#include <cstdio>
|
||||||
|
|
||||||
|
void printChar(const char* character, bool errStream) {
|
||||||
|
if(errStream) {
|
||||||
|
std::putc(*character, stderr);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
std::putc(*character, stdout);
|
||||||
|
}
|
8
unittest/core/printChar.h
Normal file
8
unittest/core/printChar.h
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
#ifndef FSFW_UNITTEST_CORE_PRINTCHAR_H_
|
||||||
|
#define FSFW_UNITTEST_CORE_PRINTCHAR_H_
|
||||||
|
|
||||||
|
|
||||||
|
extern "C" void printChar(const char*, bool errStream);
|
||||||
|
|
||||||
|
|
||||||
|
#endif /* FSFW_UNITTEST_CORE_PRINTCHAR_H_ */
|
27
unittest/internal/InternalUnitTester.cpp
Normal file
27
unittest/internal/InternalUnitTester.cpp
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
#include "InternalUnitTester.h"
|
||||||
|
#include "UnittDefinitions.h"
|
||||||
|
|
||||||
|
#include "osal/IntTestMq.h"
|
||||||
|
#include "osal/IntTestSemaphore.h"
|
||||||
|
#include "osal/IntTestMutex.h"
|
||||||
|
#include "serialize/IntTestSerialization.h"
|
||||||
|
|
||||||
|
#include <cstdlib>
|
||||||
|
|
||||||
|
InternalUnitTester::InternalUnitTester() {}
|
||||||
|
|
||||||
|
InternalUnitTester::~InternalUnitTester() {}
|
||||||
|
|
||||||
|
ReturnValue_t InternalUnitTester::performTests() {
|
||||||
|
sif::info << "Running internal unit tests.." << std::endl;
|
||||||
|
testserialize::test_serialization();
|
||||||
|
testmq::testMq();
|
||||||
|
testsemaph::testBinSemaph();
|
||||||
|
testsemaph::testCountingSemaph();
|
||||||
|
testmutex::testMutex();
|
||||||
|
sif::info << "Internal unit tests finished." << std::endl;
|
||||||
|
return RETURN_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
29
unittest/internal/InternalUnitTester.h
Normal file
29
unittest/internal/InternalUnitTester.h
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
#ifndef FRAMEWORK_TEST_UNITTESTCLASS_H_
|
||||||
|
#define FRAMEWORK_TEST_UNITTESTCLASS_H_
|
||||||
|
|
||||||
|
#include "UnittDefinitions.h"
|
||||||
|
#include <fsfw/returnvalues/HasReturnvaluesIF.h>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Can be used for internal testing, for example for hardware specific
|
||||||
|
* tests which can not be run on a host-machine.
|
||||||
|
*
|
||||||
|
* TODO: A lot of ways to improve this class. A way for tests to subscribe
|
||||||
|
* in this central class would be nice. Right now, this is the class
|
||||||
|
* which simply calls all other tests from other files manually.
|
||||||
|
* Maybe there is a better way..
|
||||||
|
*/
|
||||||
|
class InternalUnitTester: public HasReturnvaluesIF {
|
||||||
|
public:
|
||||||
|
InternalUnitTester();
|
||||||
|
virtual~ InternalUnitTester();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Some function which calls all other tests
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
virtual ReturnValue_t performTests();
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
#endif /* FRAMEWORK_TEST_UNITTESTCLASS_H_ */
|
7
unittest/internal/UnittDefinitions.cpp
Normal file
7
unittest/internal/UnittDefinitions.cpp
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
#include <fsfw/unittest/internal/UnittDefinitions.h>
|
||||||
|
|
||||||
|
ReturnValue_t unitt::put_error(std::string errorId) {
|
||||||
|
sif::error << "Unit Tester error: Failed at test ID "
|
||||||
|
<< errorId << "\n" << std::flush;
|
||||||
|
return HasReturnvaluesIF::RETURN_FAILED;
|
||||||
|
}
|
33
unittest/internal/UnittDefinitions.h
Normal file
33
unittest/internal/UnittDefinitions.h
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
#ifndef UNITTEST_INTERNAL_UNITTDEFINITIONS_H_
|
||||||
|
#define UNITTEST_INTERNAL_UNITTDEFINITIONS_H_
|
||||||
|
|
||||||
|
#include "../../returnvalues/HasReturnvaluesIF.h"
|
||||||
|
#include "../../serviceinterface/ServiceInterfaceStream.h"
|
||||||
|
#include <cstdint>
|
||||||
|
#include <cstddef>
|
||||||
|
|
||||||
|
namespace tv {
|
||||||
|
// POD test values
|
||||||
|
static const bool tv_bool = true;
|
||||||
|
static const uint8_t tv_uint8 {5};
|
||||||
|
static const uint16_t tv_uint16 {283};
|
||||||
|
static const uint32_t tv_uint32 {929221};
|
||||||
|
static const uint64_t tv_uint64 {2929329429};
|
||||||
|
|
||||||
|
static const int8_t tv_int8 {-16};
|
||||||
|
static const int16_t tv_int16 {-829};
|
||||||
|
static const int32_t tv_int32 {-2312};
|
||||||
|
|
||||||
|
static const float tv_float {8.2149214};
|
||||||
|
static const float tv_sfloat = {-922.2321321};
|
||||||
|
static const double tv_double {9.2132142141e8};
|
||||||
|
static const double tv_sdouble {-2.2421e19};
|
||||||
|
}
|
||||||
|
|
||||||
|
namespace unitt {
|
||||||
|
ReturnValue_t put_error(std::string errorId);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#endif /* UNITTEST_INTERNAL_UNITTDEFINITIONS_H_ */
|
3
unittest/internal/internal.mk
Normal file
3
unittest/internal/internal.mk
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
CXXSRC += $(wildcard $(CURRENTPATH)/osal/*.cpp)
|
||||||
|
CXXSRC += $(wildcard $(CURRENTPATH)/serialize/*.cpp)
|
||||||
|
CXXSRC += $(wildcard $(CURRENTPATH)/*.cpp)
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user