Merge pull request 'SCEX test code' (#135) from mueller/scex-test-code into develop
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good

Reviewed-on: #135
Reviewed-by: Jakob.Meier <meierj@irs.uni-stuttgart.de>
This commit is contained in:
Jakob Meier 2022-02-09 14:24:49 +01:00
commit 20f091d54e
11 changed files with 459 additions and 309 deletions

View File

@ -350,18 +350,17 @@ void initmission::createPusTasks(TaskFactory& factory,
void initmission::createTestTasks(TaskFactory& factory,
TaskDeadlineMissedFunction missedDeadlineFunc,
std::vector<PeriodicTaskIF*>& taskVec) {
#if OBSW_ADD_TEST_TASK == 1 || OBSW_ADD_SPI_TEST_CODE == 1 || OBSW_ADD_I2C_TEST_CODE == 1 || \
(BOARD_TE0720 == 1 && OBSW_TEST_LIBGPIOD == 1)
#if OBSW_ADD_TEST_TASK == 1 && OBSW_ADD_TEST_CODE == 1
ReturnValue_t result = HasReturnvaluesIF::RETURN_OK;
#endif
static_cast<void>(result); // supress warning in case it is not used
PeriodicTaskIF* testTask = factory.createPeriodicTask(
"TEST_TASK", 60, PeriodicTaskIF::MINIMUM_STACK_SIZE, 1, missedDeadlineFunc);
#if OBSW_ADD_TEST_TASK == 1
result = testTask->addComponent(objects::TEST_TASK);
if (result != HasReturnvaluesIF::RETURN_OK) {
initmission::printAddObjectError("TEST_TASK", objects::TEST_TASK);
}
#endif /* OBSW_ADD_TEST_TASK == 1 */
#if OBSW_ADD_SPI_TEST_CODE == 1
result = testTask->addComponent(objects::SPI_TEST);
@ -375,6 +374,13 @@ void initmission::createTestTasks(TaskFactory& factory,
initmission::printAddObjectError("I2C_TEST", objects::I2C_TEST);
}
#endif
#if OBSW_ADD_UART_TEST_CODE == 1
result = testTask->addComponent(objects::UART_TEST);
if (result != HasReturnvaluesIF::RETURN_OK) {
initmission::printAddObjectError("UART_TEST", objects::UART_TEST);
}
#endif
#if BOARD_TE0720 == 1 && OBSW_TEST_LIBGPIOD == 1
result = testTask->addComponent(objects::LIBGPIOD_TEST);
if (result != HasReturnvaluesIF::RETURN_OK) {
@ -382,4 +388,6 @@ void initmission::createTestTasks(TaskFactory& factory,
}
#endif /* BOARD_TE0720 == 1 && OBSW_TEST_LIBGPIOD == 1 */
taskVec.push_back(testTask);
#endif // OBSW_ADD_TEST_TASK == 1 && OBSW_ADD_TEST_CODE == 1
}

View File

@ -1,6 +1,7 @@
#include "ObjectFactory.h"
#include <linux/boardtest/I2cTestClass.h>
#include <linux/boardtest/UartTestClass.h>
#include <sstream>
@ -1135,4 +1136,7 @@ void ObjectFactory::createTestComponents(LinuxLibgpioIF* gpioComIF) {
#if OBSW_ADD_I2C_TEST_CODE == 1
new I2cTestClass(objects::I2C_TEST, q7s::I2C_DEFAULT_DEV);
#endif
#if OBSW_ADD_UART_TEST_CODE == 1
new UartTestClass(objects::UART_TEST);
#endif
}

View File

@ -1,4 +1,6 @@
#include "UartTestClass.h"
#include <fsfw/tasks/TaskFactory.h>
#if defined(RASPBERRY_PI)
#include "rpiConfig.h"
#elif defined(XIPHOS_Q7S)
@ -9,18 +11,22 @@
#include <fcntl.h> // Contains file controls like O_RDWR
#include <unistd.h> // write(), read(), close()
#include "fsfw/serviceinterface/ServiceInterface.h"
#include "lwgps/lwgps.h"
#include "fsfw/globalfunctions/CRC.h"
#include "fsfw/globalfunctions/DleEncoder.h"
#include "fsfw/globalfunctions/arrayprinter.h"
#include "fsfw/serviceinterface.h"
#include "mission/devices/devicedefinitions/SCEXDefinitions.h"
#define GPS_REPLY_WIRETAPPING 0
UartTestClass::UartTestClass(object_id_t objectId) : TestTask(objectId) {}
UartTestClass::UartTestClass(object_id_t objectId) : TestTask(objectId) { mode = TestModes::SCEX; }
ReturnValue_t UartTestClass::initialize() {
if (mode == TestModes::GPS) {
gpsInit();
} else if (mode == TestModes::SCEX) {
scexInit();
}
return HasReturnvaluesIF::RETURN_OK;
}
@ -29,6 +35,8 @@ ReturnValue_t UartTestClass::performOneShotAction() { return HasReturnvaluesIF::
ReturnValue_t UartTestClass::performPeriodicAction() {
if (mode == TestModes::GPS) {
gpsPeriodic();
} else if (mode == TestModes::SCEX) {
scexPeriodic();
}
return HasReturnvaluesIF::RETURN_OK;
}
@ -118,3 +126,96 @@ void UartTestClass::gpsPeriodic() {
} while (bytesRead > 0);
#endif
}
void UartTestClass::scexInit() {
#if defined(RASPBERRY_PI)
std::string devname = "/dev/ttyUSB1";
#else
std::string devname = "/dev/ul-scex";
#endif
/* Get file descriptor */
serialPort = open(devname.c_str(), O_RDWR);
if (serialPort < 0) {
sif::warning << "open call failed with error [" << errno << ", " << strerror(errno)
<< std::endl;
return;
}
// Setting up UART parameters
tty.c_cflag &= ~PARENB; // Clear parity bit
tty.c_cflag &= ~CSTOPB; // Clear stop field, only one stop bit used in communication
tty.c_cflag &= ~CSIZE; // Clear all the size bits
tty.c_cflag |= CS8; // 8 bits per byte
tty.c_cflag &= ~CRTSCTS; // Disable RTS/CTS hardware flow control
tty.c_cflag |= CREAD | CLOCAL; // Turn on READ & ignore ctrl lines (CLOCAL = 1)
// Use non-canonical mode and clear echo flag
tty.c_lflag &= ~(ICANON | ECHO);
// Non-blocking mode, read until either line is 0.1 second idle or maximum of 255 bytes are
// received in one go
tty.c_cc[VTIME] = 1; // In units of 0.1 seconds
tty.c_cc[VMIN] = 255; // Read up to 255 bytes
if (tcsetattr(serialPort, TCSANOW, &tty) != 0) {
sif::warning << "tcsetattr call failed with error [" << errno << ", " << strerror(errno)
<< std::endl;
}
// Flush received and unread data
tcflush(serialPort, TCIFLUSH);
}
void UartTestClass::scexPeriodic() {
auto dleEncoder = DleEncoder();
std::array<uint8_t, 128> tmpCmdBuf = {};
// Send ping command
tmpCmdBuf[0] = scex::CMD_PING;
// These two fields are the packet counter and the total packet count. Those are 1 and 1 for each
// telecommand so far
tmpCmdBuf[1] = 1;
tmpCmdBuf[2] = 1;
uint16_t userDataLen = 0;
tmpCmdBuf[3] = (userDataLen >> 8) & 0xff;
tmpCmdBuf[4] = userDataLen & 0xff;
uint16_t crc = CRC::crc16ccitt(tmpCmdBuf.data(), 5);
tmpCmdBuf[5] = (crc >> 8) & 0xff;
tmpCmdBuf[6] = crc & 0xff;
size_t encodedLen = 0;
ReturnValue_t result =
dleEncoder.encode(tmpCmdBuf.data(), 7, cmdBuf.data(), cmdBuf.size(), &encodedLen, true);
if (result != HasReturnvaluesIF::RETURN_OK) {
sif::warning << "UartTestClass::scexInit: Encoding failed" << std::endl;
return;
}
arrayprinter::print(cmdBuf.data(), 9);
size_t bytesWritten = write(serialPort, cmdBuf.data(), encodedLen);
if (bytesWritten != encodedLen) {
sif::warning << "Sending ping command to solar experiment failed" << std::endl;
}
TaskFactory::delayTask(20);
bytesWritten = write(serialPort, cmdBuf.data(), encodedLen);
if (bytesWritten != encodedLen) {
sif::warning << "Sending ping command to solar experiment failed" << std::endl;
}
// Read back reply immediately
int bytesRead = 0;
do {
bytesRead = read(serialPort, reinterpret_cast<void*>(recBuf.data()),
static_cast<unsigned int>(recBuf.size()));
if (bytesRead < 0) {
sif::warning << "UartTestClass::performPeriodicAction: read call failed with error [" << errno
<< ", " << strerror(errno) << "]" << std::endl;
break;
} else if (bytesRead >= static_cast<int>(recBuf.size())) {
sif::debug << "UartTestClass::performPeriodicAction: "
"recv buffer might not be large enough"
<< std::endl;
} else if (bytesRead > 0) {
sif::info << "Received " << bytesRead << " from the Solar Cell Experiment:" << std::endl;
arrayprinter::print(recBuf.data(), bytesRead);
}
} while (bytesRead > 0);
}

View File

@ -20,16 +20,20 @@ class UartTestClass : public TestTask {
enum TestModes {
GPS,
// Solar Cell Experiment
SCE
SCEX
};
void gpsInit();
void gpsPeriodic();
void scexInit();
void scexPeriodic();
TestModes mode = TestModes::GPS;
lwgps_t gpsData = {};
struct termios tty = {};
int serialPort = 0;
std::array<uint8_t, 512> recBuf;
std::array<uint8_t, 64> cmdBuf = {};
std::array<uint8_t, 4096> recBuf = {};
uint8_t recvCnt = 0;
};

View File

@ -68,12 +68,14 @@ debugging. */
#define OBSW_SYRLINKS_SIMULATED 1
#define OBSW_ADD_TEST_CODE 0
#define OBSW_ADD_TEST_TASK 0
#define OBSW_ADD_TEST_PST 0
// If this is enabled, all other SPI code should be disabled
#define OBSW_ADD_SPI_TEST_CODE 0
// If this is enabled, all other I2C code should be disabled
#define OBSW_ADD_I2C_TEST_CODE 0
#define OBSW_ADD_TEST_PST 0
#define OBSW_ADD_TEST_TASK 0
#define OBSW_ADD_UART_TEST_CODE 0
#define OBSW_TEST_LIBGPIOD 0
#define OBSW_TEST_RADIATION_SENSOR_HANDLER 0
#define OBSW_TEST_SUS_HANDLER 0

View File

@ -146,290 +146,290 @@ const char *STR_HELPER_FILE_NOT_EXISTS_STRING = "STR_HELPER_FILE_NOT_EXISTS";
const char *STR_HELPER_SENDING_PACKET_FAILED_STRING = "STR_HELPER_SENDING_PACKET_FAILED";
const char *STR_HELPER_REQUESTING_MSG_FAILED_STRING = "STR_HELPER_REQUESTING_MSG_FAILED";
const char * translateEvents(Event event) {
switch( (event & 0xffff) ) {
case(2200):
return STORE_SEND_WRITE_FAILED_STRING;
case(2201):
return STORE_WRITE_FAILED_STRING;
case(2202):
return STORE_SEND_READ_FAILED_STRING;
case(2203):
return STORE_READ_FAILED_STRING;
case(2204):
return UNEXPECTED_MSG_STRING;
case(2205):
return STORING_FAILED_STRING;
case(2206):
return TM_DUMP_FAILED_STRING;
case(2207):
return STORE_INIT_FAILED_STRING;
case(2208):
return STORE_INIT_EMPTY_STRING;
case(2209):
return STORE_CONTENT_CORRUPTED_STRING;
case(2210):
return STORE_INITIALIZE_STRING;
case(2211):
return INIT_DONE_STRING;
case(2212):
return DUMP_FINISHED_STRING;
case(2213):
return DELETION_FINISHED_STRING;
case(2214):
return DELETION_FAILED_STRING;
case(2215):
return AUTO_CATALOGS_SENDING_FAILED_STRING;
case(2600):
return GET_DATA_FAILED_STRING;
case(2601):
return STORE_DATA_FAILED_STRING;
case(2800):
return DEVICE_BUILDING_COMMAND_FAILED_STRING;
case(2801):
return DEVICE_SENDING_COMMAND_FAILED_STRING;
case(2802):
return DEVICE_REQUESTING_REPLY_FAILED_STRING;
case(2803):
return DEVICE_READING_REPLY_FAILED_STRING;
case(2804):
return DEVICE_INTERPRETING_REPLY_FAILED_STRING;
case(2805):
return DEVICE_MISSED_REPLY_STRING;
case(2806):
return DEVICE_UNKNOWN_REPLY_STRING;
case(2807):
return DEVICE_UNREQUESTED_REPLY_STRING;
case(2808):
return INVALID_DEVICE_COMMAND_STRING;
case(2809):
return MONITORING_LIMIT_EXCEEDED_STRING;
case(2810):
return MONITORING_AMBIGUOUS_STRING;
case(2811):
return DEVICE_WANTS_HARD_REBOOT_STRING;
case(4201):
return FUSE_CURRENT_HIGH_STRING;
case(4202):
return FUSE_WENT_OFF_STRING;
case(4204):
return POWER_ABOVE_HIGH_LIMIT_STRING;
case(4205):
return POWER_BELOW_LOW_LIMIT_STRING;
case(4300):
return SWITCH_WENT_OFF_STRING;
case(5000):
return HEATER_ON_STRING;
case(5001):
return HEATER_OFF_STRING;
case(5002):
return HEATER_TIMEOUT_STRING;
case(5003):
return HEATER_STAYED_ON_STRING;
case(5004):
return HEATER_STAYED_OFF_STRING;
case(5200):
return TEMP_SENSOR_HIGH_STRING;
case(5201):
return TEMP_SENSOR_LOW_STRING;
case(5202):
return TEMP_SENSOR_GRADIENT_STRING;
case(5901):
return COMPONENT_TEMP_LOW_STRING;
case(5902):
return COMPONENT_TEMP_HIGH_STRING;
case(5903):
return COMPONENT_TEMP_OOL_LOW_STRING;
case(5904):
return COMPONENT_TEMP_OOL_HIGH_STRING;
case(5905):
return TEMP_NOT_IN_OP_RANGE_STRING;
case(7101):
return FDIR_CHANGED_STATE_STRING;
case(7102):
return FDIR_STARTS_RECOVERY_STRING;
case(7103):
return FDIR_TURNS_OFF_DEVICE_STRING;
case(7201):
return MONITOR_CHANGED_STATE_STRING;
case(7202):
return VALUE_BELOW_LOW_LIMIT_STRING;
case(7203):
return VALUE_ABOVE_HIGH_LIMIT_STRING;
case(7204):
return VALUE_OUT_OF_RANGE_STRING;
case(7400):
return CHANGING_MODE_STRING;
case(7401):
return MODE_INFO_STRING;
case(7402):
return FALLBACK_FAILED_STRING;
case(7403):
return MODE_TRANSITION_FAILED_STRING;
case(7404):
return CANT_KEEP_MODE_STRING;
case(7405):
return OBJECT_IN_INVALID_MODE_STRING;
case(7406):
return FORCING_MODE_STRING;
case(7407):
return MODE_CMD_REJECTED_STRING;
case(7506):
return HEALTH_INFO_STRING;
case(7507):
return CHILD_CHANGED_HEALTH_STRING;
case(7508):
return CHILD_PROBLEMS_STRING;
case(7509):
return OVERWRITING_HEALTH_STRING;
case(7510):
return TRYING_RECOVERY_STRING;
case(7511):
return RECOVERY_STEP_STRING;
case(7512):
return RECOVERY_DONE_STRING;
case(7900):
return RF_AVAILABLE_STRING;
case(7901):
return RF_LOST_STRING;
case(7902):
return BIT_LOCK_STRING;
case(7903):
return BIT_LOCK_LOST_STRING;
case(7905):
return FRAME_PROCESSING_FAILED_STRING;
case(8900):
return CLOCK_SET_STRING;
case(8901):
return CLOCK_SET_FAILURE_STRING;
case(9700):
return TEST_STRING;
case(10600):
return CHANGE_OF_SETUP_PARAMETER_STRING;
case(10900):
return GPIO_PULL_HIGH_FAILED_STRING;
case(10901):
return GPIO_PULL_LOW_FAILED_STRING;
case(10902):
return SWITCH_ALREADY_ON_STRING;
case(10903):
return SWITCH_ALREADY_OFF_STRING;
case(10904):
return MAIN_SWITCH_TIMEOUT_STRING;
case(11000):
return MAIN_SWITCH_ON_TIMEOUT_STRING;
case(11001):
return MAIN_SWITCH_OFF_TIMEOUT_STRING;
case(11002):
return DEPLOYMENT_FAILED_STRING;
case(11003):
return DEPL_SA1_GPIO_SWTICH_ON_FAILED_STRING;
case(11004):
return DEPL_SA2_GPIO_SWTICH_ON_FAILED_STRING;
case(11101):
return MEMORY_READ_RPT_CRC_FAILURE_STRING;
case(11102):
return ACK_FAILURE_STRING;
case(11103):
return EXE_FAILURE_STRING;
case(11104):
return CRC_FAILURE_EVENT_STRING;
case(11201):
return SELF_TEST_I2C_FAILURE_STRING;
case(11202):
return SELF_TEST_SPI_FAILURE_STRING;
case(11203):
return SELF_TEST_ADC_FAILURE_STRING;
case(11204):
return SELF_TEST_PWM_FAILURE_STRING;
case(11205):
return SELF_TEST_TC_FAILURE_STRING;
case(11206):
return SELF_TEST_MTM_RANGE_FAILURE_STRING;
case(11207):
return SELF_TEST_COIL_CURRENT_FAILURE_STRING;
case(11208):
return INVALID_ERROR_BYTE_STRING;
case(11301):
return ERROR_STATE_STRING;
case(11501):
return SUPV_MEMORY_READ_RPT_CRC_FAILURE_STRING;
case(11502):
return SUPV_ACK_FAILURE_STRING;
case(11503):
return SUPV_EXE_FAILURE_STRING;
case(11504):
return SUPV_CRC_FAILURE_EVENT_STRING;
case(11600):
return SANITIZATION_FAILED_STRING;
case(11700):
return UPDATE_FILE_NOT_EXISTS_STRING;
case(11701):
return ACTION_COMMANDING_FAILED_STRING;
case(11702):
return UPDATE_AVAILABLE_FAILED_STRING;
case(11703):
return UPDATE_TRANSFER_FAILED_STRING;
case(11704):
return UPDATE_VERIFY_FAILED_STRING;
case(11705):
return UPDATE_FINISHED_STRING;
case(11800):
return SEND_MRAM_DUMP_FAILED_STRING;
case(11801):
return MRAM_DUMP_FAILED_STRING;
case(11802):
return MRAM_DUMP_FINISHED_STRING;
case(11901):
return INVALID_TC_FRAME_STRING;
case(11902):
return INVALID_FAR_STRING;
case(11903):
return CARRIER_LOCK_STRING;
case(11904):
return BIT_LOCK_PDEC_STRING;
case(12000):
return IMAGE_UPLOAD_FAILED_STRING;
case(12001):
return IMAGE_DOWNLOAD_FAILED_STRING;
case(12002):
return IMAGE_UPLOAD_SUCCESSFUL_STRING;
case(12003):
return IMAGE_DOWNLOAD_SUCCESSFUL_STRING;
case(12004):
return FLASH_WRITE_SUCCESSFUL_STRING;
case(12005):
return FLASH_READ_SUCCESSFUL_STRING;
case(12006):
return FLASH_WRITE_FAILED_STRING;
case(12007):
return FLASH_READ_FAILED_STRING;
case(12008):
return FPGA_DOWNLOAD_SUCCESSFUL_STRING;
case(12009):
return FPGA_DOWNLOAD_FAILED_STRING;
case(12010):
return FPGA_UPLOAD_SUCCESSFUL_STRING;
case(12011):
return FPGA_UPLOAD_FAILED_STRING;
case(12012):
return STR_HELPER_READING_REPLY_FAILED_STRING;
case(12013):
return STR_HELPER_COM_ERROR_STRING;
case(12014):
return STR_HELPER_NO_REPLY_STRING;
case(12015):
return STR_HELPER_DEC_ERROR_STRING;
case(12016):
return POSITION_MISMATCH_STRING;
case(12017):
return STR_HELPER_FILE_NOT_EXISTS_STRING;
case(12018):
return STR_HELPER_SENDING_PACKET_FAILED_STRING;
case(12019):
return STR_HELPER_REQUESTING_MSG_FAILED_STRING;
default:
return "UNKNOWN_EVENT";
const char *translateEvents(Event event) {
switch ((event & 0xffff)) {
case (2200):
return STORE_SEND_WRITE_FAILED_STRING;
case (2201):
return STORE_WRITE_FAILED_STRING;
case (2202):
return STORE_SEND_READ_FAILED_STRING;
case (2203):
return STORE_READ_FAILED_STRING;
case (2204):
return UNEXPECTED_MSG_STRING;
case (2205):
return STORING_FAILED_STRING;
case (2206):
return TM_DUMP_FAILED_STRING;
case (2207):
return STORE_INIT_FAILED_STRING;
case (2208):
return STORE_INIT_EMPTY_STRING;
case (2209):
return STORE_CONTENT_CORRUPTED_STRING;
case (2210):
return STORE_INITIALIZE_STRING;
case (2211):
return INIT_DONE_STRING;
case (2212):
return DUMP_FINISHED_STRING;
case (2213):
return DELETION_FINISHED_STRING;
case (2214):
return DELETION_FAILED_STRING;
case (2215):
return AUTO_CATALOGS_SENDING_FAILED_STRING;
case (2600):
return GET_DATA_FAILED_STRING;
case (2601):
return STORE_DATA_FAILED_STRING;
case (2800):
return DEVICE_BUILDING_COMMAND_FAILED_STRING;
case (2801):
return DEVICE_SENDING_COMMAND_FAILED_STRING;
case (2802):
return DEVICE_REQUESTING_REPLY_FAILED_STRING;
case (2803):
return DEVICE_READING_REPLY_FAILED_STRING;
case (2804):
return DEVICE_INTERPRETING_REPLY_FAILED_STRING;
case (2805):
return DEVICE_MISSED_REPLY_STRING;
case (2806):
return DEVICE_UNKNOWN_REPLY_STRING;
case (2807):
return DEVICE_UNREQUESTED_REPLY_STRING;
case (2808):
return INVALID_DEVICE_COMMAND_STRING;
case (2809):
return MONITORING_LIMIT_EXCEEDED_STRING;
case (2810):
return MONITORING_AMBIGUOUS_STRING;
case (2811):
return DEVICE_WANTS_HARD_REBOOT_STRING;
case (4201):
return FUSE_CURRENT_HIGH_STRING;
case (4202):
return FUSE_WENT_OFF_STRING;
case (4204):
return POWER_ABOVE_HIGH_LIMIT_STRING;
case (4205):
return POWER_BELOW_LOW_LIMIT_STRING;
case (4300):
return SWITCH_WENT_OFF_STRING;
case (5000):
return HEATER_ON_STRING;
case (5001):
return HEATER_OFF_STRING;
case (5002):
return HEATER_TIMEOUT_STRING;
case (5003):
return HEATER_STAYED_ON_STRING;
case (5004):
return HEATER_STAYED_OFF_STRING;
case (5200):
return TEMP_SENSOR_HIGH_STRING;
case (5201):
return TEMP_SENSOR_LOW_STRING;
case (5202):
return TEMP_SENSOR_GRADIENT_STRING;
case (5901):
return COMPONENT_TEMP_LOW_STRING;
case (5902):
return COMPONENT_TEMP_HIGH_STRING;
case (5903):
return COMPONENT_TEMP_OOL_LOW_STRING;
case (5904):
return COMPONENT_TEMP_OOL_HIGH_STRING;
case (5905):
return TEMP_NOT_IN_OP_RANGE_STRING;
case (7101):
return FDIR_CHANGED_STATE_STRING;
case (7102):
return FDIR_STARTS_RECOVERY_STRING;
case (7103):
return FDIR_TURNS_OFF_DEVICE_STRING;
case (7201):
return MONITOR_CHANGED_STATE_STRING;
case (7202):
return VALUE_BELOW_LOW_LIMIT_STRING;
case (7203):
return VALUE_ABOVE_HIGH_LIMIT_STRING;
case (7204):
return VALUE_OUT_OF_RANGE_STRING;
case (7400):
return CHANGING_MODE_STRING;
case (7401):
return MODE_INFO_STRING;
case (7402):
return FALLBACK_FAILED_STRING;
case (7403):
return MODE_TRANSITION_FAILED_STRING;
case (7404):
return CANT_KEEP_MODE_STRING;
case (7405):
return OBJECT_IN_INVALID_MODE_STRING;
case (7406):
return FORCING_MODE_STRING;
case (7407):
return MODE_CMD_REJECTED_STRING;
case (7506):
return HEALTH_INFO_STRING;
case (7507):
return CHILD_CHANGED_HEALTH_STRING;
case (7508):
return CHILD_PROBLEMS_STRING;
case (7509):
return OVERWRITING_HEALTH_STRING;
case (7510):
return TRYING_RECOVERY_STRING;
case (7511):
return RECOVERY_STEP_STRING;
case (7512):
return RECOVERY_DONE_STRING;
case (7900):
return RF_AVAILABLE_STRING;
case (7901):
return RF_LOST_STRING;
case (7902):
return BIT_LOCK_STRING;
case (7903):
return BIT_LOCK_LOST_STRING;
case (7905):
return FRAME_PROCESSING_FAILED_STRING;
case (8900):
return CLOCK_SET_STRING;
case (8901):
return CLOCK_SET_FAILURE_STRING;
case (9700):
return TEST_STRING;
case (10600):
return CHANGE_OF_SETUP_PARAMETER_STRING;
case (10900):
return GPIO_PULL_HIGH_FAILED_STRING;
case (10901):
return GPIO_PULL_LOW_FAILED_STRING;
case (10902):
return SWITCH_ALREADY_ON_STRING;
case (10903):
return SWITCH_ALREADY_OFF_STRING;
case (10904):
return MAIN_SWITCH_TIMEOUT_STRING;
case (11000):
return MAIN_SWITCH_ON_TIMEOUT_STRING;
case (11001):
return MAIN_SWITCH_OFF_TIMEOUT_STRING;
case (11002):
return DEPLOYMENT_FAILED_STRING;
case (11003):
return DEPL_SA1_GPIO_SWTICH_ON_FAILED_STRING;
case (11004):
return DEPL_SA2_GPIO_SWTICH_ON_FAILED_STRING;
case (11101):
return MEMORY_READ_RPT_CRC_FAILURE_STRING;
case (11102):
return ACK_FAILURE_STRING;
case (11103):
return EXE_FAILURE_STRING;
case (11104):
return CRC_FAILURE_EVENT_STRING;
case (11201):
return SELF_TEST_I2C_FAILURE_STRING;
case (11202):
return SELF_TEST_SPI_FAILURE_STRING;
case (11203):
return SELF_TEST_ADC_FAILURE_STRING;
case (11204):
return SELF_TEST_PWM_FAILURE_STRING;
case (11205):
return SELF_TEST_TC_FAILURE_STRING;
case (11206):
return SELF_TEST_MTM_RANGE_FAILURE_STRING;
case (11207):
return SELF_TEST_COIL_CURRENT_FAILURE_STRING;
case (11208):
return INVALID_ERROR_BYTE_STRING;
case (11301):
return ERROR_STATE_STRING;
case (11501):
return SUPV_MEMORY_READ_RPT_CRC_FAILURE_STRING;
case (11502):
return SUPV_ACK_FAILURE_STRING;
case (11503):
return SUPV_EXE_FAILURE_STRING;
case (11504):
return SUPV_CRC_FAILURE_EVENT_STRING;
case (11600):
return SANITIZATION_FAILED_STRING;
case (11700):
return UPDATE_FILE_NOT_EXISTS_STRING;
case (11701):
return ACTION_COMMANDING_FAILED_STRING;
case (11702):
return UPDATE_AVAILABLE_FAILED_STRING;
case (11703):
return UPDATE_TRANSFER_FAILED_STRING;
case (11704):
return UPDATE_VERIFY_FAILED_STRING;
case (11705):
return UPDATE_FINISHED_STRING;
case (11800):
return SEND_MRAM_DUMP_FAILED_STRING;
case (11801):
return MRAM_DUMP_FAILED_STRING;
case (11802):
return MRAM_DUMP_FINISHED_STRING;
case (11901):
return INVALID_TC_FRAME_STRING;
case (11902):
return INVALID_FAR_STRING;
case (11903):
return CARRIER_LOCK_STRING;
case (11904):
return BIT_LOCK_PDEC_STRING;
case (12000):
return IMAGE_UPLOAD_FAILED_STRING;
case (12001):
return IMAGE_DOWNLOAD_FAILED_STRING;
case (12002):
return IMAGE_UPLOAD_SUCCESSFUL_STRING;
case (12003):
return IMAGE_DOWNLOAD_SUCCESSFUL_STRING;
case (12004):
return FLASH_WRITE_SUCCESSFUL_STRING;
case (12005):
return FLASH_READ_SUCCESSFUL_STRING;
case (12006):
return FLASH_WRITE_FAILED_STRING;
case (12007):
return FLASH_READ_FAILED_STRING;
case (12008):
return FPGA_DOWNLOAD_SUCCESSFUL_STRING;
case (12009):
return FPGA_DOWNLOAD_FAILED_STRING;
case (12010):
return FPGA_UPLOAD_SUCCESSFUL_STRING;
case (12011):
return FPGA_UPLOAD_FAILED_STRING;
case (12012):
return STR_HELPER_READING_REPLY_FAILED_STRING;
case (12013):
return STR_HELPER_COM_ERROR_STRING;
case (12014):
return STR_HELPER_NO_REPLY_STRING;
case (12015):
return STR_HELPER_DEC_ERROR_STRING;
case (12016):
return POSITION_MISMATCH_STRING;
case (12017):
return STR_HELPER_FILE_NOT_EXISTS_STRING;
case (12018):
return STR_HELPER_SENDING_PACKET_FAILED_STRING;
case (12019):
return STR_HELPER_REQUESTING_MSG_FAILED_STRING;
default:
return "UNKNOWN_EVENT";
}
return 0;
}

View File

@ -3,6 +3,6 @@
#include "fsfw/events/Event.h"
const char * translateEvents(Event event);
const char* translateEvents(Event event);
#endif /* FSFWCONFIG_EVENTS_TRANSLATEEVENTS_H_ */

View File

@ -0,0 +1,13 @@
#ifndef MISSION_DEVICES_DEVICEDEFINITIONS_SCEXDEFINITIONS_H_
#define MISSION_DEVICES_DEVICEDEFINITIONS_SCEXDEFINITIONS_H_
#include <cstdint>
// Definitions for the Solar Cell Experiment
namespace scex {
static constexpr uint8_t CMD_PING = 0x4e;
}
#endif /* MISSION_DEVICES_DEVICEDEFINITIONS_SCEXDEFINITIONS_H_ */

View File

@ -49,6 +49,13 @@ def handle_args():
action="store_true",
help="Copy from Q7S to host instead. Always copies to current directory.",
)
parser.add_argument(
"-f",
"--flatsat",
default=False,
action="store_true",
help="Copy to flatsat instead"
)
# Positional argument(s)
parser.add_argument(
"source", help="Source files to copy or target files to copy back to host"
@ -61,17 +68,28 @@ def build_cmd(args):
cmd = "scp "
if args.recursive:
cmd += "-r "
address = ""
port_args = ""
target = args.target
if args.invert and target == "":
target = "."
elif target == "":
target = f"/tmp"
if args.invert:
cmd += f"-P {args.port} root@localhost:{args.source} {target}"
if args.flatsat:
address = "eive@flatsat.eive.absatvirt.lw"
else:
cmd += f"-P {args.port} {args.source} root@localhost:{target}"
if args.target:
cmd += args.target
address = "root@localhost"
port_args=f"-P {args.port}"
if args.invert:
if target == "":
target = "."
else:
target = args.target
else:
if target == "":
target = f"/tmp"
else:
target = args.target
if args.invert:
cmd += f"{port_args} {address}:{args.source} {target}"
else:
cmd += f"{port_args} {args.source} {address}:{target}"
return cmd

@ -1 +1 @@
Subproject commit 2d10c6b85ea4cab4f4baf1918c51d54eee4202c2
Subproject commit 5d5e46b09bbd5208176c68d94c798493e705a2ee

2
tmtc

@ -1 +1 @@
Subproject commit 84c2730836e6821ff089d7567018fe4ffded62db
Subproject commit 6a78311239bdf78040e43ef217035fcaa2ab9f3b