WIP: SCEX Init #288
2
fsfw
2
fsfw
@ -1 +1 @@
|
||||
Subproject commit bdddee4f81fbdff7f207fd03b3c592522e04c5aa
|
||||
Subproject commit 4e242aa9547dfc6d7abc0cdd405440547239016b
|
@ -290,9 +290,13 @@ int UartTestClass::prepareScexCmd(scex::ScexCmds cmd, bool tempCheck, uint8_t* c
|
||||
return 0;
|
||||
}
|
||||
|
||||
void UartTestClass::foundDlePacketHandler(uint8_t* packet, size_t len, void* args) {
|
||||
UartTestClass* obj = reinterpret_cast<UartTestClass*>(args);
|
||||
obj->handleFoundDlePacket(packet, len);
|
||||
void UartTestClass::foundDlePacketHandler(const DleParser::Context& ctx) {
|
||||
UartTestClass* obj = reinterpret_cast<UartTestClass*>(ctx.userArgs);
|
||||
if (ctx.getType() == DleParser::ContextType::PACKET_FOUND) {
|
||||
obj->handleFoundDlePacket(ctx.decodedPacket.first, ctx.decodedPacket.second);
|
||||
} else {
|
||||
DleParser::defaultErrorHandler(ctx.error.first, ctx.error.second);
|
||||
}
|
||||
}
|
||||
|
||||
void UartTestClass::handleFoundDlePacket(uint8_t* packet, size_t len) {
|
||||
|
@ -3,6 +3,7 @@
|
||||
|
||||
#include <fsfw/container/SimpleRingBuffer.h>
|
||||
#include <fsfw/globalfunctions/DleEncoder.h>
|
||||
#include <fsfw/globalfunctions/DleParser.h>
|
||||
#include <fsfw_hal/linux/uart/UartCookie.h>
|
||||
#include <termios.h> // Contains POSIX terminal control definitions
|
||||
|
||||
@ -42,7 +43,7 @@ class UartTestClass : public TestTask {
|
||||
void scexSimplePeriodic();
|
||||
void scexSimpleInit();
|
||||
|
||||
static void foundDlePacketHandler(uint8_t* packet, size_t len, void* args);
|
||||
static void foundDlePacketHandler(const DleParser::Context& ctx);
|
||||
void handleFoundDlePacket(uint8_t* packet, size_t len);
|
||||
|
||||
bool cmdSent = false;
|
||||
|
@ -1,6 +1,6 @@
|
||||
#include "ScexDleParser.h"
|
||||
|
||||
ScexDleParser::ScexDleParser(SimpleRingBuffer &decodeRingBuf, DleEncoder &decoder,
|
||||
BufPair encodedBuf, BufPair decodedBuf, FoundPacketHandler handler,
|
||||
BufPair encodedBuf, BufPair decodedBuf, UserHandler handler,
|
||||
void *args)
|
||||
: DleParser(decodeRingBuf, decoder, encodedBuf, decodedBuf, handler, args) {}
|
||||
|
@ -6,7 +6,7 @@
|
||||
class ScexDleParser : public DleParser {
|
||||
public:
|
||||
ScexDleParser(SimpleRingBuffer& decodeRingBuf, DleEncoder& decoder, BufPair encodedBuf,
|
||||
BufPair decodedBuf, FoundPacketHandler handler, void* args);
|
||||
BufPair decodedBuf, UserHandler handler, void* args);
|
||||
};
|
||||
|
||||
#endif /* LINUX_DEVICES_SCEXDLEPARSER_H_ */
|
||||
|
@ -162,9 +162,13 @@ ReturnValue_t ScexUartReader::finish() {
|
||||
return RETURN_OK;
|
||||
}
|
||||
|
||||
void ScexUartReader::foundDlePacketHandler(uint8_t *packet, size_t len, void *args) {
|
||||
ScexUartReader *obj = reinterpret_cast<ScexUartReader *>(args);
|
||||
obj->handleFoundDlePacket(packet, len);
|
||||
void ScexUartReader::foundDlePacketHandler(const DleParser::Context &ctx) {
|
||||
ScexUartReader *obj = reinterpret_cast<ScexUartReader *>(ctx.userArgs);
|
||||
if (ctx.getType() == DleParser::ContextType::PACKET_FOUND) {
|
||||
obj->handleFoundDlePacket(ctx.decodedPacket.first, ctx.decodedPacket.second);
|
||||
} else {
|
||||
DleParser::defaultErrorHandler(ctx.error.first, ctx.error.second);
|
||||
}
|
||||
}
|
||||
|
||||
void ScexUartReader::handleFoundDlePacket(uint8_t *packet, size_t len) {
|
||||
|
@ -47,7 +47,7 @@ class ScexUartReader : public SystemObject, // strg+shift+n
|
||||
DynamicFIFO<size_t> ipcQueue;
|
||||
ScexDleParser dleParser;
|
||||
|
||||
static void foundDlePacketHandler(uint8_t *packet, size_t len, void *args);
|
||||
static void foundDlePacketHandler(const DleParser::Context &ctx);
|
||||
void handleFoundDlePacket(uint8_t *packet, size_t len);
|
||||
|
||||
ReturnValue_t performOperation(uint8_t operationCode = 0) override;
|
||||
|
Loading…
Reference in New Issue
Block a user