merged develop

This commit is contained in:
Jakob.Meier 2021-08-04 13:22:44 +02:00
commit 0315a2a3d5
30 changed files with 105 additions and 68 deletions

View File

@ -1,5 +1,5 @@
#include <fsfw/hal/linux/uart/UartComIF.h>
#include <fsfw/hal/linux/uart/UartCookie.h>
#include <fsfw_hal/linux/uart/UartComIF.h>
#include <fsfw_hal/linux/uart/UartCookie.h>
#include <mission/devices/GPSHyperionHandler.h>
#include "ObjectFactory.h"
@ -31,12 +31,12 @@
#include "fsfw/osal/common/UdpTmTcBridge.h"
#include "fsfw/osal/common/UdpTcPollingTask.h"
#include "fsfw/hal/devicehandlers/GyroL3GD20Handler.h"
#include "fsfw/hal/linux/gpio/LinuxLibgpioIF.h"
#include "fsfw/hal/linux/rpi/GpioRPi.h"
#include "fsfw/hal/common/gpio/GpioCookie.h"
#include "fsfw/hal/linux/spi/SpiCookie.h"
#include "fsfw/hal/linux/spi/SpiComIF.h"
#include "fsfw_hal/devicehandlers/GyroL3GD20Handler.h"
#include "fsfw_hal/linux/gpio/LinuxLibgpioIF.h"
#include "fsfw_hal/linux/rpi/GpioRPi.h"
#include "fsfw_hal/common/gpio/GpioCookie.h"
#include "fsfw_hal/linux/spi/SpiCookie.h"
#include "fsfw_hal/linux/spi/SpiComIF.h"
void Factory::setStaticFrameworkObjectIds() {
PusServiceBase::packetSource = objects::PUS_PACKET_DISTRIBUTOR;

View File

@ -4,6 +4,11 @@
#include <iostream>
#include <cstdlib>
enum SdCard {
SDC0,
SDC1
};
FileSystemTest::FileSystemTest() {
using namespace std;
SdCard sdCard = SdCard::SDC0;

View File

@ -1,11 +1,6 @@
#ifndef BSP_Q7S_BOARDTEST_FILESYSTEMTEST_H_
#define BSP_Q7S_BOARDTEST_FILESYSTEMTEST_H_
enum SdCard {
SDC0,
SDC1
};
class FileSystemTest {
public:
FileSystemTest();

View File

@ -24,8 +24,8 @@ ReturnValue_t Q7STestTask::performOneShotAction() {
//testScratchApi();
//testJsonLibDirect();
//testDummyParams();
FsOpCodes opCode = FsOpCodes::ATTEMPT_DIR_REMOVAL_NON_EMPTY;
testFileSystemHandlerDirect(opCode);
//FsOpCodes opCode = FsOpCodes::ATTEMPT_DIR_REMOVAL_NON_EMPTY;
//testFileSystemHandlerDirect(opCode);
return TestTask::performOneShotAction();
}

View File

@ -23,8 +23,8 @@ CoreController::Chip CoreController::currentChip = Chip::NO_CHIP;
CoreController::Copy CoreController::currentCopy = Copy::NO_COPY;
CoreController::CoreController(object_id_t objectId):
ExtendedControllerBase(objectId, objects::NO_OBJECT, 5),
opDivider(5) {
ExtendedControllerBase(objectId, objects::NO_OBJECT, 5),
opDivider(5) {
ReturnValue_t result = HasReturnvaluesIF::RETURN_OK;
try {
result = initWatchdogFifo();
@ -49,7 +49,7 @@ CoreController::CoreController(object_id_t objectId):
}
ReturnValue_t CoreController::handleCommandMessage(CommandMessage *message) {
return HasReturnvaluesIF::RETURN_OK;
return ExtendedControllerBase::handleCommandMessage(message);
}
void CoreController::performControlOperation() {
@ -74,7 +74,7 @@ ReturnValue_t CoreController::initialize() {
"count failed" << std::endl;
}
return HasReturnvaluesIF::RETURN_OK;
return ExtendedControllerBase::initialize();
}
ReturnValue_t CoreController::checkModeCommand(Mode_t mode, Submode_t submode,
@ -159,8 +159,7 @@ ReturnValue_t CoreController::executeAction(ActionId_t actionId, MessageQueueId_
return actionListDirectoryIntoFile(actionId, commandedBy, data, size);
}
case(REBOOT_OBC): {
return HasReturnvaluesIF::RETURN_OK;
break;
return actionPerformReboot(data, size);
}
default: {
return HasActionsIF::INVALID_ACTION_ID;
@ -457,6 +456,43 @@ void CoreController::initPrint() {
#endif
}
ReturnValue_t CoreController::actionPerformReboot(const uint8_t *data, size_t size) {
if(size < 1) {
return HasActionsIF::INVALID_PARAMETERS;
}
bool rebootSameBootCopy = data[0];
if(rebootSameBootCopy) {
#if OBSW_VERBOSE_LEVEL >= 1
sif::info << "CoreController::actionPerformReboot: Rebooting on current image" << std::endl;
#endif
// Attempt graceful shutdown by unmounting and switching off SD cards
SdCardManager::instance()->switchOffSdCard(sd::SdCard::SLOT_0);
SdCardManager::instance()->switchOffSdCard(sd::SdCard::SLOT_1);
int result = std::system("xsc_boot_copy -r");
if(result != 0) {
utility::handleSystemError(result, "CoreController::executeAction");
return HasReturnvaluesIF::RETURN_FAILED;
}
return HasActionsIF::EXECUTION_FINISHED;
}
if(size < 3) {
return HasActionsIF::INVALID_PARAMETERS;
}
#if OBSW_VERBOSE_LEVEL >= 1
sif::info << "CoreController::actionPerformReboot: Rebooting on " <<
static_cast<int>(data[1]) << " " << static_cast<int>(data[2]) << std::endl;
#endif
// The second byte in data is the target chip, the third byte is the target copy
std::string cmdString = "xsc_boot_copy " + std::to_string(data[1]) + " " +
std::to_string(data[2]);
int result = std::system(cmdString.c_str());
if(result != 0) {
utility::handleSystemError(result, "CoreController::executeAction");
return HasReturnvaluesIF::RETURN_FAILED;
}
return HasActionsIF::EXECUTION_FINISHED;
}
void CoreController::performWatchdogControlOperation() {
// Only perform each fifth iteration
if(watchdogFifoFd != 0 and opDivider.checkAndIncrement()) {

View File

@ -24,7 +24,7 @@ public:
};
static constexpr ActionId_t LIST_DIRECTORY_INTO_FILE = 0;
static constexpr ActionId_t REBOOT_OBC = 1;
static constexpr ActionId_t REBOOT_OBC = 32;
static constexpr uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::CORE;
@ -68,6 +68,7 @@ private:
ReturnValue_t actionListDirectoryIntoFile(ActionId_t actionId, MessageQueueId_t commandedBy,
const uint8_t *data, size_t size);
ReturnValue_t actionPerformReboot(const uint8_t *data, size_t size);
void initPrint();

View File

@ -48,15 +48,15 @@
#include "mission/utility/TmFunnel.h"
#include "linux/obc/CCSDSIPCoreBridge.h"
#include "fsfw/hal/linux/uart/UartComIF.h"
#include "fsfw/hal/linux/uart/UartCookie.h"
#include "fsfw/hal/devicehandlers/GyroL3GD20Handler.h"
#include "fsfw/hal/linux/i2c/I2cCookie.h"
#include "fsfw/hal/linux/i2c/I2cComIF.h"
#include "fsfw/hal/linux/spi/SpiCookie.h"
#include "fsfw/hal/linux/spi/SpiComIF.h"
#include "fsfw/hal/linux/gpio/LinuxLibgpioIF.h"
#include "fsfw/hal/common/gpio/GpioCookie.h"
#include "fsfw_hal/linux/uart/UartComIF.h"
#include "fsfw_hal/linux/uart/UartCookie.h"
#include "fsfw_hal/devicehandlers/GyroL3GD20Handler.h"
#include "fsfw_hal/linux/i2c/I2cCookie.h"
#include "fsfw_hal/linux/i2c/I2cComIF.h"
#include "fsfw_hal/linux/spi/SpiCookie.h"
#include "fsfw_hal/linux/spi/SpiComIF.h"
#include "fsfw_hal/linux/gpio/LinuxLibgpioIF.h"
#include "fsfw_hal/common/gpio/GpioCookie.h"
#include "fsfw/datapoollocal/LocalDataPoolManager.h"
#include "fsfw/tmtcservices/CommandingServiceBase.h"

View File

@ -1,8 +1,8 @@
#include "gpioCallbacks.h"
#include <devices/gpioIds.h>
#include <fsfw/hal/linux/gpio/LinuxLibgpioIF.h>
#include <fsfw/hal/common/gpio/GpioCookie.h>
#include <fsfw_hal/linux/gpio/LinuxLibgpioIF.h>
#include <fsfw_hal/common/gpio/GpioCookie.h>
#include <fsfw/serviceinterface/ServiceInterface.h>

View File

@ -1,8 +1,8 @@
#ifndef LINUX_GPIO_GPIOCALLBACKS_H_
#define LINUX_GPIO_GPIOCALLBACKS_H_
#include <fsfw/hal/common/gpio/gpioDefinitions.h>
#include <fsfw/hal/common/gpio/GpioIF.h>
#include <fsfw_hal/common/gpio/gpioDefinitions.h>
#include <fsfw_hal/common/gpio/GpioIF.h>
namespace gpioCallbacks {

View File

@ -226,7 +226,7 @@ ReturnValue_t FileSystemHandler::removeDirectory(const char *repositoryPath,
else {
// Check error code. Most probably denied permissions because folder is not empty
sif::warning << "FileSystemHandler::removeDirectory: Deleting directory failed with "
"code" << err.value() << ": " << strerror(err.value()) << std::endl;
"code " << err.value() << ": " << strerror(err.value()) << std::endl;
if(err.value() == ENOTEMPTY) {
return DIRECTORY_NOT_EMPTY;
}
@ -242,7 +242,7 @@ ReturnValue_t FileSystemHandler::removeDirectory(const char *repositoryPath,
}
else {
sif::warning << "FileSystemHandler::removeDirectory: Deleting directory failed with "
"code" << err.value() << ": " << strerror(err.value()) << std::endl;
"code " << err.value() << ": " << strerror(err.value()) << std::endl;
// Check error code
if(err.value() == ENOTEMPTY) {
return DIRECTORY_NOT_EMPTY;

View File

@ -1,7 +1,7 @@
#ifndef BSP_Q7S_SPI_Q7SSPICOMIF_H_
#define BSP_Q7S_SPI_Q7SSPICOMIF_H_
#include <fsfw/hal/linux/spi/SpiComIF.h>
#include <fsfw_hal/linux/spi/SpiComIF.h>
/**

View File

@ -1,8 +1,8 @@
#include <bsp_q7s/spiCallbacks/rwSpiCallback.h>
#include <fsfw/serviceinterface/ServiceInterface.h>
#include <mission/devices/RwHandler.h>
#include <fsfw/hal/linux/spi/SpiCookie.h>
#include <fsfw/hal/linux/UnixFileGuard.h>
#include <fsfw_hal/linux/spi/SpiCookie.h>
#include <fsfw_hal/linux/UnixFileGuard.h>
#include "devices/gpioIds.h"
namespace rwSpiCallback {

View File

@ -2,8 +2,8 @@
#define BSP_Q7S_RW_SPI_CALLBACK_H_
#include <fsfw/returnvalues/HasReturnvaluesIF.h>
#include <fsfw/hal/linux/spi/SpiComIF.h>
#include <fsfw/hal/common/gpio/GpioCookie.h>
#include <fsfw_hal/linux/spi/SpiComIF.h>
#include <fsfw_hal/common/gpio/GpioCookie.h>
namespace rwSpiCallback {

View File

@ -5,6 +5,6 @@
// Use TCP instead of UDP for the TMTC bridge. This allows using the TMTC client locally
// because UDP packets are not allowed in the VPN
#define OBSW_USE_TMTC_TCP_BRIDGE 0
#define OBSW_USE_TMTC_TCP_BRIDGE 1
#endif /* COMMON_CONFIG_COMMONCONFIG_H_ */

View File

@ -2,7 +2,7 @@
#define COMMON_CONFIG_SPICONF_H_
#include <cstdint>
#include <fsfw/hal/linux/spi/spiDefinitions.h>
#include <fsfw_hal/linux/spi/spiDefinitions.h>
/**
* SPI configuration will be contained here to let the device handlers remain independent

2
fsfw

@ -1 +1 @@
Subproject commit 296c587e3de10c579847e04af3176b3acaa2d701
Subproject commit bb88490cc6cda5474d1d4913452eeb758da8cc25

View File

@ -2,8 +2,8 @@
#define TEST_TESTTASKS_LIBGPIODTEST_H_
#include "TestTask.h"
#include <fsfw/hal/common/gpio/GpioIF.h>
#include <fsfw/hal/common/gpio/GpioCookie.h>
#include <fsfw_hal/common/gpio/GpioIF.h>
#include <fsfw_hal/common/gpio/GpioCookie.h>
#include <fsfw/objectmanager/SystemObject.h>
/**

View File

@ -8,10 +8,10 @@
#include <fsfw/tasks/TaskFactory.h>
#include <fsfw/timemanager/Stopwatch.h>
#include <fsfw/hal/linux/utility.h>
#include <fsfw/hal/linux/UnixFileGuard.h>
#include <fsfw/hal/common/gpio/gpioDefinitions.h>
#include <fsfw/hal/common/gpio/GpioCookie.h>
#include <fsfw_hal/linux/utility.h>
#include <fsfw_hal/linux/UnixFileGuard.h>
#include <fsfw_hal/common/gpio/gpioDefinitions.h>
#include <fsfw_hal/common/gpio/GpioCookie.h>
#include <linux/spi/spidev.h>
#include <fcntl.h>

View File

@ -1,8 +1,8 @@
#ifndef LINUX_BOARDTEST_SPITESTCLASS_H_
#define LINUX_BOARDTEST_SPITESTCLASS_H_
#include <fsfw/hal/common/gpio/GpioIF.h>
#include <fsfw/hal/linux/spi/SpiCookie.h>
#include <fsfw_hal/common/gpio/GpioIF.h>
#include <fsfw_hal/linux/spi/SpiCookie.h>
#include <test/testtasks/TestTask.h>
#include <vector>

View File

@ -4,7 +4,7 @@
#include <fsfw/objectmanager/ObjectManager.h>
#include <fsfw/ipc/QueueFactory.h>
#include <fsfw/hal/common/gpio/GpioCookie.h>
#include <fsfw_hal/common/gpio/GpioCookie.h>
HeaterHandler::HeaterHandler(object_id_t setObjectId_, object_id_t gpioDriverId_,
CookieIF * gpioCookie_, object_id_t mainLineSwitcherObjectId_, uint8_t mainLineSwitch_) :

View File

@ -11,7 +11,7 @@
#include <fsfw/devicehandlers/DeviceHandlerIF.h>
#include <fsfw/devicehandlers/CookieIF.h>
#include <fsfw/timemanager/Countdown.h>
#include <fsfw/hal/common/gpio/GpioIF.h>
#include <fsfw_hal/common/gpio/GpioIF.h>
#include <unordered_map>
/**

View File

@ -3,7 +3,7 @@
#include <devices/powerSwitcherList.h>
#include <devices/gpioIds.h>
#include <fsfw/hal/common/gpio/GpioCookie.h>
#include <fsfw_hal/common/gpio/GpioCookie.h>
#include <fsfw/ipc/QueueFactory.h>
#include <fsfw/objectmanager/ObjectManager.h>

View File

@ -9,7 +9,7 @@
#include <fsfw/devicehandlers/CookieIF.h>
#include <fsfw/devicehandlers/DeviceHandlerIF.h>
#include <fsfw/timemanager/Countdown.h>
#include <fsfw/hal/common/gpio/GpioIF.h>
#include <fsfw_hal/common/gpio/GpioIF.h>
#include <unordered_map>
/**

View File

@ -2,7 +2,7 @@
#include "OBSWConfig.h"
#include <fsfw/datapool/PoolReadGuard.h>
#include <fsfw/hal/linux/spi/SpiComIF.h>
#include <fsfw_hal/linux/spi/SpiComIF.h>
SusHandler::SusHandler(object_id_t objectId, object_id_t comIF, CookieIF * comCookie,
LinuxLibgpioIF* gpioComIF, gpioId_t chipSelectId) :

View File

@ -3,7 +3,7 @@
#include "devicedefinitions/SusDefinitions.h"
#include <fsfw/devicehandlers/DeviceHandlerBase.h>
#include <fsfw/hal/linux/gpio/LinuxLibgpioIF.h>
#include <fsfw_hal/linux/gpio/LinuxLibgpioIF.h>
/**
* @brief This is the device handler class for the SUS sensor. The sensor is

View File

@ -1,7 +1,7 @@
#ifndef FSFWCONFIG_DEVICES_GPIOIDS_H_
#define FSFWCONFIG_DEVICES_GPIOIDS_H_
#include <fsfw/hal/common/gpio/GpioIF.h>
#include <fsfw_hal/common/gpio/GpioIF.h>
namespace gpioIds {
enum gpioId_t {

View File

@ -3,8 +3,8 @@
#include "OBSWConfig.h"
#include <fsfw/tmtcservices/TmTcBridge.h>
#include <fsfw/hal/common/gpio/gpioDefinitions.h>
#include <fsfw/hal/linux/gpio/LinuxLibgpioIF.h>
#include <fsfw_hal/common/gpio/gpioDefinitions.h>
#include <fsfw_hal/linux/gpio/LinuxLibgpioIF.h>
#include <cstring>

View File

@ -4,10 +4,10 @@
#include "GyroADIS16507Handler.h"
#if OBSW_ADIS16507_LINUX_COM_IF == 1
#include "fsfw/hal/linux/utility.h"
#include "fsfw/hal/linux/spi/SpiCookie.h"
#include "fsfw/hal/linux/spi/SpiComIF.h"
#include "fsfw/hal/linux/UnixFileGuard.h"
#include "fsfw_hal/linux/utility.h"
#include "fsfw_hal/linux/spi/SpiCookie.h"
#include "fsfw_hal/linux/spi/SpiComIF.h"
#include "fsfw_hal/linux/UnixFileGuard.h"
#include <sys/ioctl.h>
#include <unistd.h>
#endif

View File

@ -4,7 +4,7 @@
#include <fsfw/devicehandlers/DeviceHandlerBase.h>
#include <mission/devices/devicedefinitions/PlocSupervisorDefinitions.h>
#include <cstring>
#include <fsfw/hal/linux/uart/UartComIF.h>
#include <fsfw_hal/linux/uart/UartComIF.h>
/**
* @brief This is the device handler for the supervisor of the PLOC which is programmed by

View File

@ -3,7 +3,7 @@
#include <fsfw/devicehandlers/DeviceHandlerBase.h>
#include <mission/devices/devicedefinitions/RwDefinitions.h>
#include <fsfw/hal/linux/gpio/LinuxLibgpioIF.h>
#include <fsfw_hal/linux/gpio/LinuxLibgpioIF.h>
#include <string.h>
/**