From 1ed82f6a4b8d984f4006cab77615a7cd3119acc7 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 22 Dec 2020 00:30:50 +0100 Subject: [PATCH] added gyro handler stub --- mission/devices/GyroHandler.cpp | 57 ++++++++++++++++++++++++++++ mission/devices/GyroHandler.h | 41 ++++++++++++++++++++ mission/devices/MGMHandlerRM3100.cpp | 6 +-- 3 files changed, 101 insertions(+), 3 deletions(-) create mode 100644 mission/devices/GyroHandler.cpp create mode 100644 mission/devices/GyroHandler.h diff --git a/mission/devices/GyroHandler.cpp b/mission/devices/GyroHandler.cpp new file mode 100644 index 00000000..f3064ebc --- /dev/null +++ b/mission/devices/GyroHandler.cpp @@ -0,0 +1,57 @@ +#include "GyroHandler.h" + +GyroHandler::GyroHandler(object_id_t objectId, object_id_t deviceCommunication, + CookieIF *comCookie): + DeviceHandlerBase(objectId, deviceCommunication, comCookie) { +} + +GyroHandler::~GyroHandler() {} + +void GyroHandler::doStartUp() { + +} + +void GyroHandler::doShutDown() { + +} + +ReturnValue_t GyroHandler::buildTransitionDeviceCommand(DeviceCommandId_t *id) { + return HasReturnvaluesIF::RETURN_OK; +} + +ReturnValue_t GyroHandler::buildNormalDeviceCommand(DeviceCommandId_t *id) { + return HasReturnvaluesIF::RETURN_OK; +} + +ReturnValue_t GyroHandler::buildCommandFromCommand( + DeviceCommandId_t deviceCommand, const uint8_t *commandData, + size_t commandDataLen) { + return HasReturnvaluesIF::RETURN_OK; +} + +ReturnValue_t GyroHandler::scanForReply(const uint8_t *start, size_t len, + DeviceCommandId_t *foundId, size_t *foundLen) { + return HasReturnvaluesIF::RETURN_OK; +} + +ReturnValue_t GyroHandler::interpretDeviceReply(DeviceCommandId_t id, + const uint8_t *packet) { + return HasReturnvaluesIF::RETURN_OK; +} + +uint32_t GyroHandler::getTransitionDelayMs(Mode_t from, Mode_t to) { + return 5000; +} + +ReturnValue_t GyroHandler::initializeLocalDataPool( + LocalDataPool &localDataPoolMap, LocalDataPoolManager &poolManager) { + return HasReturnvaluesIF::RETURN_OK; +} + +void GyroHandler::fillCommandAndReplyMap() { + +} + +void GyroHandler::modeChanged() { + +} diff --git a/mission/devices/GyroHandler.h b/mission/devices/GyroHandler.h new file mode 100644 index 00000000..aa8be90c --- /dev/null +++ b/mission/devices/GyroHandler.h @@ -0,0 +1,41 @@ +#ifndef MISSION_DEVICES_GYROHANDLER_H_ +#define MISSION_DEVICES_GYROHANDLER_H_ + +#include + +class GyroHandler: public DeviceHandlerBase { +public: + GyroHandler(object_id_t objectId, object_id_t deviceCommunication, + CookieIF* comCookie); + virtual ~GyroHandler(); + +protected: + + /* DeviceHandlerBase overrides */ + ReturnValue_t buildTransitionDeviceCommand( + DeviceCommandId_t *id) override; + void doStartUp() override; + void doShutDown() override; + ReturnValue_t buildNormalDeviceCommand( + DeviceCommandId_t *id) override; + ReturnValue_t buildCommandFromCommand( + DeviceCommandId_t deviceCommand, const uint8_t *commandData, + size_t commandDataLen) override; + ReturnValue_t scanForReply(const uint8_t *start, size_t len, + DeviceCommandId_t *foundId, size_t *foundLen) override; + ReturnValue_t interpretDeviceReply(DeviceCommandId_t id, + const uint8_t *packet) override; + + void fillCommandAndReplyMap() override; + void modeChanged() override; + uint32_t getTransitionDelayMs(Mode_t from, Mode_t to) override; + ReturnValue_t initializeLocalDataPool(LocalDataPool &localDataPoolMap, + LocalDataPoolManager &poolManager) override; + +private: + +}; + + + +#endif /* MISSION_DEVICES_GYROHANDLER_H_ */ diff --git a/mission/devices/MGMHandlerRM3100.cpp b/mission/devices/MGMHandlerRM3100.cpp index 6040afad..4051e107 100644 --- a/mission/devices/MGMHandlerRM3100.cpp +++ b/mission/devices/MGMHandlerRM3100.cpp @@ -290,11 +290,11 @@ void MGMHandlerRM3100::modeChanged(void) { ReturnValue_t MGMHandlerRM3100::initializeLocalDataPool( LocalDataPool &localDataPoolMap, LocalDataPoolManager &poolManager) { localDataPoolMap.emplace(RM3100::FIELD_STRENGTH_X, - new PoolEntry(0.0)); + new PoolEntry({0.0})); localDataPoolMap.emplace(RM3100::FIELD_STRENGTH_Y, - new PoolEntry(0.0)); + new PoolEntry({0.0})); localDataPoolMap.emplace(RM3100::FIELD_STRENGTH_Z, - new PoolEntry(0.0)); + new PoolEntry({0.0})); return HasReturnvaluesIF::RETURN_OK; }