Compare commits
9 Commits
fb2e480705
...
develop
Author | SHA1 | Date | |
---|---|---|---|
42867ad0cb | |||
6381d9a83c | |||
73bf1cc229
|
|||
222f02aefd | |||
e9b4fc9825 | |||
0660457c92
|
|||
7c9b9e4cd8
|
|||
3b0ee7ca31
|
|||
f307a86d9a
|
@@ -11,6 +11,7 @@ FreshDeviceHandlerBase::FreshDeviceHandlerBase(DhbConfig config)
|
|||||||
healthHelper(this, getObjectId()),
|
healthHelper(this, getObjectId()),
|
||||||
paramHelper(this),
|
paramHelper(this),
|
||||||
poolManager(this, nullptr),
|
poolManager(this, nullptr),
|
||||||
|
fdirInstance(config.fdirInstance),
|
||||||
defaultFdirParent(config.defaultFdirParent) {
|
defaultFdirParent(config.defaultFdirParent) {
|
||||||
auto mqArgs = MqArgs(config.objectId, static_cast<void*>(this));
|
auto mqArgs = MqArgs(config.objectId, static_cast<void*>(this));
|
||||||
messageQueue = QueueFactory::instance()->createMessageQueue(
|
messageQueue = QueueFactory::instance()->createMessageQueue(
|
||||||
@@ -30,6 +31,7 @@ FreshDeviceHandlerBase::~FreshDeviceHandlerBase() {
|
|||||||
ReturnValue_t FreshDeviceHandlerBase::performOperation(uint8_t opCode) {
|
ReturnValue_t FreshDeviceHandlerBase::performOperation(uint8_t opCode) {
|
||||||
performDeviceOperationPreQueueHandling(opCode);
|
performDeviceOperationPreQueueHandling(opCode);
|
||||||
handleQueue();
|
handleQueue();
|
||||||
|
fdirInstance->checkForFailures();
|
||||||
performDeviceOperation(opCode);
|
performDeviceOperation(opCode);
|
||||||
poolManager.performHkOperation();
|
poolManager.performHkOperation();
|
||||||
return returnvalue::OK;
|
return returnvalue::OK;
|
||||||
|
@@ -129,7 +129,7 @@ class FreshDeviceHandlerBase : public SystemObject,
|
|||||||
ReturnValue_t executeAction(ActionId_t actionId, MessageQueueId_t commandedBy,
|
ReturnValue_t executeAction(ActionId_t actionId, MessageQueueId_t commandedBy,
|
||||||
const uint8_t* data, size_t size) override = 0;
|
const uint8_t* data, size_t size) override = 0;
|
||||||
// Executable overrides.
|
// Executable overrides.
|
||||||
ReturnValue_t performOperation(uint8_t opCode) override;
|
virtual ReturnValue_t performOperation(uint8_t opCode) override;
|
||||||
ReturnValue_t initializeAfterTaskCreation() override;
|
ReturnValue_t initializeAfterTaskCreation() override;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -1,7 +1,6 @@
|
|||||||
#include "SpacePacketReader.h"
|
#include "SpacePacketReader.h"
|
||||||
|
|
||||||
#include "fsfw/serialize/SerializeIF.h"
|
#include "fsfw/serialize/SerializeIF.h"
|
||||||
#include "fsfw/serviceinterface/ServiceInterface.h"
|
|
||||||
|
|
||||||
SpacePacketReader::SpacePacketReader(const uint8_t* setAddress, size_t maxSize_) {
|
SpacePacketReader::SpacePacketReader(const uint8_t* setAddress, size_t maxSize_) {
|
||||||
setInternalFields(setAddress, maxSize_);
|
setInternalFields(setAddress, maxSize_);
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
#ifndef FSFW_TMTCSERVICES_SOURCESEQUENCECOUNTER_H_
|
#ifndef FSFW_TMTCSERVICES_SOURCESEQUENCECOUNTER_H_
|
||||||
#define FSFW_TMTCSERVICES_SOURCESEQUENCECOUNTER_H_
|
#define FSFW_TMTCSERVICES_SOURCESEQUENCECOUNTER_H_
|
||||||
|
|
||||||
#include "fsfw/tmtcpacket/ccsds/SpacePacketReader.h"
|
#include "fsfw/tmtcpacket/ccsds/defs.h"
|
||||||
|
|
||||||
class SourceSequenceCounter {
|
class SourceSequenceCounter {
|
||||||
private:
|
private:
|
||||||
@@ -9,6 +9,7 @@ class SourceSequenceCounter {
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
SourceSequenceCounter(uint16_t initialSequenceCount = 0) : sequenceCount(initialSequenceCount) {}
|
SourceSequenceCounter(uint16_t initialSequenceCount = 0) : sequenceCount(initialSequenceCount) {}
|
||||||
|
|
||||||
void increment() { sequenceCount = (sequenceCount + 1) % (ccsds::LIMIT_SEQUENCE_COUNT); }
|
void increment() { sequenceCount = (sequenceCount + 1) % (ccsds::LIMIT_SEQUENCE_COUNT); }
|
||||||
void decrement() { sequenceCount = (sequenceCount - 1) % (ccsds::LIMIT_SEQUENCE_COUNT); }
|
void decrement() { sequenceCount = (sequenceCount - 1) % (ccsds::LIMIT_SEQUENCE_COUNT); }
|
||||||
uint16_t get() const { return this->sequenceCount; }
|
uint16_t get() const { return this->sequenceCount; }
|
||||||
@@ -25,6 +26,7 @@ class SourceSequenceCounter {
|
|||||||
sequenceCount = newCount;
|
sequenceCount = newCount;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
void set(uint16_t sequenceCount) { this->sequenceCount = sequenceCount; }
|
||||||
|
|
||||||
operator uint16_t() { return this->get(); }
|
operator uint16_t() { return this->get(); }
|
||||||
};
|
};
|
||||||
|
@@ -110,7 +110,7 @@ void serial::setBaudrate(struct termios& options, UartBaudRate baud) {
|
|||||||
#endif // ! __APPLE__
|
#endif // ! __APPLE__
|
||||||
default:
|
default:
|
||||||
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
||||||
sif::warning << "UartComIF::configureBaudrate: Baudrate not supported" << std::endl;
|
sif::warning << "serial::configureBaudrate: Baudrate not supported" << std::endl;
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -155,12 +155,11 @@ int serial::readCountersAndErrors(int serialPort, serial_icounter_struct& icount
|
|||||||
}
|
}
|
||||||
|
|
||||||
void serial::setStopbits(struct termios& options, StopBits bits) {
|
void serial::setStopbits(struct termios& options, StopBits bits) {
|
||||||
|
// Regular case: One stop bit.
|
||||||
|
options.c_cflag &= ~CSTOPB;
|
||||||
if (bits == StopBits::TWO_STOP_BITS) {
|
if (bits == StopBits::TWO_STOP_BITS) {
|
||||||
// Use two stop bits
|
// Use two stop bits
|
||||||
options.c_cflag |= CSTOPB;
|
options.c_cflag |= CSTOPB;
|
||||||
} else {
|
|
||||||
// Clear stop field, only one stop bit used in communication
|
|
||||||
options.c_cflag &= ~CSTOPB;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -169,3 +168,4 @@ void serial::flushRxBuf(int fd) { tcflush(fd, TCIFLUSH); }
|
|||||||
void serial::flushTxBuf(int fd) { tcflush(fd, TCOFLUSH); }
|
void serial::flushTxBuf(int fd) { tcflush(fd, TCOFLUSH); }
|
||||||
|
|
||||||
void serial::flushTxRxBuf(int fd) { tcflush(fd, TCIOFLUSH); }
|
void serial::flushTxRxBuf(int fd) { tcflush(fd, TCIOFLUSH); }
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user