Added the following MPSoC commands:
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good
* TcCamTakePic * TcSimplexSendFile * TcDownlinkDataModulate Pending: Test commands with MPSoC
This commit is contained in:
@ -31,6 +31,9 @@ static const DeviceCommandId_t TC_MODE_IDLE = 18;
|
||||
static const DeviceCommandId_t TM_CAM_CMD_RPT = 19;
|
||||
static const DeviceCommandId_t SET_UART_TX_TRISTATE = 20;
|
||||
static const DeviceCommandId_t RELEASE_UART_TX = 21;
|
||||
static const DeviceCommandId_t TC_CAM_TAKE_PIC = 22;
|
||||
static const DeviceCommandId_t TC_SIMPLEX_SEND_FILE = 23;
|
||||
static const DeviceCommandId_t TC_DOWNLINK_DATA_MODULATE = 24;
|
||||
|
||||
// Will reset the sequence count of the OBSW
|
||||
static const DeviceCommandId_t OBSW_RESET_SEQ_COUNT = 50;
|
||||
@ -50,14 +53,18 @@ static const uint16_t TC_REPLAY_WRITE_SEQUENCE = 0x112;
|
||||
static const uint16_t TC_DOWNLINK_PWR_ON = 0x113;
|
||||
static const uint16_t TC_MEM_WRITE = 0x114;
|
||||
static const uint16_t TC_MEM_READ = 0x115;
|
||||
static const uint16_t TC_CAM_TAKE_PIC = 0x116;
|
||||
static const uint16_t TC_FLASHWRITE = 0x117;
|
||||
static const uint16_t TC_FLASHFOPEN = 0x119;
|
||||
static const uint16_t TC_FLASHFCLOSE = 0x11A;
|
||||
static const uint16_t TC_FLASHDELETE = 0x11C;
|
||||
static const uint16_t TC_MODE_REPLAY = 0x11F;
|
||||
static const uint16_t TC_MODE_IDLE = 0x11E;
|
||||
static const uint16_t TC_MODE_REPLAY = 0x11F;
|
||||
static const uint16_t TC_MODE_SNAPSHOT = 0x120;
|
||||
static const uint16_t TC_DOWNLINK_DATA_MODULATE = 0x121;
|
||||
static const uint16_t TC_DOWNLINK_PWR_OFF = 0x124;
|
||||
static const uint16_t TC_CAM_CMD_SEND = 0x12C;
|
||||
static const uint16_t TC_SIMPLEX_SEND_FILE = 0x130;
|
||||
static const uint16_t TM_MEMORY_READ_REPORT = 0x404;
|
||||
static const uint16_t ACK_SUCCESS = 0x400;
|
||||
static const uint16_t ACK_FAILURE = 0x401;
|
||||
@ -646,6 +653,81 @@ class TcModeIdle : public TcBase {
|
||||
: TcBase(params, apid::TC_MODE_IDLE, sequenceCount) {}
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Class to build camera take picture command
|
||||
*/
|
||||
class TcCamTakePic : public TcBase {
|
||||
public:
|
||||
TcCamTakePic(ploc::SpTcParams params, uint16_t sequenceCount)
|
||||
: TcBase(params, apid::TC_CAM_TAKE_PIC, sequenceCount) {}
|
||||
|
||||
ReturnValue_t initPacket(const uint8_t* commandData, size_t commandDataLen) override {
|
||||
if (commandDataLen > MAX_DATA_LENGTH) {
|
||||
return INVALID_LENGTH;
|
||||
}
|
||||
std::string fileName(reinterpret_cast<const char*>(commandData));
|
||||
if (fileName.size() + sizeof(NULL_TERMINATOR) > MAX_FILENAME_SIZE) {
|
||||
return FILENAME_TOO_LONG;
|
||||
}
|
||||
if (commandDataLen - (fileName.size() + sizeof(NULL_TERMINATOR)) != PARAMETER_SIZE) {
|
||||
return INVALID_LENGTH;
|
||||
}
|
||||
spParams.setFullPayloadLen(commandDataLen);
|
||||
std::memcpy(payloadStart, commandData, commandDataLen);
|
||||
return returnvalue::OK;
|
||||
}
|
||||
|
||||
private:
|
||||
static const size_t MAX_DATA_LENGTH = 286;
|
||||
static const size_t PARAMETER_SIZE = 35;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Class to build simplex send file command
|
||||
*/
|
||||
class TcSimplexSendFile : public TcBase {
|
||||
public:
|
||||
TcSimplexSendFile(ploc::SpTcParams params, uint16_t sequenceCount)
|
||||
: TcBase(params, apid::TC_SIMPLEX_SEND_FILE, sequenceCount) {}
|
||||
|
||||
ReturnValue_t initPacket(const uint8_t* commandData, size_t commandDataLen) override {
|
||||
if (commandDataLen > MAX_DATA_LENGTH) {
|
||||
return INVALID_LENGTH;
|
||||
}
|
||||
std::string fileName(reinterpret_cast<const char*>(commandData));
|
||||
if (fileName.size() + sizeof(NULL_TERMINATOR) > MAX_FILENAME_SIZE) {
|
||||
return FILENAME_TOO_LONG;
|
||||
}
|
||||
spParams.setFullPayloadLen(commandDataLen);
|
||||
std::memcpy(payloadStart, commandData, commandDataLen);
|
||||
return returnvalue::OK;
|
||||
}
|
||||
|
||||
private:
|
||||
static const size_t MAX_DATA_LENGTH = 256;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Class to build downlink data modulate command
|
||||
*/
|
||||
class TcDownlinkDataModulate : public TcBase {
|
||||
public:
|
||||
TcDownlinkDataModulate(ploc::SpTcParams params, uint16_t sequenceCount)
|
||||
: TcBase(params, apid::TC_DOWNLINK_DATA_MODULATE, sequenceCount) {}
|
||||
|
||||
ReturnValue_t initPacket(const uint8_t* commandData, size_t commandDataLen) override {
|
||||
if (commandDataLen > MAX_DATA_LENGTH) {
|
||||
return INVALID_LENGTH;
|
||||
}
|
||||
spParams.setFullPayloadLen(commandDataLen);
|
||||
std::memcpy(payloadStart, commandData, commandDataLen);
|
||||
return returnvalue::OK;
|
||||
}
|
||||
|
||||
private:
|
||||
static const size_t MAX_DATA_LENGTH = 11;
|
||||
};
|
||||
|
||||
class TcCamcmdSend : public TcBase {
|
||||
public:
|
||||
TcCamcmdSend(ploc::SpTcParams params, uint16_t sequenceCount)
|
||||
|
Reference in New Issue
Block a user