diff --git a/bsp_q7s/core/ObjectFactory.cpp b/bsp_q7s/core/ObjectFactory.cpp index 9815c1d3..77d3207e 100644 --- a/bsp_q7s/core/ObjectFactory.cpp +++ b/bsp_q7s/core/ObjectFactory.cpp @@ -144,9 +144,8 @@ void ObjectFactory::produce(void* args) { new IMTQHandler(objects::IMTQ_HANDLER, objects::I2C_COM_IF, imtqI2cCookie); createReactionWheelComponents(gpioComIF); - I2cCookie* bpxI2cCookie = - new I2cCookie(addresses::BPX_BATTERY, 100, q7s::I2C_DEFAULT_DEV); - + I2cCookie* bpxI2cCookie = new I2cCookie(addresses::BPX_BATTERY, 100, q7s::I2C_DEFAULT_DEV); + (void)bpxI2cCookie; #if OBSW_ADD_PLOC_MPSOC == 1 UartCookie* plocMpsocCookie = new UartCookie(objects::PLOC_MPSOC_HANDLER, q7s::UART_PLOC_MPSOC_DEV, diff --git a/linux/obc/PtmeIF.h b/linux/obc/PtmeIF.h index 5488fbfb..77e976e0 100644 --- a/linux/obc/PtmeIF.h +++ b/linux/obc/PtmeIF.h @@ -1,10 +1,10 @@ #ifndef LINUX_OBC_PTMEIF_H_ #define LINUX_OBC_PTMEIF_H_ -#include "fsfw/returnvalues/HasReturnvaluesIF.h" - #include +#include "fsfw/returnvalues/HasReturnvaluesIF.h" + /** * @brief Interface class for managing the PTME IP Core implemented in the programmable logic. * diff --git a/mission/devices/BpxBatteryHandler.cpp b/mission/devices/BpxBatteryHandler.cpp new file mode 100644 index 00000000..7d504105 --- /dev/null +++ b/mission/devices/BpxBatteryHandler.cpp @@ -0,0 +1,47 @@ +#include "BpxBatteryHandler.h" + +BpxBatteryHandler::BpxBatteryHandler(object_id_t objectId, object_id_t comIF, CookieIF* comCookie) + : DeviceHandlerBase(objectId, comIF, comCookie) {} + +BpxBatteryHandler::~BpxBatteryHandler() {} + +void BpxBatteryHandler::doStartUp() {} + +void BpxBatteryHandler::doShutDown() {} + +ReturnValue_t BpxBatteryHandler::buildNormalDeviceCommand(DeviceCommandId_t* id) { + return HasReturnvaluesIF::RETURN_OK; +} + +ReturnValue_t BpxBatteryHandler::buildTransitionDeviceCommand(DeviceCommandId_t* id) { + return HasReturnvaluesIF::RETURN_OK; +} + +void BpxBatteryHandler::fillCommandAndReplyMap() {} + +ReturnValue_t BpxBatteryHandler::buildCommandFromCommand(DeviceCommandId_t deviceCommand, + const uint8_t* commandData, + size_t commandDataLen) { + return HasReturnvaluesIF::RETURN_OK; +} + +ReturnValue_t BpxBatteryHandler::scanForReply(const uint8_t* start, size_t remainingSize, + DeviceCommandId_t* foundId, size_t* foundLen) { + return HasReturnvaluesIF::RETURN_OK; +} + +ReturnValue_t BpxBatteryHandler::interpretDeviceReply(DeviceCommandId_t ixd, + const uint8_t* packet) { + return HasReturnvaluesIF::RETURN_OK; +} + +void BpxBatteryHandler::setNormalDatapoolEntriesInvalid() {} + +LocalPoolDataSetBase* BpxBatteryHandler::getDataSetHandle(sid_t sid) { return nullptr; } + +uint32_t BpxBatteryHandler::getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) { return 10000; } + +ReturnValue_t BpxBatteryHandler::initializeLocalDataPool(localpool::DataPool& localDataPoolMap, + LocalDataPoolManager& poolManager) { + return HasReturnvaluesIF::RETURN_OK; +} diff --git a/mission/devices/BpxBatteryHandler.h b/mission/devices/BpxBatteryHandler.h index 99843e59..887827fd 100644 --- a/mission/devices/BpxBatteryHandler.h +++ b/mission/devices/BpxBatteryHandler.h @@ -3,28 +3,27 @@ #include -class BpxBatteryHandler: public DeviceHandlerBase { -public: +class BpxBatteryHandler : public DeviceHandlerBase { + public: BpxBatteryHandler(object_id_t objectId, object_id_t comIF, CookieIF* comCookie); virtual ~BpxBatteryHandler(); -protected: + + protected: void doStartUp() override; void doShutDown() override; ReturnValue_t buildNormalDeviceCommand(DeviceCommandId_t* id) override; ReturnValue_t buildTransitionDeviceCommand(DeviceCommandId_t* id) override; void fillCommandAndReplyMap() override; ReturnValue_t buildCommandFromCommand(DeviceCommandId_t deviceCommand, const uint8_t* commandData, - size_t commandDataLen) override; + size_t commandDataLen) override; ReturnValue_t scanForReply(const uint8_t* start, size_t remainingSize, DeviceCommandId_t* foundId, - size_t* foundLen) override; + size_t* foundLen) override; ReturnValue_t interpretDeviceReply(DeviceCommandId_t ixd, const uint8_t* packet) override; void setNormalDatapoolEntriesInvalid() override; virtual LocalPoolDataSetBase* getDataSetHandle(sid_t sid) override; uint32_t getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) override; ReturnValue_t initializeLocalDataPool(localpool::DataPool& localDataPoolMap, - LocalDataPoolManager& poolManager) override; + LocalDataPoolManager& poolManager) override; }; - - #endif /* MISSION_DEVICES_BPXBATTERYHANDLER_H_ */ diff --git a/mission/devices/CMakeLists.txt b/mission/devices/CMakeLists.txt index ed811ed3..a9c52b0b 100644 --- a/mission/devices/CMakeLists.txt +++ b/mission/devices/CMakeLists.txt @@ -1,6 +1,7 @@ target_sources(${TARGET_NAME} PUBLIC GPSHyperionHandler.cpp GomspaceDeviceHandler.cpp + BpxBatteryHandler.cpp Tmp1075Handler.cpp PCDUHandler.cpp P60DockHandler.cpp diff --git a/mission/devices/GPSHyperionHandler.cpp b/mission/devices/GPSHyperionHandler.cpp index 5b2a2a95..9ffc6c8f 100644 --- a/mission/devices/GPSHyperionHandler.cpp +++ b/mission/devices/GPSHyperionHandler.cpp @@ -1,7 +1,9 @@ #include "GPSHyperionHandler.h" +#ifdef FSFW_OSAL_LINUX #include #include +#endif #include @@ -22,7 +24,11 @@ GPSHyperionHandler::GPSHyperionHandler(object_id_t objectId, object_id_t parentI GPSHyperionHandler::~GPSHyperionHandler() {} -void GPSHyperionHandler::performControlOperation() { readGpsDataFromGpsd(); } +void GPSHyperionHandler::performControlOperation() { +#ifdef FSFW_OSAL_LINUX + readGpsDataFromGpsd(); +#endif +} LocalPoolDataSetBase *GPSHyperionHandler::getDataSetHandle(sid_t sid) { return nullptr; } @@ -83,6 +89,7 @@ ReturnValue_t GPSHyperionHandler::handleCommandMessage(CommandMessage *message) return ExtendedControllerBase::handleCommandMessage(message); } +#ifdef FSFW_OSAL_LINUX void GPSHyperionHandler::readGpsDataFromGpsd() { // The data from the device will generally be read all at once. Therefore, we // can set all field here @@ -166,3 +173,4 @@ void GPSHyperionHandler::readGpsDataFromGpsd() { std::cout << "Speed(m/s): " << gps->fix.speed << std::endl; } } +#endif diff --git a/mission/tmtc/VirtualChannel.h b/mission/tmtc/VirtualChannel.h index 62953dcb..13e30b32 100644 --- a/mission/tmtc/VirtualChannel.h +++ b/mission/tmtc/VirtualChannel.h @@ -1,14 +1,11 @@ #ifndef VIRTUALCHANNEL_H_ #define VIRTUALCHANNEL_H_ - #include "OBSWConfig.h" - -#include "linux/obc/PtmeIF.h" - +#include "fsfw/ipc/MessageQueueIF.h" #include "fsfw/returnvalues/HasReturnvaluesIF.h" #include "fsfw/tmtcservices/AcceptsTelemetryIF.h" -#include "fsfw/ipc/MessageQueueIF.h" +#include "linux/obc/PtmeIF.h" class StorageManagerIF;