From 436275c61d171cde9ae68f9d0daa2dd0ad3d7559 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 30 Sep 2020 22:14:44 +0200 Subject: [PATCH] mgm handlers continued --- mission/devices/MGMHandlerLIS3MDL.h | 6 +-- mission/devices/MGMHandlerRM3100.cpp | 45 ++++++++++++++++++++ mission/devices/MGMHandlerRM3100.h | 38 +++++++++++++++++ mission/devices/MGMRM3100Handler.cpp | 55 ------------------------ mission/devices/MGMRM3100Handler.h | 62 ---------------------------- 5 files changed, 86 insertions(+), 120 deletions(-) create mode 100644 mission/devices/MGMHandlerRM3100.cpp create mode 100644 mission/devices/MGMHandlerRM3100.h delete mode 100644 mission/devices/MGMRM3100Handler.cpp delete mode 100644 mission/devices/MGMRM3100Handler.h diff --git a/mission/devices/MGMHandlerLIS3MDL.h b/mission/devices/MGMHandlerLIS3MDL.h index a3ccd99f..240383db 100644 --- a/mission/devices/MGMHandlerLIS3MDL.h +++ b/mission/devices/MGMHandlerLIS3MDL.h @@ -1,5 +1,5 @@ -#ifndef MISSION_DEVICEHANDLING_MGMLIS3MDLHANDLER_H_ -#define MISSION_DEVICEHANDLING_MGMLIS3MDLHANDLER_H_ +#ifndef MISSION_DEVICES_MGMLIS3MDLHANDLER_H_ +#define MISSION_DEVICES_MGMLIS3MDLHANDLER_H_ #include #include @@ -246,4 +246,4 @@ private: }; -#endif /* MISSION_DEVICEHANDLING_MGMLIS3MDLHANDLER_H_ */ +#endif /* MISSION_DEVICES_MGMLIS3MDLHANDLER_H_ */ diff --git a/mission/devices/MGMHandlerRM3100.cpp b/mission/devices/MGMHandlerRM3100.cpp new file mode 100644 index 00000000..fbcb578d --- /dev/null +++ b/mission/devices/MGMHandlerRM3100.cpp @@ -0,0 +1,45 @@ +#include "MGMHandlerRM3100.h" +#include +#include +#include + + +MGMHandlerRM3100::MGMHandlerRM3100(object_id_t objectId, + object_id_t deviceCommunication, CookieIF* comCookie): + DeviceHandlerBase(objectId, deviceCommunication, comCookie) { +} + +MGMHandlerRM3100::~MGMHandlerRM3100() {} + +ReturnValue_t MGMHandlerRM3100::buildTransitionDeviceCommand( + DeviceCommandId_t *id) { + return RETURN_OK; +} + +void MGMHandlerRM3100::doStartUp() { +} + +void MGMHandlerRM3100::doShutDown() { +} + +ReturnValue_t MGMHandlerRM3100::buildNormalDeviceCommand( + DeviceCommandId_t *id) { + return RETURN_OK; +} + +ReturnValue_t MGMHandlerRM3100::buildCommandFromCommand( + DeviceCommandId_t deviceCommand, const uint8_t *commandData, + size_t commandDataLen) { + return RETURN_OK; +} + +ReturnValue_t MGMHandlerRM3100::scanForReply(const uint8_t *start, + size_t len, DeviceCommandId_t *foundId, + size_t *foundLen) { + return RETURN_OK; +} + +ReturnValue_t MGMHandlerRM3100::interpretDeviceReply( + DeviceCommandId_t id, const uint8_t *packet) { + return RETURN_OK; +} diff --git a/mission/devices/MGMHandlerRM3100.h b/mission/devices/MGMHandlerRM3100.h new file mode 100644 index 00000000..44e625b4 --- /dev/null +++ b/mission/devices/MGMHandlerRM3100.h @@ -0,0 +1,38 @@ +#ifndef MISSION_DEVICES_MGMRM3100HANDLER_H_ +#define MISSION_DEVICES_MGMRM3100HANDLER_H_ + +#include + +class MGMHandlerRM3100: public DeviceHandlerBase { +public: + + MGMHandlerRM3100(object_id_t objectId, object_id_t deviceCommunication, + CookieIF* comCookie); + virtual ~MGMHandlerRM3100(); + +protected: + + /* DeviceHandlerBase overrides */ + virtual ReturnValue_t buildTransitionDeviceCommand( + DeviceCommandId_t *id) override; + virtual void doStartUp() override; + virtual void doShutDown() override; + virtual ReturnValue_t buildNormalDeviceCommand( + DeviceCommandId_t *id) override; + virtual ReturnValue_t buildCommandFromCommand( + DeviceCommandId_t deviceCommand, const uint8_t *commandData, + size_t commandDataLen) override; + virtual ReturnValue_t scanForReply(const uint8_t *start, size_t len, + DeviceCommandId_t *foundId, size_t *foundLen) override; + virtual ReturnValue_t interpretDeviceReply(DeviceCommandId_t id, + const uint8_t *packet) override; + +private: + + enum InternalState { + STATE_NONE, STATE_FIRST_CONTACT, STATE_SETUP, STATE_CHECK_REGISTERS + }; + InternalState internalState = InternalState::STATE_NONE; +}; + +#endif /* MISSION_DEVICEHANDLING_MGMRM3100HANDLER_H_ */ diff --git a/mission/devices/MGMRM3100Handler.cpp b/mission/devices/MGMRM3100Handler.cpp deleted file mode 100644 index 80b5ec10..00000000 --- a/mission/devices/MGMRM3100Handler.cpp +++ /dev/null @@ -1,55 +0,0 @@ -///* -// * MGMRM3100Handler.cpp -// * -// * Created on: 28.05.2020 -// * Author: lukas -// */ -// -//#include -//#include -//#include -//#include -//#include -//#include -// -//MGMRM3100Handler::MGMRM3100Handler(DeviceCommunicationIF *commInterface, object_id_t setOjectId, -// uint32_t address, uint32_t maxReplyLen, datapool::opus_variable_id mgmMeasurement, datapool::opus_variable_id mgmTemperature) -// :NotDeviceHandlerBase(commInterface, setOjectId , address, maxReplyLen),internalState(STATE_NONE), -// mgmMagneticPoolId(mgmMeasurement),mgmTempPoolId(mgmTemperature){ -//} -// -//MGMRM3100Handler::~MGMRM3100Handler() { -//} -// -//ReturnValue_t MGMRM3100Handler::buildTransitionDeviceCommand( -// DeviceCommandId_t *id) { -// return RETURN_OK; -//} -// -//void MGMRM3100Handler::doStartUp() { -//} -// -//void MGMRM3100Handler::doShutDown() { -//} -// -//ReturnValue_t MGMRM3100Handler::buildNormalDeviceCommand( -// DeviceCommandId_t *id) { -// return RETURN_OK; -//} -// -//ReturnValue_t MGMRM3100Handler::buildCommandFromCommand( -// DeviceCommandId_t deviceCommand, const uint8_t *commandData, -// size_t commandDataLen) { -// return RETURN_OK; -//} -// -//ReturnValue_t MGMRM3100Handler::scanForReply( -// const uint8_t *start, uint32_t len, DeviceCommandId_t *foundId, -// uint32_t *foundLen) { -// return RETURN_OK; -//} -// -//ReturnValue_t MGMRM3100Handler::interpretDeviceReply( -// DeviceCommandId_t id, const uint8_t *packet) { -// return RETURN_OK; -//} diff --git a/mission/devices/MGMRM3100Handler.h b/mission/devices/MGMRM3100Handler.h deleted file mode 100644 index 91943a86..00000000 --- a/mission/devices/MGMRM3100Handler.h +++ /dev/null @@ -1,62 +0,0 @@ -///* -// * MGMRM3100Handler.h -// * -// * Created on: 28.05.2020 -// * Author: lukas -// */ -// -//#ifndef MISSION_DEVICEHANDLING_MGMRM3100HANDLER_H_ -//#define MISSION_DEVICEHANDLING_MGMRM3100HANDLER_H_ -// -//#include -//#include -//#include -//#include -//#include -//#include -//#include -// -//using namespace std; -// -//class MGMRM3100Handler: public NotDeviceHandlerBase { -//public: -// -// MGMRM3100Handler(DeviceCommunicationIF *comInterface, -// object_id_t setObjectId, uint32_t address, uint32_t maxReplyLen, -// datapool::opus_variable_id mgmMeasurement, -// datapool::opus_variable_id mgmTemperature); -// virtual ~MGMRM3100Handler(); -// -//protected: -// //These are the commands the Device has to implement -// virtual ReturnValue_t buildTransitionDeviceCommand(DeviceCommandId_t *id); -// virtual void doStartUp(); -// virtual void doShutDown(); -// virtual ReturnValue_t buildNormalDeviceCommand(DeviceCommandId_t *id); -// virtual ReturnValue_t buildCommandFromCommand( -// DeviceCommandId_t deviceCommand, const uint8_t *commandData, -// size_t commandDataLen); -// virtual ReturnValue_t scanForReply(const uint8_t *start, uint32_t len, -// DeviceCommandId_t *foundId, uint32_t *foundLen); -// virtual ReturnValue_t interpretDeviceReply(DeviceCommandId_t id, -// const uint8_t *packet); -// -//private: -// /** -// * Magnetic field data pool id -// */ -// datapool::opus_variable_id mgmMagneticPoolId; -// -// /* -// * Temperature value pool id -// */ -// -// datapool::opus_variable_id mgmTempPoolId; -// -// enum InternalState { -// STATE_NONE, STATE_FIRST_CONTACT, STATE_SETUP, STATE_CHECK_REGISTERS -// } internalState; -// -//}; -// -//#endif /* MISSION_DEVICEHANDLING_MGMRM3100HANDLER_H_ */