diff --git a/bsp_z7/objects/ObjectFactory.cpp b/bsp_z7/objects/ObjectFactory.cpp index 454d454..33c1339 100644 --- a/bsp_z7/objects/ObjectFactory.cpp +++ b/bsp_z7/objects/ObjectFactory.cpp @@ -7,6 +7,8 @@ #include #include +#include + #include "fsfw/events/EventManager.h" #include "fsfw/health/HealthTable.h" #include "fsfw/internalerror/InternalErrorReporter.h" @@ -63,4 +65,7 @@ void ObjectFactory::produce(void *args) { new PrintController(123); new BlinkController(124); + + new LightHandler(125, new ComIF(), *CookieIF); + } diff --git a/mission/CMakeLists.txt b/mission/CMakeLists.txt index 36c1cd7..428d57f 100644 --- a/mission/CMakeLists.txt +++ b/mission/CMakeLists.txt @@ -1 +1 @@ -target_sources(${TARGET_NAME} PRIVATE main.cpp controller/PrintController.cpp controller/BlinkController.cpp) \ No newline at end of file +target_sources(${TARGET_NAME} PRIVATE main.cpp controller/PrintController.cpp controller/BlinkController.cpp devices/LightHandler.h devices/LightHandler.cpp) \ No newline at end of file diff --git a/mission/devices/LED DeviceHandler.cpp b/mission/devices/LED DeviceHandler.cpp deleted file mode 100644 index 7e932ac..0000000 --- a/mission/devices/LED DeviceHandler.cpp +++ /dev/null @@ -1,3 +0,0 @@ -// -// Created by nehlichp on 02.10.23. -// diff --git a/mission/devices/LightHandler.cpp b/mission/devices/LightHandler.cpp new file mode 100644 index 0000000..52864ab --- /dev/null +++ b/mission/devices/LightHandler.cpp @@ -0,0 +1,25 @@ +#include + + + +LightHandler::LightHandler(object_id_t objectId, object_id_t comIF, CookieIF *comCookie) + : DeviceHandlerBase(objectId, comIF, comCookie) {} + + +LightHandler::~LightHandler() {} + + + + +void LightHandler::doStartUp() {} + +void LightHandler::doShutDown() {} + +ReturnValue_t buildTransitionDeviceCommand(DeviceCommandId_t *id) { + return returnvalue::OK; +} + + +ReturnValue_t LightHandler::buildNormalDeviceCommand(DeviceCommandId_t *id) { + return returnvalue::OK; +} \ No newline at end of file diff --git a/mission/devices/LightHandler.h b/mission/devices/LightHandler.h new file mode 100644 index 0000000..e6555a4 --- /dev/null +++ b/mission/devices/LightHandler.h @@ -0,0 +1,40 @@ +#include +/** + * @brief Device Handler for any simple led directly connected to a GPIO + * @details + * Documentation of device: Datasheet available in the internet. + * + * + * @author Paul Nehlich + * @ingroup devices + */ + +class LightHandler : public DeviceHandlerBase { + +public: + LightHandler(object_id_t objectId, object_id_t comIF, CookieIF *comCookie); + virtual ~LightHandler(); + +protected: + /* DeviceHandlerBase abstract function implementation */ + void doStartUp() override; + void doShutDown() override; + ReturnValue_t buildNormalDeviceCommand(DeviceCommandId_t *id) override; + + ReturnValue_t buildTransitionDeviceCommand(DeviceCommandId_t *id) override; + ReturnValue_t buildCommandFromCommand(DeviceCommandId_t deviceCommand, const uint8_t *commandData, + size_t commandDataLen); + void fillCommandAndReplyMap() override; + ReturnValue_t scanForReply(const uint8_t *start, size_t remainingSize, DeviceCommandId_t *foundId, + size_t *foundLen) override; + ReturnValue_t interpretDeviceReply(DeviceCommandId_t id, const uint8_t *packet) override; + void setNormalDatapoolEntriesInvalid() override; + + /* DeviceHandlerBase overrides */ + void debugInterface(uint8_t positionTracker = 0, object_id_t objectId = 0, + uint32_t parameter = 0) override; + uint32_t getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) override; + ReturnValue_t getSwitches(const uint8_t **switches, uint8_t *numberOfSwitches) override; + + +}; \ No newline at end of file