compiling both with and without introspection
This commit is contained in:
parent
3c762e7437
commit
06b6c0838a
@ -12,7 +12,7 @@ ACUHandler::ACUHandler(object_id_t objectId, object_id_t comIF, CookieIF *comCoo
|
|||||||
ACUHandler::~ACUHandler() {}
|
ACUHandler::~ACUHandler() {}
|
||||||
|
|
||||||
ReturnValue_t ACUHandler::buildNormalDeviceCommand(DeviceCommandId_t *id) {
|
ReturnValue_t ACUHandler::buildNormalDeviceCommand(DeviceCommandId_t *id) {
|
||||||
*id = GomspaceCommands::REQUEST_HK_TABLE;
|
*id = GOMSPACE::REQUEST_HK_TABLE;
|
||||||
return requestHkTableAction.handle();
|
return requestHkTableAction.handle();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -190,7 +190,7 @@ void ACUHandler::setDebugMode(bool enable) { this->debugMode = enable; }
|
|||||||
ReturnValue_t ACUHandler::printStatus(DeviceCommandId_t cmd) {
|
ReturnValue_t ACUHandler::printStatus(DeviceCommandId_t cmd) {
|
||||||
ReturnValue_t result = RETURN_OK;
|
ReturnValue_t result = RETURN_OK;
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
case (GomspaceCommands::PRINT_SWITCH_V_I): {
|
case (GOMSPACE::PRINT_SWITCH_V_I): {
|
||||||
PoolReadGuard pg(&coreHk);
|
PoolReadGuard pg(&coreHk);
|
||||||
result = pg.getReadResult();
|
result = pg.getReadResult();
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
|
@ -41,40 +41,40 @@ ReturnValue_t GomspaceDeviceHandler::handleAction(PrintLatchupsAction* action) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void GomspaceDeviceHandler::fillCommandAndReplyMap() {
|
void GomspaceDeviceHandler::fillCommandAndReplyMap() {
|
||||||
this->insertInCommandAndReplyMap(GomspaceCommands::PING, 3);
|
this->insertInCommandAndReplyMap(GOMSPACE::PING, 3);
|
||||||
this->insertInCommandMap(GomspaceCommands::REBOOT);
|
this->insertInCommandMap(GOMSPACE::REBOOT);
|
||||||
this->insertInCommandAndReplyMap(GomspaceCommands::PARAM_SET, 3);
|
this->insertInCommandAndReplyMap(GOMSPACE::PARAM_SET, 3);
|
||||||
this->insertInCommandAndReplyMap(GomspaceCommands::PARAM_GET, 3);
|
this->insertInCommandAndReplyMap(GOMSPACE::PARAM_GET, 3);
|
||||||
this->insertInCommandAndReplyMap(GomspaceCommands::REQUEST_HK_TABLE, 3);
|
this->insertInCommandAndReplyMap(GOMSPACE::REQUEST_HK_TABLE, 3);
|
||||||
this->insertInCommandMap(GomspaceCommands::GNDWDT_RESET);
|
this->insertInCommandMap(GOMSPACE::GNDWDT_RESET);
|
||||||
this->insertInCommandMap(GomspaceCommands::PRINT_SWITCH_V_I);
|
this->insertInCommandMap(GOMSPACE::PRINT_SWITCH_V_I);
|
||||||
this->insertInCommandMap(GomspaceCommands::PRINT_LATCHUPS);
|
this->insertInCommandMap(GOMSPACE::PRINT_LATCHUPS);
|
||||||
}
|
}
|
||||||
|
|
||||||
ReturnValue_t GomspaceDeviceHandler::scanForReply(const uint8_t* start, size_t remainingSize,
|
ReturnValue_t GomspaceDeviceHandler::scanForReply(const uint8_t* start, size_t remainingSize,
|
||||||
DeviceCommandId_t* foundId, size_t* foundLen) {
|
DeviceCommandId_t* foundId, size_t* foundLen) {
|
||||||
switch (rememberCommandId) {
|
switch (rememberCommandId) {
|
||||||
case (GomspaceCommands::PING):
|
case (GOMSPACE::PING):
|
||||||
*foundId = GomspaceCommands::PING;
|
*foundId = GOMSPACE::PING;
|
||||||
*foundLen = PING_REPLY_SIZE;
|
*foundLen = PING_REPLY_SIZE;
|
||||||
rememberCommandId = GomspaceCommands::NONE;
|
rememberCommandId = GOMSPACE::NONE;
|
||||||
break;
|
break;
|
||||||
case (GomspaceCommands::PARAM_GET): {
|
case (GOMSPACE::PARAM_GET): {
|
||||||
*foundId = GomspaceCommands::PARAM_GET;
|
*foundId = GOMSPACE::PARAM_GET;
|
||||||
*foundLen = rememberRequestedSize + GOMSPACE::GS_HDR_LENGTH;
|
*foundLen = rememberRequestedSize + GOMSPACE::GS_HDR_LENGTH;
|
||||||
rememberCommandId = GomspaceCommands::NONE;
|
rememberCommandId = GOMSPACE::NONE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case (GomspaceCommands::PARAM_SET): {
|
case (GOMSPACE::PARAM_SET): {
|
||||||
*foundId = GomspaceCommands::PARAM_SET;
|
*foundId = GOMSPACE::PARAM_SET;
|
||||||
*foundLen = rememberRequestedSize;
|
*foundLen = rememberRequestedSize;
|
||||||
rememberCommandId = GomspaceCommands::NONE;
|
rememberCommandId = GOMSPACE::NONE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case (GomspaceCommands::REQUEST_HK_TABLE): {
|
case (GOMSPACE::REQUEST_HK_TABLE): {
|
||||||
*foundId = GomspaceCommands::REQUEST_HK_TABLE;
|
*foundId = GOMSPACE::REQUEST_HK_TABLE;
|
||||||
*foundLen = rememberRequestedSize + GOMSPACE::GS_HDR_LENGTH;
|
*foundLen = rememberRequestedSize + GOMSPACE::GS_HDR_LENGTH;
|
||||||
rememberCommandId = GomspaceCommands::NONE;
|
rememberCommandId = GOMSPACE::NONE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
@ -86,12 +86,12 @@ ReturnValue_t GomspaceDeviceHandler::scanForReply(const uint8_t* start, size_t r
|
|||||||
ReturnValue_t GomspaceDeviceHandler::interpretDeviceReply(DeviceCommandId_t id,
|
ReturnValue_t GomspaceDeviceHandler::interpretDeviceReply(DeviceCommandId_t id,
|
||||||
const uint8_t* packet) {
|
const uint8_t* packet) {
|
||||||
switch (id) {
|
switch (id) {
|
||||||
case (GomspaceCommands::PING): {
|
case (GOMSPACE::PING): {
|
||||||
SerializeElement<uint32_t> replyTime = *packet;
|
SerializeElement<uint32_t> replyTime = *packet;
|
||||||
handleDeviceTM(&replyTime, id, true);
|
handleDeviceTM(&replyTime, id, true);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case (GomspaceCommands::PARAM_GET): {
|
case (GOMSPACE::PARAM_GET): {
|
||||||
// -2 to subtract address size from gomspace parameter reply packet
|
// -2 to subtract address size from gomspace parameter reply packet
|
||||||
uint16_t payloadLength = (*(packet + 2) << 8 | *(packet + 3)) - 2;
|
uint16_t payloadLength = (*(packet + 2) << 8 | *(packet + 3)) - 2;
|
||||||
if (payloadLength > sizeof(uint32_t)) {
|
if (payloadLength > sizeof(uint32_t)) {
|
||||||
@ -118,7 +118,7 @@ ReturnValue_t GomspaceDeviceHandler::interpretDeviceReply(DeviceCommandId_t id,
|
|||||||
handleDeviceTM(¶mReply, id, true);
|
handleDeviceTM(¶mReply, id, true);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case (GomspaceCommands::PARAM_SET): {
|
case (GOMSPACE::PARAM_SET): {
|
||||||
/* When setting a parameter, the p60dock sends back the state of the
|
/* When setting a parameter, the p60dock sends back the state of the
|
||||||
* operation */
|
* operation */
|
||||||
if (*packet != PARAM_SET_OK) {
|
if (*packet != PARAM_SET_OK) {
|
||||||
@ -128,7 +128,7 @@ ReturnValue_t GomspaceDeviceHandler::interpretDeviceReply(DeviceCommandId_t id,
|
|||||||
setParamCallback(setParamCacher.getParameter(), setParamCacher.getParameter(), setParamCacher.getParameterSize(), true);
|
setParamCallback(setParamCacher.getParameter(), setParamCacher.getParameter(), setParamCacher.getParameterSize(), true);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case (GomspaceCommands::REQUEST_HK_TABLE): {
|
case (GOMSPACE::REQUEST_HK_TABLE): {
|
||||||
letChildHandleHkReply(id, packet);
|
letChildHandleHkReply(id, packet);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -231,13 +231,13 @@ ReturnValue_t GomspaceDeviceHandler::handleAction(ParamSetAction* action) {
|
|||||||
rawPacket = cspPacket;
|
rawPacket = cspPacket;
|
||||||
rawPacketLen = cspPacketLen;
|
rawPacketLen = cspPacketLen;
|
||||||
rememberRequestedSize = querySize;
|
rememberRequestedSize = querySize;
|
||||||
rememberCommandId = GomspaceCommands::PARAM_SET;
|
rememberCommandId = GOMSPACE::PARAM_SET;
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
return HasReturnvaluesIF::RETURN_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
ReturnValue_t GomspaceDeviceHandler::handleAction(ParamGetAction* action) {
|
ReturnValue_t GomspaceDeviceHandler::handleAction(ParamGetAction* action) {
|
||||||
ReturnValue_t result;
|
ReturnValue_t result;
|
||||||
uint8_t tableId = static_cast<uint8_t>(action->tableId.value);
|
auto tableId = action->tableId.value;
|
||||||
|
|
||||||
/* Get and check address */
|
/* Get and check address */
|
||||||
uint16_t address = action->address;
|
uint16_t address = action->address;
|
||||||
@ -259,7 +259,7 @@ ReturnValue_t GomspaceDeviceHandler::handleAction(ParamGetAction* action) {
|
|||||||
uint16_t querySize = parameterSize + GOMSPACE::GS_HDR_LENGTH;
|
uint16_t querySize = parameterSize + GOMSPACE::GS_HDR_LENGTH;
|
||||||
|
|
||||||
/* Generate the CSP command to send to the P60 Dock */
|
/* Generate the CSP command to send to the P60 Dock */
|
||||||
CspGetParamCommand getParamCmd(querySize, tableId, length, checksum, seq, total, address);
|
CspGetParamCommand getParamCmd(querySize, static_cast<uint8_t>(tableId), length, checksum, seq, total, address);
|
||||||
size_t cspPacketLen = 0;
|
size_t cspPacketLen = 0;
|
||||||
uint8_t* buffer = cspPacket;
|
uint8_t* buffer = cspPacket;
|
||||||
result = getParamCmd.serialize(&buffer, &cspPacketLen, sizeof(cspPacket),
|
result = getParamCmd.serialize(&buffer, &cspPacketLen, sizeof(cspPacket),
|
||||||
@ -279,7 +279,7 @@ ReturnValue_t GomspaceDeviceHandler::handleAction(ParamGetAction* action) {
|
|||||||
rawPacket = cspPacket;
|
rawPacket = cspPacket;
|
||||||
rawPacketLen = cspPacketLen;
|
rawPacketLen = cspPacketLen;
|
||||||
rememberRequestedSize = querySize;
|
rememberRequestedSize = querySize;
|
||||||
rememberCommandId = GomspaceCommands::PARAM_GET;
|
rememberCommandId = GOMSPACE::PARAM_GET;
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
return HasReturnvaluesIF::RETURN_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -300,7 +300,7 @@ ReturnValue_t GomspaceDeviceHandler::handleAction(PingAction* action) {
|
|||||||
}*/
|
}*/
|
||||||
rawPacket = cspPacket;
|
rawPacket = cspPacket;
|
||||||
rawPacketLen = cspPacketLen;
|
rawPacketLen = cspPacketLen;
|
||||||
rememberCommandId = GomspaceCommands::PING;
|
rememberCommandId = GOMSPACE::PING;
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
return HasReturnvaluesIF::RETURN_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -380,13 +380,13 @@ ReturnValue_t GomspaceDeviceHandler::handleAction(GndwdtResetAction* action) {
|
|||||||
rawPacketLen = cspPacketLen;
|
rawPacketLen = cspPacketLen;
|
||||||
rememberRequestedSize = 0; // No bytes will be queried with the ground
|
rememberRequestedSize = 0; // No bytes will be queried with the ground
|
||||||
// watchdog command.
|
// watchdog command.
|
||||||
rememberCommandId = GomspaceCommands::GNDWDT_RESET;
|
rememberCommandId = GOMSPACE::GNDWDT_RESET;
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
return HasReturnvaluesIF::RETURN_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
ReturnValue_t GomspaceDeviceHandler::handleAction(RequestHkTableAction* action) {
|
ReturnValue_t GomspaceDeviceHandler::handleAction(RequestHkTableAction* action) {
|
||||||
uint16_t querySize = hkTableReplySize;
|
uint16_t querySize = hkTableReplySize;
|
||||||
uint8_t tableId = ParamGetAction::TableId::HK_TABLE_ID;
|
uint8_t tableId = static_cast<uint8_t>(ParamGetAction::TableId::HK_TABLE_ID);
|
||||||
RequestFullTableCommand requestFullTableCommand(querySize, tableId);
|
RequestFullTableCommand requestFullTableCommand(querySize, tableId);
|
||||||
|
|
||||||
size_t cspPacketLen = 0;
|
size_t cspPacketLen = 0;
|
||||||
@ -402,7 +402,7 @@ ReturnValue_t GomspaceDeviceHandler::handleAction(RequestHkTableAction* action)
|
|||||||
rawPacket = cspPacket;
|
rawPacket = cspPacket;
|
||||||
rawPacketLen = cspPacketLen;
|
rawPacketLen = cspPacketLen;
|
||||||
rememberRequestedSize = querySize;
|
rememberRequestedSize = querySize;
|
||||||
rememberCommandId = GomspaceCommands::REQUEST_HK_TABLE;
|
rememberCommandId = GOMSPACE::REQUEST_HK_TABLE;
|
||||||
return RETURN_OK;
|
return RETURN_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -88,7 +88,7 @@ class GomspaceDeviceHandler : public DeviceHandlerBase {
|
|||||||
static const uint8_t PING_REPLY_SIZE = 2;
|
static const uint8_t PING_REPLY_SIZE = 2;
|
||||||
|
|
||||||
uint8_t rememberRequestedSize = 0;
|
uint8_t rememberRequestedSize = 0;
|
||||||
uint8_t rememberCommandId = GomspaceCommands::NONE;
|
uint8_t rememberCommandId = GOMSPACE::NONE;
|
||||||
uint8_t cspPacket[MAX_PACKET_LEN];
|
uint8_t cspPacket[MAX_PACKET_LEN];
|
||||||
|
|
||||||
uint16_t maxConfigTableAddress;
|
uint16_t maxConfigTableAddress;
|
||||||
|
@ -15,7 +15,7 @@ P60DockHandler::P60DockHandler(object_id_t objectId, object_id_t comIF, CookieIF
|
|||||||
P60DockHandler::~P60DockHandler() {}
|
P60DockHandler::~P60DockHandler() {}
|
||||||
|
|
||||||
ReturnValue_t P60DockHandler::buildNormalDeviceCommand(DeviceCommandId_t *id) {
|
ReturnValue_t P60DockHandler::buildNormalDeviceCommand(DeviceCommandId_t *id) {
|
||||||
*id = GomspaceCommands::REQUEST_HK_TABLE;
|
*id = GOMSPACE::REQUEST_HK_TABLE;
|
||||||
return requestHkTableAction.handle();
|
return requestHkTableAction.handle();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -233,7 +233,7 @@ ReturnValue_t P60DockHandler::initializeLocalDataPool(localpool::DataPool &local
|
|||||||
ReturnValue_t P60DockHandler::printStatus(DeviceCommandId_t cmd) {
|
ReturnValue_t P60DockHandler::printStatus(DeviceCommandId_t cmd) {
|
||||||
ReturnValue_t result = RETURN_OK;
|
ReturnValue_t result = RETURN_OK;
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
case (GomspaceCommands::PRINT_SWITCH_V_I): {
|
case (GOMSPACE::PRINT_SWITCH_V_I): {
|
||||||
PoolReadGuard pg0(&coreHk);
|
PoolReadGuard pg0(&coreHk);
|
||||||
PoolReadGuard pg1(&auxHk);
|
PoolReadGuard pg1(&auxHk);
|
||||||
if (pg0.getReadResult() != HasReturnvaluesIF::RETURN_OK or
|
if (pg0.getReadResult() != HasReturnvaluesIF::RETURN_OK or
|
||||||
@ -243,7 +243,7 @@ ReturnValue_t P60DockHandler::printStatus(DeviceCommandId_t cmd) {
|
|||||||
printHkTableSwitchIV();
|
printHkTableSwitchIV();
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
return HasReturnvaluesIF::RETURN_OK;
|
||||||
}
|
}
|
||||||
case (GomspaceCommands::PRINT_LATCHUPS): {
|
case (GOMSPACE::PRINT_LATCHUPS): {
|
||||||
PoolReadGuard pg(&auxHk);
|
PoolReadGuard pg(&auxHk);
|
||||||
result = pg.getReadResult();
|
result = pg.getReadResult();
|
||||||
printHkTableLatchups();
|
printHkTableLatchups();
|
||||||
|
@ -353,7 +353,7 @@ ReturnValue_t PCDUHandler::sendSwitchCommand(uint8_t switchNr, ReturnValue_t onO
|
|||||||
result = IPCStore->addData(&storeAddress, command, sizeof(command));
|
result = IPCStore->addData(&storeAddress, command, sizeof(command));
|
||||||
|
|
||||||
CommandMessage message;
|
CommandMessage message;
|
||||||
ActionMessage::setCommand(&message, GomspaceCommands::PARAM_SET, storeAddress);
|
ActionMessage::setCommand(&message, GOMSPACE::PARAM_SET, storeAddress);
|
||||||
|
|
||||||
result = commandQueue->sendMessage(pdu->getCommandQueue(), &message, 0);
|
result = commandQueue->sendMessage(pdu->getCommandQueue(), &message, 0);
|
||||||
if (result != RETURN_OK) {
|
if (result != RETURN_OK) {
|
||||||
|
@ -15,7 +15,7 @@ PDU1Handler::PDU1Handler(object_id_t objectId, object_id_t comIF, CookieIF *comC
|
|||||||
PDU1Handler::~PDU1Handler() {}
|
PDU1Handler::~PDU1Handler() {}
|
||||||
|
|
||||||
ReturnValue_t PDU1Handler::buildNormalDeviceCommand(DeviceCommandId_t *id) {
|
ReturnValue_t PDU1Handler::buildNormalDeviceCommand(DeviceCommandId_t *id) {
|
||||||
*id = GomspaceCommands::REQUEST_HK_TABLE;
|
*id = GOMSPACE::REQUEST_HK_TABLE;
|
||||||
return requestHkTableAction.handle();
|
return requestHkTableAction.handle();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -102,7 +102,7 @@ LocalPoolDataSetBase *PDU1Handler::getDataSetHandle(sid_t sid) {
|
|||||||
ReturnValue_t PDU1Handler::printStatus(DeviceCommandId_t cmd) {
|
ReturnValue_t PDU1Handler::printStatus(DeviceCommandId_t cmd) {
|
||||||
ReturnValue_t result = RETURN_OK;
|
ReturnValue_t result = RETURN_OK;
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
case (GomspaceCommands::PRINT_SWITCH_V_I): {
|
case (GOMSPACE::PRINT_SWITCH_V_I): {
|
||||||
PoolReadGuard pg(&coreHk);
|
PoolReadGuard pg(&coreHk);
|
||||||
result = pg.getReadResult();
|
result = pg.getReadResult();
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
@ -111,7 +111,7 @@ ReturnValue_t PDU1Handler::printStatus(DeviceCommandId_t cmd) {
|
|||||||
printHkTableSwitchVI();
|
printHkTableSwitchVI();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case (GomspaceCommands::PRINT_LATCHUPS): {
|
case (GOMSPACE::PRINT_LATCHUPS): {
|
||||||
PoolReadGuard pg(&auxHk);
|
PoolReadGuard pg(&auxHk);
|
||||||
result = pg.getReadResult();
|
result = pg.getReadResult();
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
|
@ -15,7 +15,7 @@ PDU2Handler::PDU2Handler(object_id_t objectId, object_id_t comIF, CookieIF *comC
|
|||||||
PDU2Handler::~PDU2Handler() {}
|
PDU2Handler::~PDU2Handler() {}
|
||||||
|
|
||||||
ReturnValue_t PDU2Handler::buildNormalDeviceCommand(DeviceCommandId_t *id) {
|
ReturnValue_t PDU2Handler::buildNormalDeviceCommand(DeviceCommandId_t *id) {
|
||||||
*id = GomspaceCommands::REQUEST_HK_TABLE;
|
*id = GOMSPACE::REQUEST_HK_TABLE;
|
||||||
return requestHkTableAction.handle();
|
return requestHkTableAction.handle();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -57,7 +57,7 @@ ReturnValue_t PDU2Handler::initializeLocalDataPool(localpool::DataPool &localDat
|
|||||||
ReturnValue_t PDU2Handler::printStatus(DeviceCommandId_t cmd) {
|
ReturnValue_t PDU2Handler::printStatus(DeviceCommandId_t cmd) {
|
||||||
ReturnValue_t result = RETURN_OK;
|
ReturnValue_t result = RETURN_OK;
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
case (GomspaceCommands::PRINT_SWITCH_V_I): {
|
case (GOMSPACE::PRINT_SWITCH_V_I): {
|
||||||
PoolReadGuard pg(&coreHk);
|
PoolReadGuard pg(&coreHk);
|
||||||
result = pg.getReadResult();
|
result = pg.getReadResult();
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
@ -66,7 +66,7 @@ ReturnValue_t PDU2Handler::printStatus(DeviceCommandId_t cmd) {
|
|||||||
printHkTableSwitchVI();
|
printHkTableSwitchVI();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case (GomspaceCommands::PRINT_LATCHUPS): {
|
case (GOMSPACE::PRINT_LATCHUPS): {
|
||||||
PoolReadGuard pg(&auxHk);
|
PoolReadGuard pg(&auxHk);
|
||||||
result = pg.getReadResult();
|
result = pg.getReadResult();
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
|
@ -7,35 +7,35 @@
|
|||||||
|
|
||||||
class GomspaceDeviceHandler;
|
class GomspaceDeviceHandler;
|
||||||
|
|
||||||
class PingAction : public TemplateAction<GomspaceDeviceHandler, PingAction, GomspaceCommands> {
|
class PingAction : public TemplateAction<GomspaceDeviceHandler, PingAction, GOMSPACE::GomspaceCommands> {
|
||||||
public:
|
public:
|
||||||
PingAction(GomspaceDeviceHandler* owner) : TemplateAction(owner, GomspaceCommands::PING) {}
|
PingAction(GomspaceDeviceHandler* owner) : TemplateAction(owner, GOMSPACE::PING) {}
|
||||||
|
|
||||||
// TODO array
|
// TODO array
|
||||||
Parameter<uint8_t> pingData = Parameter<uint8_t>::createParameter(this, "Ping Data");
|
Parameter<uint8_t> pingData = Parameter<uint8_t>::createParameter(this, "Ping Data");
|
||||||
};
|
};
|
||||||
|
|
||||||
class RebootAction : public TemplateAction<GomspaceDeviceHandler, RebootAction, GomspaceCommands> {
|
class RebootAction : public TemplateAction<GomspaceDeviceHandler, RebootAction, GOMSPACE::GomspaceCommands> {
|
||||||
public:
|
public:
|
||||||
RebootAction(GomspaceDeviceHandler* owner) : TemplateAction(owner, GomspaceCommands::REBOOT) {}
|
RebootAction(GomspaceDeviceHandler* owner) : TemplateAction(owner, GOMSPACE::REBOOT) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
class GndwdtResetAction
|
class GndwdtResetAction
|
||||||
: public TemplateAction<GomspaceDeviceHandler, GndwdtResetAction, GomspaceCommands> {
|
: public TemplateAction<GomspaceDeviceHandler, GndwdtResetAction, GOMSPACE::GomspaceCommands> {
|
||||||
public:
|
public:
|
||||||
GndwdtResetAction(GomspaceDeviceHandler* owner)
|
GndwdtResetAction(GomspaceDeviceHandler* owner)
|
||||||
: TemplateAction(owner, GomspaceCommands::GNDWDT_RESET) {}
|
: TemplateAction(owner, GOMSPACE::GNDWDT_RESET) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
class ParamGetAction
|
class ParamGetAction
|
||||||
: public TemplateAction<GomspaceDeviceHandler, ParamGetAction, GomspaceCommands> {
|
: public TemplateAction<GomspaceDeviceHandler, ParamGetAction, GOMSPACE::GomspaceCommands> {
|
||||||
public:
|
public:
|
||||||
FSFW_ENUM(ParameterByteSize, uint8_t,
|
FSFW_ENUM(ParameterByteSize, uint8_t,
|
||||||
((ONE_BYTE, 1, "One Byte"))((TWO_BYTES, 2, "Two Bytes"))((FOUR_BYTES, 4, "Four Bytes")))
|
((ONE_BYTE, 1, "One Byte"))((TWO_BYTES, 2, "Two Bytes"))((FOUR_BYTES, 4, "Four Bytes")))
|
||||||
FSFW_ENUM(TableId, uint8_t,
|
FSFW_ENUM(TableId, uint8_t,
|
||||||
((CONFIG_TABLE_ID, 1, "Config Table"))((HK_TABLE_ID, 4, "Housekeeping Table")))
|
((CONFIG_TABLE_ID, 1, "Config Table"))((HK_TABLE_ID, 4, "Housekeeping Table")))
|
||||||
ParamGetAction(GomspaceDeviceHandler* owner)
|
ParamGetAction(GomspaceDeviceHandler* owner)
|
||||||
: TemplateAction(owner, GomspaceCommands::PARAM_GET) {}
|
: TemplateAction(owner, GOMSPACE::PARAM_GET) {}
|
||||||
|
|
||||||
Parameter<TableId> tableId =
|
Parameter<TableId> tableId =
|
||||||
Parameter<TableId>::createParameter(this, "Table");
|
Parameter<TableId>::createParameter(this, "Table");
|
||||||
@ -45,13 +45,13 @@ Parameter<uint16_t> address = Parameter<uint16_t>::createParameter(this, "Addres
|
|||||||
};
|
};
|
||||||
|
|
||||||
class ParamSetAction
|
class ParamSetAction
|
||||||
: public TemplateAction<GomspaceDeviceHandler, ParamSetAction, GomspaceCommands> {
|
: public TemplateAction<GomspaceDeviceHandler, ParamSetAction, GOMSPACE::GomspaceCommands> {
|
||||||
public:
|
public:
|
||||||
FSFW_ENUM(ParameterByteSize, uint8_t,
|
FSFW_ENUM(ParameterByteSize, uint8_t,
|
||||||
((ONE_BYTE, 1, "One Byte"))((TWO_BYTES, 2, "Two Bytes"))((FOUR_BYTES, 4, "Four Bytes")))
|
((ONE_BYTE, 1, "One Byte"))((TWO_BYTES, 2, "Two Bytes"))((FOUR_BYTES, 4, "Four Bytes")))
|
||||||
|
|
||||||
ParamSetAction(GomspaceDeviceHandler* owner)
|
ParamSetAction(GomspaceDeviceHandler* owner)
|
||||||
: TemplateAction(owner, GomspaceCommands::PARAM_SET) {}
|
: TemplateAction(owner, GOMSPACE::PARAM_SET) {}
|
||||||
|
|
||||||
Parameter<uint16_t> address = Parameter<uint16_t>::createParameter(this, "Address");
|
Parameter<uint16_t> address = Parameter<uint16_t>::createParameter(this, "Address");
|
||||||
Parameter<uint32_t> parameter = Parameter<uint32_t>::createParameter(this, "Parameter Value");
|
Parameter<uint32_t> parameter = Parameter<uint32_t>::createParameter(this, "Parameter Value");
|
||||||
@ -60,22 +60,22 @@ class ParamSetAction
|
|||||||
};
|
};
|
||||||
|
|
||||||
class RequestHkTableAction
|
class RequestHkTableAction
|
||||||
: public TemplateAction<GomspaceDeviceHandler, RequestHkTableAction, GomspaceCommands> {
|
: public TemplateAction<GomspaceDeviceHandler, RequestHkTableAction, GOMSPACE::GomspaceCommands> {
|
||||||
public:
|
public:
|
||||||
RequestHkTableAction(GomspaceDeviceHandler* owner)
|
RequestHkTableAction(GomspaceDeviceHandler* owner)
|
||||||
: TemplateAction(owner, GomspaceCommands::REQUEST_HK_TABLE) {}
|
: TemplateAction(owner, GOMSPACE::REQUEST_HK_TABLE) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
class PrintSwitchVIAction
|
class PrintSwitchVIAction
|
||||||
: public TemplateAction<GomspaceDeviceHandler, PrintSwitchVIAction, GomspaceCommands> {
|
: public TemplateAction<GomspaceDeviceHandler, PrintSwitchVIAction, GOMSPACE::GomspaceCommands> {
|
||||||
public:
|
public:
|
||||||
PrintSwitchVIAction(GomspaceDeviceHandler* owner)
|
PrintSwitchVIAction(GomspaceDeviceHandler* owner)
|
||||||
: TemplateAction(owner, GomspaceCommands::PRINT_SWITCH_V_I) {}
|
: TemplateAction(owner, GOMSPACE::PRINT_SWITCH_V_I) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
class PrintLatchupsAction
|
class PrintLatchupsAction
|
||||||
: public TemplateAction<GomspaceDeviceHandler, PrintLatchupsAction, GomspaceCommands> {
|
: public TemplateAction<GomspaceDeviceHandler, PrintLatchupsAction, GOMSPACE::GomspaceCommands> {
|
||||||
public:
|
public:
|
||||||
PrintLatchupsAction(GomspaceDeviceHandler* owner)
|
PrintLatchupsAction(GomspaceDeviceHandler* owner)
|
||||||
: TemplateAction(owner, GomspaceCommands::PRINT_LATCHUPS) {}
|
: TemplateAction(owner, GOMSPACE::PRINT_LATCHUPS) {}
|
||||||
};
|
};
|
@ -4,7 +4,7 @@
|
|||||||
#include <fsfw/datapoollocal/LocalPoolVariable.h>
|
#include <fsfw/datapoollocal/LocalPoolVariable.h>
|
||||||
#include <fsfw/datapoollocal/StaticLocalDataSet.h>
|
#include <fsfw/datapoollocal/StaticLocalDataSet.h>
|
||||||
#include <fsfw/devicehandlers/DeviceHandlerIF.h>
|
#include <fsfw/devicehandlers/DeviceHandlerIF.h>
|
||||||
#include <fsfw/introspection/Enum.h>
|
#include <fsfw/introspection/ClasslessEnum.h>
|
||||||
#include <fsfw/power/definitions.h>
|
#include <fsfw/power/definitions.h>
|
||||||
|
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
@ -13,6 +13,18 @@
|
|||||||
|
|
||||||
namespace GOMSPACE {
|
namespace GOMSPACE {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Device commands are derived from the rparam.h of the gomspace lib..
|
||||||
|
* IDs above 50 are reserved for device specific commands.
|
||||||
|
*/
|
||||||
|
FSFW_CLASSLESS_ENUM(
|
||||||
|
GomspaceCommands, DeviceCommandId_t,
|
||||||
|
((PING, 1, "Ping"))((NONE, 2, "None (used internally)"))((REBOOT, 4, "Reboot"))(
|
||||||
|
(GNDWDT_RESET, 9, "Reset Watchdog"))((PARAM_GET, 0, "Get Parameter"))(
|
||||||
|
(PARAM_SET, 255, "Set Parameter"))((REQUEST_HK_TABLE, 16, "Request Housekeeping Table"))(
|
||||||
|
(PRINT_SWITCH_V_I, 32, "Print switch states, voltages and currents to the console"))(
|
||||||
|
(PRINT_LATCHUPS, 33, "Print Latchups to the console")))
|
||||||
|
|
||||||
enum class Pdu { PDU1, PDU2 };
|
enum class Pdu { PDU1, PDU2 };
|
||||||
|
|
||||||
using ChannelSwitchHook = void (*)(Pdu pdu, uint8_t channel, bool on, void* args);
|
using ChannelSwitchHook = void (*)(Pdu pdu, uint8_t channel, bool on, void* args);
|
||||||
@ -29,18 +41,6 @@ static const uint8_t P60_PORT_GNDWDT_RESET = 9;
|
|||||||
|
|
||||||
} // namespace GOMSPACE
|
} // namespace GOMSPACE
|
||||||
|
|
||||||
/**
|
|
||||||
* Device commands are derived from the rparam.h of the gomspace lib..
|
|
||||||
* IDs above 50 are reserved for device specific commands.
|
|
||||||
*/
|
|
||||||
FSFW_ENUM(GomspaceCommands, DeviceCommandId_t,
|
|
||||||
((PING, 1, "Ping"))((NONE, 2, "None (used internally)"))((REBOOT, 4, "Reboot"))(
|
|
||||||
(GNDWDT_RESET, 9, "Reset Watchdog"))((PARAM_GET, 0, "Get Parameter"))(
|
|
||||||
(PARAM_SET, 255, "Set Parameter"))((REQUEST_HK_TABLE, 16,
|
|
||||||
"Request Housekeeping Table"))(
|
|
||||||
(PRINT_SWITCH_V_I, 32, "Print switch states, voltages and currents to the console"))(
|
|
||||||
(PRINT_LATCHUPS, 33, "Print Latchups to the console")))
|
|
||||||
|
|
||||||
namespace P60System {
|
namespace P60System {
|
||||||
|
|
||||||
enum class BatteryModes : uint8_t { CRITICAL = 1, SAFE = 2, NORMAL = 3, FULL = 4 };
|
enum class BatteryModes : uint8_t { CRITICAL = 1, SAFE = 2, NORMAL = 3, FULL = 4 };
|
||||||
|
Loading…
Reference in New Issue
Block a user