Compare commits
3 Commits
tmtcbridge
...
819a2bfac4
Author | SHA1 | Date | |
---|---|---|---|
819a2bfac4 | |||
096af44e39 | |||
56e8e5a8b3 |
@@ -1603,12 +1603,12 @@ void DeviceHandlerBase::disableCommandsAndReplies() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ReturnValue_t DeviceHandlerBase::finishAction(bool success, DeviceCommandId_t action,
|
ReturnValue_t DeviceHandlerBase::finishAction(bool success, DeviceCommandId_t action,
|
||||||
ReturnValue_t result) {
|
ReturnValue_t result) {
|
||||||
auto commandIter = deviceCommandMap.find(action);
|
auto commandIter = deviceCommandMap.find(action);
|
||||||
if (commandIter == deviceCommandMap.end()) {
|
if (commandIter == deviceCommandMap.end()) {
|
||||||
return MessageQueueIF::NO_QUEUE;
|
return MessageQueueIF::NO_QUEUE;
|
||||||
}
|
}
|
||||||
commandIter->second.isExecuting = false;
|
commandIter->second.isExecuting = false;
|
||||||
actionHelper.finish(success, commandIter->second.sendReplyTo, action, result);
|
actionHelper.finish(success, commandIter->second.sendReplyTo, action, result);
|
||||||
return returnvalue::OK;
|
return returnvalue::OK;
|
||||||
}
|
}
|
||||||
|
@@ -11,8 +11,7 @@ DleParser::DleParser(SimpleRingBuffer& decodeRingBuf, DleEncoder& decoder, BufPa
|
|||||||
: decodeRingBuf(decodeRingBuf),
|
: decodeRingBuf(decodeRingBuf),
|
||||||
decoder(decoder),
|
decoder(decoder),
|
||||||
encodedBuf(encodedBuf),
|
encodedBuf(encodedBuf),
|
||||||
decodedBuf(decodedBuf) {
|
decodedBuf(decodedBuf) {}
|
||||||
}
|
|
||||||
|
|
||||||
ReturnValue_t DleParser::passData(const uint8_t* data, size_t len) {
|
ReturnValue_t DleParser::passData(const uint8_t* data, size_t len) {
|
||||||
if (data == nullptr or len == 0) {
|
if (data == nullptr or len == 0) {
|
||||||
@@ -24,7 +23,7 @@ ReturnValue_t DleParser::passData(const uint8_t* data, size_t len) {
|
|||||||
ReturnValue_t DleParser::parseRingBuf(size_t& readSize) {
|
ReturnValue_t DleParser::parseRingBuf(size_t& readSize) {
|
||||||
ctx.setType(DleParser::ContextType::NONE);
|
ctx.setType(DleParser::ContextType::NONE);
|
||||||
size_t availableData = decodeRingBuf.getAvailableReadData();
|
size_t availableData = decodeRingBuf.getAvailableReadData();
|
||||||
if(availableData == 0) {
|
if (availableData == 0) {
|
||||||
return NO_PACKET_FOUND;
|
return NO_PACKET_FOUND;
|
||||||
}
|
}
|
||||||
if (availableData > encodedBuf.second) {
|
if (availableData > encodedBuf.second) {
|
||||||
@@ -106,7 +105,7 @@ void DleParser::defaultFoundPacketHandler(uint8_t* packet, size_t len, void* arg
|
|||||||
}
|
}
|
||||||
|
|
||||||
void DleParser::defaultErrorHandler() {
|
void DleParser::defaultErrorHandler() {
|
||||||
if(ctx.getType() != DleParser::ContextType::ERROR) {
|
if (ctx.getType() != DleParser::ContextType::ERROR) {
|
||||||
errorPrinter("No error");
|
errorPrinter("No error");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -126,7 +125,8 @@ void DleParser::defaultErrorHandler() {
|
|||||||
case (ErrorTypes::ENCODED_BUF_TOO_SMALL):
|
case (ErrorTypes::ENCODED_BUF_TOO_SMALL):
|
||||||
case (ErrorTypes::DECODING_BUF_TOO_SMALL): {
|
case (ErrorTypes::DECODING_BUF_TOO_SMALL): {
|
||||||
char opt[64];
|
char opt[64];
|
||||||
snprintf(opt, sizeof(opt), ": Too small for packet with length %zu", ctx.decodedPacket.second);
|
snprintf(opt, sizeof(opt), ": Too small for packet with length %zu",
|
||||||
|
ctx.decodedPacket.second);
|
||||||
if (ctx.error.first == ErrorTypes::ENCODED_BUF_TOO_SMALL) {
|
if (ctx.error.first == ErrorTypes::ENCODED_BUF_TOO_SMALL) {
|
||||||
errorPrinter("Encoded buf too small", opt);
|
errorPrinter("Encoded buf too small", opt);
|
||||||
} else {
|
} else {
|
||||||
@@ -168,10 +168,6 @@ ReturnValue_t DleParser::confirmBytesRead(size_t bytesRead) {
|
|||||||
return decodeRingBuf.deleteData(bytesRead);
|
return decodeRingBuf.deleteData(bytesRead);
|
||||||
}
|
}
|
||||||
|
|
||||||
const DleParser::Context& DleParser::getContext() {
|
const DleParser::Context& DleParser::getContext() { return ctx; }
|
||||||
return ctx;
|
|
||||||
}
|
|
||||||
|
|
||||||
void DleParser::reset() {
|
void DleParser::reset() { decodeRingBuf.clear(); }
|
||||||
decodeRingBuf.clear();
|
|
||||||
}
|
|
||||||
|
@@ -246,6 +246,11 @@ ReturnValue_t CCSDSTime::convertFromASCII(Clock::TimeOfDay_t* to, const uint8_t*
|
|||||||
return UNSUPPORTED_TIME_FORMAT;
|
return UNSUPPORTED_TIME_FORMAT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ReturnValue_t CCSDSTime::convertToASCII(int8_t* to, const Clock::TimeOfDay_t* from,
|
||||||
|
uint8_t length) {
|
||||||
|
return returnvalue::OK;
|
||||||
|
}
|
||||||
|
|
||||||
ReturnValue_t CCSDSTime::checkCcs(const uint8_t* time, uint8_t length) {
|
ReturnValue_t CCSDSTime::checkCcs(const uint8_t* time, uint8_t length) {
|
||||||
const Ccs_mseconds* time_struct = reinterpret_cast<const Ccs_mseconds*>(time);
|
const Ccs_mseconds* time_struct = reinterpret_cast<const Ccs_mseconds*>(time);
|
||||||
|
|
||||||
|
@@ -207,7 +207,7 @@ class CCSDSTime {
|
|||||||
|
|
||||||
static ReturnValue_t convertFromASCII(Clock::TimeOfDay_t *to, uint8_t const *from,
|
static ReturnValue_t convertFromASCII(Clock::TimeOfDay_t *to, uint8_t const *from,
|
||||||
uint8_t length);
|
uint8_t length);
|
||||||
|
static ReturnValue_t convertToASCII(int8_t *to, const Clock::TimeOfDay_t *from, uint8_t length);
|
||||||
static uint32_t subsecondsToMicroseconds(uint16_t subseconds);
|
static uint32_t subsecondsToMicroseconds(uint16_t subseconds);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@@ -6,47 +6,12 @@
|
|||||||
#include "fsfw/returnvalues/returnvalue.h"
|
#include "fsfw/returnvalues/returnvalue.h"
|
||||||
#include "tmStorageConf.h"
|
#include "tmStorageConf.h"
|
||||||
|
|
||||||
class TmPacketMinimal;
|
class PusTmReader;
|
||||||
class SpacePacketBase;
|
class SpacePacketReader;
|
||||||
class TmStoreBackendIF;
|
class TmStoreBackendIF;
|
||||||
|
|
||||||
class TmStoreFrontendIF {
|
class TmStoreFrontendIF {
|
||||||
public:
|
public:
|
||||||
virtual TmStoreBackendIF* getBackend() const = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* What do I need to implement here?
|
|
||||||
* This is propably used by PUS Service 15 so we should propably check for messages..
|
|
||||||
* Provide base implementation?
|
|
||||||
* @param opCode
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
virtual ReturnValue_t performOperation(uint8_t opCode) = 0;
|
|
||||||
/**
|
|
||||||
* Callback from the back-end to indicate a certain packet was received.
|
|
||||||
* front-end takes care of discarding/downloading the packet.
|
|
||||||
* @param packet Pointer to the newly received Space Packet.
|
|
||||||
* @param address Start address of the packet found
|
|
||||||
* @param isLastPacket Indicates if no more packets can be fetched.
|
|
||||||
* @return If more packets shall be fetched, returnvalue::OK must be returned.
|
|
||||||
* Any other code stops fetching packets.
|
|
||||||
*/
|
|
||||||
virtual ReturnValue_t packetRetrieved(TmPacketMinimal* packet, uint32_t address) = 0;
|
|
||||||
virtual void noMorePacketsInStore() = 0;
|
|
||||||
virtual void handleRetrievalFailed(ReturnValue_t errorCode, uint32_t parameter1 = 0,
|
|
||||||
uint32_t parameter2 = 0) = 0;
|
|
||||||
/**
|
|
||||||
* To get the queue where commands shall be sent.
|
|
||||||
* @return Id of command queue.
|
|
||||||
*/
|
|
||||||
virtual MessageQueueId_t getCommandQueue() const = 0;
|
|
||||||
virtual ReturnValue_t fetchPackets(ApidSsc start, ApidSsc end) = 0;
|
|
||||||
virtual ReturnValue_t deletePackets(ApidSsc upTo) = 0;
|
|
||||||
virtual ReturnValue_t checkPacket(SpacePacketBase* tmPacket) = 0;
|
|
||||||
virtual bool isEnabled() const = 0;
|
|
||||||
virtual void setEnabled(bool enabled) = 0;
|
|
||||||
virtual void resetDownlinkedPacketCount() = 0;
|
|
||||||
virtual ReturnValue_t setDumpTarget(object_id_t dumpTarget) = 0;
|
|
||||||
static const uint8_t INTERFACE_ID = CLASS_ID::TM_STORE_FRONTEND_IF;
|
static const uint8_t INTERFACE_ID = CLASS_ID::TM_STORE_FRONTEND_IF;
|
||||||
static const ReturnValue_t BUSY = MAKE_RETURN_CODE(1);
|
static const ReturnValue_t BUSY = MAKE_RETURN_CODE(1);
|
||||||
static const ReturnValue_t LAST_PACKET_FOUND = MAKE_RETURN_CODE(2);
|
static const ReturnValue_t LAST_PACKET_FOUND = MAKE_RETURN_CODE(2);
|
||||||
@@ -57,7 +22,38 @@ class TmStoreFrontendIF {
|
|||||||
static const ReturnValue_t ALL_DELETED = MAKE_RETURN_CODE(7);
|
static const ReturnValue_t ALL_DELETED = MAKE_RETURN_CODE(7);
|
||||||
static const ReturnValue_t INVALID_DATA = MAKE_RETURN_CODE(8);
|
static const ReturnValue_t INVALID_DATA = MAKE_RETURN_CODE(8);
|
||||||
static const ReturnValue_t NOT_READY = MAKE_RETURN_CODE(9);
|
static const ReturnValue_t NOT_READY = MAKE_RETURN_CODE(9);
|
||||||
virtual ~TmStoreFrontendIF() {}
|
|
||||||
|
virtual ~TmStoreFrontendIF() = default;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* To get the queue where commands shall be sent.
|
||||||
|
* @return Id of command queue.
|
||||||
|
*/
|
||||||
|
virtual MessageQueueId_t getCommandQueue() const = 0;
|
||||||
|
|
||||||
|
virtual TmStoreBackendIF* getBackend() const = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Callback from the back-end to indicate a certain packet was received.
|
||||||
|
* front-end takes care of discarding/downloading the packet.
|
||||||
|
* @param packet Pointer to the newly received Space Packet.
|
||||||
|
* @param address Start address of the packet found
|
||||||
|
* @param isLastPacket Indicates if no more packets can be fetched.
|
||||||
|
* @return If more packets shall be fetched, returnvalue::OK must be returned.
|
||||||
|
* Any other code stops fetching packets.
|
||||||
|
*/
|
||||||
|
virtual ReturnValue_t packetRetrieved(PusTmReader* packet, uint32_t address) = 0;
|
||||||
|
virtual void noMorePacketsInStore() = 0;
|
||||||
|
virtual void handleRetrievalFailed(ReturnValue_t errorCode, uint32_t parameter1 = 0,
|
||||||
|
uint32_t parameter2 = 0) = 0;
|
||||||
|
|
||||||
|
virtual ReturnValue_t fetchPackets(ApidSsc start, ApidSsc end) = 0;
|
||||||
|
virtual ReturnValue_t deletePackets(ApidSsc upTo) = 0;
|
||||||
|
virtual ReturnValue_t checkPacket(SpacePacketReader* tmPacket) = 0;
|
||||||
|
virtual bool isEnabled() const = 0;
|
||||||
|
virtual void setEnabled(bool enabled) = 0;
|
||||||
|
virtual void resetDownlinkedPacketCount() = 0;
|
||||||
|
virtual ReturnValue_t setDumpTarget(object_id_t dumpTarget) = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* FSFW_TMTCSERVICES_TMSTOREFRONTENDIF_H_ */
|
#endif /* FSFW_TMTCSERVICES_TMSTOREFRONTENDIF_H_ */
|
||||||
|
14
src/fsfw/tmstorage/TmStoreFrontendSimpleIF.h
Normal file
14
src/fsfw/tmstorage/TmStoreFrontendSimpleIF.h
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
#ifndef FSFW_SRC_FSFW_TMSTORAGE_TMSTOREBACKENDSIMPLEIF_H_
|
||||||
|
#define FSFW_SRC_FSFW_TMSTORAGE_TMSTOREBACKENDSIMPLEIF_H_
|
||||||
|
|
||||||
|
#include <fsfw/ipc/messageQueueDefinitions.h>
|
||||||
|
|
||||||
|
class TmStoreFrontendSimpleIF {
|
||||||
|
public:
|
||||||
|
virtual ~TmStoreFrontendSimpleIF() = default;
|
||||||
|
|
||||||
|
private:
|
||||||
|
virtual MessageQueueId_t getCommandQueue() const = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif /* FSFW_SRC_FSFW_TMSTORAGE_TMSTOREBACKENDSIMPLEIF_H_ */
|
@@ -1,6 +1,10 @@
|
|||||||
#ifndef FSFW_TMSTORAGE_TMSTOREPACKETS_H_
|
#ifndef FSFW_TMSTORAGE_TMSTOREPACKETS_H_
|
||||||
#define FSFW_TMSTORAGE_TMSTOREPACKETS_H_
|
#define FSFW_TMSTORAGE_TMSTOREPACKETS_H_
|
||||||
|
|
||||||
|
#include <fsfw/tmtcpacket/pus/tm/PusTmReader.h>
|
||||||
|
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
#include "fsfw/globalfunctions/timevalOperations.h"
|
#include "fsfw/globalfunctions/timevalOperations.h"
|
||||||
#include "fsfw/serialize/SerialBufferAdapter.h"
|
#include "fsfw/serialize/SerialBufferAdapter.h"
|
||||||
#include "fsfw/serialize/SerialFixedArrayListAdapter.h"
|
#include "fsfw/serialize/SerialFixedArrayListAdapter.h"
|
||||||
@@ -24,7 +28,7 @@ class ServiceSubservice : public SerialLinkedListAdapter<SerializeIF> {
|
|||||||
|
|
||||||
class ApidSsc : public SerializeIF {
|
class ApidSsc : public SerializeIF {
|
||||||
public:
|
public:
|
||||||
ApidSsc() : apid(SpacePacketBase::LIMIT_APID), ssc(0) {}
|
ApidSsc() : apid(ccsds::LIMIT_APID), ssc(0) {}
|
||||||
ApidSsc(uint16_t apid, uint16_t ssc) : apid(apid), ssc(ssc) {}
|
ApidSsc(uint16_t apid, uint16_t ssc) : apid(apid), ssc(ssc) {}
|
||||||
uint16_t apid;
|
uint16_t apid;
|
||||||
uint16_t ssc;
|
uint16_t ssc;
|
||||||
@@ -62,51 +66,59 @@ class ChangeSelectionDefinition : public SerialLinkedListAdapter<SerializeIF> {
|
|||||||
|
|
||||||
class TmPacketInformation : public SerializeIF {
|
class TmPacketInformation : public SerializeIF {
|
||||||
public:
|
public:
|
||||||
TmPacketInformation(TmPacketMinimal* packet) { setContent(packet); }
|
TmPacketInformation(PusTmReader* packet, size_t timestampLen) : rawTimestamp(timestampLen) {
|
||||||
TmPacketInformation()
|
setContent(packet);
|
||||||
: apid(SpacePacketBase::LIMIT_APID),
|
}
|
||||||
|
TmPacketInformation(size_t timestampLen)
|
||||||
|
: apid(ccsds::LIMIT_APID),
|
||||||
sourceSequenceCount(0),
|
sourceSequenceCount(0),
|
||||||
serviceType(0),
|
serviceType(0),
|
||||||
serviceSubtype(0),
|
serviceSubtype(0),
|
||||||
subCounter(0) {}
|
subCounter(0),
|
||||||
|
rawTimestamp(timestampLen) {}
|
||||||
void reset() {
|
void reset() {
|
||||||
apid = SpacePacketBase::LIMIT_APID;
|
apid = ccsds::LIMIT_APID;
|
||||||
sourceSequenceCount = 0;
|
sourceSequenceCount = 0;
|
||||||
serviceType = 0;
|
serviceType = 0;
|
||||||
serviceSubtype = 0;
|
serviceSubtype = 0;
|
||||||
subCounter = 0;
|
subCounter = 0;
|
||||||
memset(rawTimestamp, 0, sizeof(rawTimestamp));
|
memset(rawTimestamp.data(), 0, rawTimestamp.size());
|
||||||
}
|
}
|
||||||
void setContent(TmPacketMinimal* packet) {
|
void setContent(PusTmReader* packet) {
|
||||||
apid = packet->getAPID();
|
apid = packet->getApid();
|
||||||
sourceSequenceCount = packet->getPacketSequenceCount();
|
sourceSequenceCount = packet->getSequenceCount();
|
||||||
serviceType = packet->getService();
|
serviceType = packet->getService();
|
||||||
serviceSubtype = packet->getSubService();
|
serviceSubtype = packet->getSubService();
|
||||||
subCounter = packet->getPacketSubcounter();
|
subCounter = packet->getMessageTypeCounter();
|
||||||
memset(rawTimestamp, 0, sizeof(rawTimestamp));
|
memset(rawTimestamp.data(), 0, rawTimestamp.size());
|
||||||
const uint8_t* pField = NULL;
|
// TODO: Fix all of this
|
||||||
uint32_t size = 0;
|
// const uint8_t* pField = NULL;
|
||||||
ReturnValue_t result = packet->getPacketTimeRaw(&pField, &size);
|
// uint32_t size = 0;
|
||||||
if (result != returnvalue::OK) {
|
// auto* timeReader = packet->getTimeReader();
|
||||||
return;
|
// ReturnValue_t result = packet->getPacketTimeRaw(&pField, &size);
|
||||||
}
|
// if (result != returnvalue::OK) {
|
||||||
if (*pField == CCSDSTime::P_FIELD_CDS_SHORT && size <= TimeStamperIF::MISSION_TIMESTAMP_SIZE) {
|
// return;
|
||||||
// Shortcut to avoid converting CDS back and forth.
|
//}
|
||||||
memcpy(rawTimestamp, pField, size);
|
// if (*pField == CCSDSTime::P_FIELD_CDS_SHORT && size <= TimeStamperIF::MISSION_TIMESTAMP_SIZE)
|
||||||
return;
|
// {
|
||||||
}
|
// Shortcut to avoid converting CDS back and forth.
|
||||||
timeval time = {0, 0};
|
// TODO: Fix
|
||||||
result = packet->getPacketTime(&time);
|
// memcpy(rawTimestamp, pField, size);
|
||||||
if (result != returnvalue::OK) {
|
// return;
|
||||||
return;
|
// }
|
||||||
}
|
// timeval time = {0, 0};
|
||||||
|
// result = packet->getPacketTime(&time);
|
||||||
CCSDSTime::CDS_short cdsFormat;
|
// if (result != returnvalue::OK) {
|
||||||
result = CCSDSTime::convertToCcsds(&cdsFormat, &time);
|
// return;
|
||||||
if (result != returnvalue::OK) {
|
// }
|
||||||
return;
|
//
|
||||||
}
|
// CCSDSTime::CDS_short cdsFormat;
|
||||||
memcpy(rawTimestamp, &cdsFormat, sizeof(cdsFormat));
|
// result = CCSDSTime::convertToCcsds(&cdsFormat, &time);
|
||||||
|
// if (result != returnvalue::OK) {
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
// TODO: Fix
|
||||||
|
// memcpy(rawTimestamp, &cdsFormat, sizeof(cdsFormat));
|
||||||
}
|
}
|
||||||
void setContent(TmPacketInformation* content) {
|
void setContent(TmPacketInformation* content) {
|
||||||
apid = content->apid;
|
apid = content->apid;
|
||||||
@@ -114,9 +126,10 @@ class TmPacketInformation : public SerializeIF {
|
|||||||
serviceType = content->serviceType;
|
serviceType = content->serviceType;
|
||||||
serviceSubtype = content->serviceSubtype;
|
serviceSubtype = content->serviceSubtype;
|
||||||
subCounter = content->subCounter;
|
subCounter = content->subCounter;
|
||||||
memcpy(rawTimestamp, content->rawTimestamp, sizeof(rawTimestamp));
|
// TODO: Fix
|
||||||
|
// memcpy(rawTimestamp, content->rawTimestamp, sizeof(rawTimestamp));
|
||||||
}
|
}
|
||||||
bool isValid() const { return (apid < SpacePacketBase::LIMIT_APID) ? true : false; }
|
bool isValid() const { return (apid < ccsds::LIMIT_APID) ? true : false; }
|
||||||
static void reset(TmPacketInformation* packet) { packet->reset(); }
|
static void reset(TmPacketInformation* packet) { packet->reset(); }
|
||||||
|
|
||||||
static bool isOlderThan(const TmPacketInformation* packet, const timeval* cmpTime) {
|
static bool isOlderThan(const TmPacketInformation* packet, const timeval* cmpTime) {
|
||||||
@@ -216,7 +229,7 @@ class TmPacketInformation : public SerializeIF {
|
|||||||
if (result != returnvalue::OK) {
|
if (result != returnvalue::OK) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
SerialBufferAdapter<uint8_t> adapter(rawTimestamp, sizeof(rawTimestamp));
|
SerialBufferAdapter<uint8_t> adapter(rawTimestamp.data(), rawTimestamp.size());
|
||||||
return adapter.serialize(buffer, size, maxSize, streamEndianness);
|
return adapter.serialize(buffer, size, maxSize, streamEndianness);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -227,7 +240,7 @@ class TmPacketInformation : public SerializeIF {
|
|||||||
size += SerializeAdapter::getSerializedSize(&serviceType);
|
size += SerializeAdapter::getSerializedSize(&serviceType);
|
||||||
size += SerializeAdapter::getSerializedSize(&serviceSubtype);
|
size += SerializeAdapter::getSerializedSize(&serviceSubtype);
|
||||||
size += SerializeAdapter::getSerializedSize(&subCounter);
|
size += SerializeAdapter::getSerializedSize(&subCounter);
|
||||||
SerialBufferAdapter<uint8_t> adapter(rawTimestamp, sizeof(rawTimestamp));
|
SerialBufferAdapter<uint8_t> adapter(rawTimestamp.data(), rawTimestamp.size());
|
||||||
size += adapter.getSerializedSize();
|
size += adapter.getSerializedSize();
|
||||||
return size;
|
return size;
|
||||||
};
|
};
|
||||||
@@ -253,7 +266,7 @@ class TmPacketInformation : public SerializeIF {
|
|||||||
if (result != returnvalue::OK) {
|
if (result != returnvalue::OK) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
SerialBufferAdapter<uint8_t> adapter(rawTimestamp, sizeof(rawTimestamp));
|
SerialBufferAdapter<uint8_t> adapter(rawTimestamp.data(), rawTimestamp.size());
|
||||||
return adapter.deSerialize(buffer, size, streamEndianness);
|
return adapter.deSerialize(buffer, size, streamEndianness);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -263,6 +276,6 @@ class TmPacketInformation : public SerializeIF {
|
|||||||
uint8_t serviceType;
|
uint8_t serviceType;
|
||||||
uint8_t serviceSubtype;
|
uint8_t serviceSubtype;
|
||||||
uint8_t subCounter;
|
uint8_t subCounter;
|
||||||
uint8_t rawTimestamp[TimeStamperIF::MISSION_TIMESTAMP_SIZE];
|
std::vector<uint8_t> rawTimestamp;
|
||||||
};
|
};
|
||||||
#endif /* FSFW_TMSTORAGE_TMSTOREPACKETS_H_ */
|
#endif /* FSFW_TMSTORAGE_TMSTOREPACKETS_H_ */
|
||||||
|
@@ -23,7 +23,9 @@ class AcceptsTelemetryIF {
|
|||||||
*/
|
*/
|
||||||
[[nodiscard]] virtual MessageQueueId_t getReportReceptionQueue(uint8_t virtualChannel) const = 0;
|
[[nodiscard]] virtual MessageQueueId_t getReportReceptionQueue(uint8_t virtualChannel) const = 0;
|
||||||
|
|
||||||
[[nodiscard]] virtual MessageQueueId_t getReportReceptionQueue() const { return getReportReceptionQueue(0); }
|
[[nodiscard]] virtual MessageQueueId_t getReportReceptionQueue() const {
|
||||||
|
return getReportReceptionQueue(0);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* FSFW_TMTCSERVICES_ACCEPTSTELEMETRYIF_H_ */
|
#endif /* FSFW_TMTCSERVICES_ACCEPTSTELEMETRYIF_H_ */
|
||||||
|
@@ -1,4 +1,5 @@
|
|||||||
#include "UartComIF.h"
|
#include "UartComIF.h"
|
||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <termios.h>
|
#include <termios.h>
|
||||||
@@ -458,5 +459,3 @@ ReturnValue_t UartComIF::flushUartTxAndRxBuf(CookieIF* cookie) {
|
|||||||
}
|
}
|
||||||
return returnvalue::FAILED;
|
return returnvalue::FAILED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -1,15 +1,14 @@
|
|||||||
#ifndef BSP_Q7S_COMIF_UARTCOMIF_H_
|
#ifndef BSP_Q7S_COMIF_UARTCOMIF_H_
|
||||||
#define BSP_Q7S_COMIF_UARTCOMIF_H_
|
#define BSP_Q7S_COMIF_UARTCOMIF_H_
|
||||||
|
|
||||||
#include "UartCookie.h"
|
|
||||||
#include "helper.h"
|
|
||||||
|
|
||||||
#include <fsfw/devicehandlers/DeviceCommunicationIF.h>
|
#include <fsfw/devicehandlers/DeviceCommunicationIF.h>
|
||||||
#include <fsfw/objectmanager/SystemObject.h>
|
#include <fsfw/objectmanager/SystemObject.h>
|
||||||
|
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
#include "UartCookie.h"
|
||||||
|
#include "helper.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief This is the communication interface to access serial ports on linux based operating
|
* @brief This is the communication interface to access serial ports on linux based operating
|
||||||
|
@@ -1,14 +1,12 @@
|
|||||||
#ifndef SAM9G20_COMIF_COOKIES_UART_COOKIE_H_
|
#ifndef SAM9G20_COMIF_COOKIES_UART_COOKIE_H_
|
||||||
#define SAM9G20_COMIF_COOKIES_UART_COOKIE_H_
|
#define SAM9G20_COMIF_COOKIES_UART_COOKIE_H_
|
||||||
|
|
||||||
#include "helper.h"
|
|
||||||
|
|
||||||
#include <fsfw/devicehandlers/CookieIF.h>
|
#include <fsfw/devicehandlers/CookieIF.h>
|
||||||
#include <fsfw/objectmanager/SystemObjectIF.h>
|
#include <fsfw/objectmanager/SystemObjectIF.h>
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
|
#include "helper.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Cookie for the UartComIF. There are many options available to configure the UART driver.
|
* @brief Cookie for the UartComIF. There are many options available to configure the UART driver.
|
||||||
|
@@ -1,8 +1,9 @@
|
|||||||
#include "helper.h"
|
#include "helper.h"
|
||||||
#include "fsfw/serviceinterface.h"
|
|
||||||
|
|
||||||
#include <sys/ioctl.h>
|
#include <sys/ioctl.h>
|
||||||
|
|
||||||
|
#include "fsfw/serviceinterface.h"
|
||||||
|
|
||||||
void uart::setMode(struct termios& options, UartModes mode) {
|
void uart::setMode(struct termios& options, UartModes mode) {
|
||||||
if (mode == UartModes::NON_CANONICAL) {
|
if (mode == UartModes::NON_CANONICAL) {
|
||||||
/* Disable canonical mode */
|
/* Disable canonical mode */
|
||||||
@@ -145,6 +146,5 @@ void uart::setBaudrate(struct termios& options, UartBaudRate baud) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int uart::readCountersAndErrors(int serialPort, serial_icounter_struct& icounter) {
|
int uart::readCountersAndErrors(int serialPort, serial_icounter_struct& icounter) {
|
||||||
return ioctl(serialPort, TIOCGICOUNT, &icounter);
|
return ioctl(serialPort, TIOCGICOUNT, &icounter);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,8 +1,8 @@
|
|||||||
#ifndef FSFW_HAL_LINUX_UART_HELPER_H_
|
#ifndef FSFW_HAL_LINUX_UART_HELPER_H_
|
||||||
#define FSFW_HAL_LINUX_UART_HELPER_H_
|
#define FSFW_HAL_LINUX_UART_HELPER_H_
|
||||||
|
|
||||||
#include <termios.h>
|
|
||||||
#include <linux/serial.h>
|
#include <linux/serial.h>
|
||||||
|
#include <termios.h>
|
||||||
|
|
||||||
enum class Parity { NONE, EVEN, ODD };
|
enum class Parity { NONE, EVEN, ODD };
|
||||||
|
|
||||||
@@ -56,7 +56,6 @@ void setBaudrate(struct termios& options, UartBaudRate baud);
|
|||||||
|
|
||||||
int readCountersAndErrors(int serialPort, serial_icounter_struct& icounter);
|
int readCountersAndErrors(int serialPort, serial_icounter_struct& icounter);
|
||||||
|
|
||||||
}
|
} // namespace uart
|
||||||
|
|
||||||
|
|
||||||
#endif /* FSFW_HAL_LINUX_UART_HELPER_H_ */
|
#endif /* FSFW_HAL_LINUX_UART_HELPER_H_ */
|
||||||
|
Reference in New Issue
Block a user