GomSpace commands #293
@ -176,6 +176,16 @@ ReturnValue_t CspComIF::sendMessage(CookieIF* cookie, const uint8_t* sendData, s
|
||||
if (result != 0) {
|
||||
return returnvalue::FAILED;
|
||||
}
|
||||
} else if(req == GOMSPACE::SpecialRequestTypes::LOAD_TABLE) {
|
||||
if(sendLen < 2) {
|
||||
return returnvalue::FAILED;
|
||||
}
|
||||
const TableInfo* tableInfo = reinterpret_cast<const TableInfo*>(sendData);
|
||||
int result = gs_rparam_load(cspAddress, cspCookie->getTimeout(), tableInfo->sourceTable,
|
||||
tableInfo->targetTable);
|
||||
if (result != 0) {
|
||||
return returnvalue::FAILED;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
/* No CSP fixed port was selected. Send data to the specified port and
|
||||
|
@ -1,10 +1,11 @@
|
||||
#include "CspCookie.h"
|
||||
|
||||
using namespace GOMSPACE;
|
||||
CspCookie::CspCookie(uint16_t maxReplyLength_, uint8_t cspAddress_, uint32_t timeoutMs)
|
||||
: maxReplyLength(maxReplyLength_),
|
||||
cspAddress(cspAddress_),
|
||||
timeoutMs(timeoutMs),
|
||||
reqType(GOMSPACE::DEFAULT_COM_IF) {}
|
||||
reqType(SpecialRequestTypes::DEFAULT_COM_IF) {}
|
||||
|
||||
CspCookie::~CspCookie() {}
|
||||
|
||||
|
@ -109,6 +109,20 @@ ReturnValue_t GomspaceDeviceHandler::buildCommandFromCommand(DeviceCommandId_t d
|
||||
}
|
||||
break;
|
||||
}
|
||||
case (GOMSPACE::LOAD_TABLE): {
|
||||
if (commandDataLen != 2) {
|
||||
return HasActionsIF::INVALID_PARAMETERS;
|
||||
}
|
||||
auto* info = reinterpret_cast<GOMSPACE::TableInfo*>(cspPacket);
|
||||
info->sourceTable = commandData[0];
|
||||
info->targetTable = commandData[1];
|
||||
rawPacket = cspPacket;
|
||||
rawPacketLen = sizeof(GOMSPACE::TableInfo);
|
||||
cspCookie->setCspPort(CspPorts::P60_PORT_RPARAM_ENUM);
|
||||
cspCookie->setRequest(SpecialRequestTypes::LOAD_TABLE, 0);
|
||||
rememberCommandId = deviceCommand;
|
||||
break;
|
||||
}
|
||||
case (GOMSPACE::SAVE_TABLE_FILE): {
|
||||
if (commandDataLen > 2) {
|
||||
return HasActionsIF::INVALID_PARAMETERS;
|
||||
@ -171,6 +185,7 @@ void GomspaceDeviceHandler::fillCommandAndReplyMap() {
|
||||
this->insertInCommandMap(GOMSPACE::PRINT_LATCHUPS);
|
||||
insertInCommandMap(GOMSPACE::SAVE_TABLE_FILE);
|
||||
insertInCommandMap(GOMSPACE::SAVE_TABLE_DEFAULT);
|
||||
insertInCommandMap(GOMSPACE::LOAD_TABLE);
|
||||
}
|
||||
|
||||
ReturnValue_t GomspaceDeviceHandler::scanForReply(const uint8_t* start, size_t remainingSize,
|
||||
|
@ -25,7 +25,7 @@ struct TableInfo {
|
||||
|
||||
enum DeviceType { PDU, ACU, P60DOCK };
|
||||
|
||||
enum SpecialRequestTypes {
|
||||
enum class SpecialRequestTypes {
|
||||
DEFAULT_COM_IF,
|
||||
GET_PDU_HK,
|
||||
GET_PDU_CONFIG,
|
||||
@ -33,7 +33,8 @@ enum SpecialRequestTypes {
|
||||
GET_ACU_CONFIG,
|
||||
GET_P60DOCK_HK,
|
||||
GET_P60DOCK_CONFIG,
|
||||
SAVE_TABLE
|
||||
SAVE_TABLE,
|
||||
LOAD_TABLE
|
||||
};
|
||||
|
||||
enum CspPorts : uint8_t {
|
||||
@ -70,6 +71,7 @@ static const DeviceCommandId_t REQUEST_HK_TABLE = 16; //!< [EXPORT] : [COMM
|
||||
static const DeviceCommandId_t REQUEST_CONFIG_TABLE = 17; //!< [EXPORT] : [COMMAND]
|
||||
static const DeviceCommandId_t SAVE_TABLE_FILE = 18;
|
||||
static const DeviceCommandId_t SAVE_TABLE_DEFAULT = 19;
|
||||
static const DeviceCommandId_t LOAD_TABLE = 20;
|
||||
static const DeviceCommandId_t PARAM_SET = 255; //!< [EXPORT] : [COMMAND]
|
||||
|
||||
// Not implemented yet
|
||||
|
2
tmtc
2
tmtc
@ -1 +1 @@
|
||||
Subproject commit e162e5c51b0bf08b2018e4169a07eed1e4f7eacb
|
||||
Subproject commit 6085c6543c0beb24cc427fae16d1fa2897a2fe5a
|
Loading…
Reference in New Issue
Block a user