WIP: SCEX Init #272
@ -1,5 +1,7 @@
|
|||||||
#include "ScexDleParser.h"
|
#include "ScexDleParser.h"
|
||||||
|
|
||||||
ScexDleParser::ScexDleParser(SimpleRingBuffer &decodeRingBuf, DleEncoder &decoder, BufPair encodedBuf, BufPair decodedBuf, UserHandler handler,
|
ScexDleParser::ScexDleParser(SimpleRingBuffer &decodeRingBuf, DleEncoder &decoder,
|
||||||
void *args) : DleParser(decodeRingBuf, decoder, encodedBuf, decodedBuf, handler, args) {};
|
BufPair encodedBuf, BufPair decodedBuf, UserHandler handler,
|
||||||
ScexDleParser::~ScexDleParser() {};
|
void *args)
|
||||||
|
: DleParser(decodeRingBuf, decoder, encodedBuf, decodedBuf, handler, args){};
|
||||||
|
ScexDleParser::~ScexDleParser(){};
|
||||||
|
@ -3,17 +3,17 @@
|
|||||||
|
|
||||||
#include <fsfw/globalfunctions/DleParser.h>
|
#include <fsfw/globalfunctions/DleParser.h>
|
||||||
|
|
||||||
|
|
||||||
class ScexDleParser : public DleParser {
|
class ScexDleParser : public DleParser {
|
||||||
public:
|
public:
|
||||||
ScexDleParser(SimpleRingBuffer &decodeRingBuf, DleEncoder &decoder,
|
ScexDleParser(SimpleRingBuffer &decodeRingBuf, DleEncoder &decoder, BufPair encodedBuf,
|
||||||
BufPair encodedBuf, BufPair decodedBuf, UserHandler handler,
|
BufPair decodedBuf, UserHandler handler, void *args);
|
||||||
void *args);
|
// ScexDleParser(SimpleRingBuffer &decodeRingBuf, DleEncoder &decoder,
|
||||||
// ScexDleParser(SimpleRingBuffer &decodeRingBuf, DleEncoder &decoder,
|
// BufPair encodedBuf, BufPair decodedBuf, UserHandler handler,
|
||||||
// BufPair encodedBuf, BufPair decodedBuf, UserHandler handler,
|
// void *args) : DleParser(decodeRingBuf, decoder, encodedBuf, decodedBuf, handler,
|
||||||
// void *args) : DleParser(decodeRingBuf, decoder, encodedBuf, decodedBuf, handler, args){}
|
// args){}
|
||||||
|
|
||||||
virtual ~ScexDleParser();
|
virtual ~ScexDleParser();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -5,10 +5,10 @@
|
|||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
#include <random>
|
||||||
|
|
||||||
#include "fsfw/globalfunctions/CRC.h"
|
#include "fsfw/globalfunctions/CRC.h"
|
||||||
#include "mission/devices/devicedefinitions/ScexDefinitions.h"
|
#include "mission/devices/devicedefinitions/ScexDefinitions.h"
|
||||||
#include <random>
|
|
||||||
|
|
||||||
using std::ofstream;
|
using std::ofstream;
|
||||||
|
|
||||||
@ -48,7 +48,7 @@ ReturnValue_t ScexDeviceHandler::buildCommandFromCommand(DeviceCommandId_t devic
|
|||||||
|
|
||||||
switch (deviceCommand) {
|
switch (deviceCommand) {
|
||||||
case (PING): {
|
case (PING): {
|
||||||
//rawPacket = cmdBuf.data();
|
// rawPacket = cmdBuf.data();
|
||||||
prepareScexCmd(cmdTyped, commandData[0], {cmdBuf.data(), cmdBuf.size()}, rawPacketLen,
|
prepareScexCmd(cmdTyped, commandData[0], {cmdBuf.data(), cmdBuf.size()}, rawPacketLen,
|
||||||
{nullptr, 0});
|
{nullptr, 0});
|
||||||
return RETURN_OK;
|
return RETURN_OK;
|
||||||
|
@ -8,9 +8,8 @@ uint8_t scex::createCmdByte(Cmds cmd, bool tempCheck) {
|
|||||||
return (IDLE_BIT_0_DEF_STATE << 7) | (IDLE_BIT_1_DEF_STATE << 6) | (cmd << 1) | tempCheck;
|
return (IDLE_BIT_0_DEF_STATE << 7) | (IDLE_BIT_1_DEF_STATE << 6) | (cmd << 1) | tempCheck;
|
||||||
}
|
}
|
||||||
|
|
||||||
ReturnValue_t scex::prepareScexCmd(Cmds cmd, bool tempCheck,
|
ReturnValue_t scex::prepareScexCmd(Cmds cmd, bool tempCheck, std::pair<uint8_t*, size_t> cmdBufPair,
|
||||||
std::pair<uint8_t*, size_t> cmdBufPair, size_t& cmdLen,
|
size_t& cmdLen, std::pair<const uint8_t*, size_t> usrDataPair) {
|
||||||
std::pair<const uint8_t*, size_t> usrDataPair) {
|
|
||||||
using namespace scex;
|
using namespace scex;
|
||||||
uint8_t* cmdBuf = cmdBufPair.first;
|
uint8_t* cmdBuf = cmdBufPair.first;
|
||||||
const uint8_t* userData = usrDataPair.first;
|
const uint8_t* userData = usrDataPair.first;
|
||||||
|
Loading…
Reference in New Issue
Block a user