From 692aa087d8d4dfb3c02cb7bf61b93ea47e1ba8df Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Sun, 13 Dec 2020 22:13:22 +0100 Subject: [PATCH] taken over cleaned up branch --- rmap/RMAP.cpp | 10 ++++++---- rmap/RMAP.h | 4 ++-- rmap/RMAPChannelIF.h | 8 ++++---- rmap/RMAPCookie.cpp | 9 +++++---- rmap/RMAPCookie.h | 11 ++++++----- rmap/RmapDeviceCommunicationIF.cpp | 4 ++-- rmap/RmapDeviceCommunicationIF.h | 6 +++--- rmap/rmapStructs.h | 8 ++++---- 8 files changed, 32 insertions(+), 28 deletions(-) diff --git a/rmap/RMAP.cpp b/rmap/RMAP.cpp index d0872c8e..7ea6e532 100644 --- a/rmap/RMAP.cpp +++ b/rmap/RMAP.cpp @@ -1,8 +1,10 @@ +#include "RMAP.h" +#include "rmapStructs.h" +#include "RMAPChannelIF.h" + #include "../devicehandlers/DeviceCommunicationIF.h" -#include "../rmap/rmapStructs.h" -#include "../rmap/RMAP.h" -#include "../rmap/RMAPChannelIF.h" -#include + +#include ReturnValue_t RMAP::reset(RMAPCookie* cookie) { return cookie->getChannel()->reset(); diff --git a/rmap/RMAP.h b/rmap/RMAP.h index e083d407..83e29fed 100644 --- a/rmap/RMAP.h +++ b/rmap/RMAP.h @@ -1,5 +1,5 @@ -#ifndef RMAPpp_H_ -#define RMAPpp_H_ +#ifndef FSFW_RMAP_RMAP_H_ +#define FSFW_RMAP_RMAP_H_ #include "../returnvalues/HasReturnvaluesIF.h" #include "../rmap/RMAPCookie.h" diff --git a/rmap/RMAPChannelIF.h b/rmap/RMAPChannelIF.h index d851885b..0aa809c5 100644 --- a/rmap/RMAPChannelIF.h +++ b/rmap/RMAPChannelIF.h @@ -1,7 +1,7 @@ -#ifndef RMAPCHANNELIF_H_ -#define RMAPCHANNELIF_H_ +#ifndef FSFW_RMAP_RMAPCHANNELIF_H_ +#define FSFW_RMAP_RMAPCHANNELIF_H_ -#include "../rmap/RMAPCookie.h" +#include "RMAPCookie.h" #include "../returnvalues/HasReturnvaluesIF.h" #include @@ -113,4 +113,4 @@ public: }; -#endif /* RMAPCHANNELIF_H_ */ +#endif /* FSFW_RMAP_RMAPCHANNELIF_H_ */ diff --git a/rmap/RMAPCookie.cpp b/rmap/RMAPCookie.cpp index c92ee433..f8fe2d3e 100644 --- a/rmap/RMAPCookie.cpp +++ b/rmap/RMAPCookie.cpp @@ -1,6 +1,6 @@ -#include "../rmap/RMAPChannelIF.h" -#include "../rmap/RMAPCookie.h" -#include +#include "RMAPChannelIF.h" +#include "RMAPCookie.h" +#include RMAPCookie::RMAPCookie() { @@ -31,7 +31,8 @@ RMAPCookie::RMAPCookie() { RMAPCookie::RMAPCookie(uint32_t set_address, uint8_t set_extended_address, - RMAPChannelIF *set_channel, uint8_t set_command_mask, uint32_t maxReplyLen) { + RMAPChannelIF *set_channel, uint8_t set_command_mask, + size_t maxReplyLen) { this->header.dest_address = 0; this->header.protocol = 0x01; this->header.instruction = 0; diff --git a/rmap/RMAPCookie.h b/rmap/RMAPCookie.h index 8832f857..38542646 100644 --- a/rmap/RMAPCookie.h +++ b/rmap/RMAPCookie.h @@ -1,8 +1,8 @@ -#ifndef RMAPCOOKIE_H_ -#define RMAPCOOKIE_H_ +#ifndef FSFW_RMAP_RMAPCOOKIE_H_ +#define FSFW_RMAP_RMAPCOOKIE_H_ +#include "rmapStructs.h" #include "../devicehandlers/CookieIF.h" -#include "../rmap/rmapStructs.h" #include class RMAPChannelIF; @@ -13,7 +13,8 @@ public: RMAPCookie(); RMAPCookie(uint32_t set_address, uint8_t set_extended_address, - RMAPChannelIF *set_channel, uint8_t set_command_mask, uint32_t maxReplyLen = 0); + RMAPChannelIF *set_channel, uint8_t set_command_mask, + size_t maxReplyLen = 0); virtual ~RMAPCookie(); @@ -56,4 +57,4 @@ protected: uint8_t dataCRC; }; -#endif /* RMAPCOOKIE_H_ */ +#endif /* FSFW_RMAP_RMAPCOOKIE_H_ */ diff --git a/rmap/RmapDeviceCommunicationIF.cpp b/rmap/RmapDeviceCommunicationIF.cpp index 62a3f3ef..d81baabd 100644 --- a/rmap/RmapDeviceCommunicationIF.cpp +++ b/rmap/RmapDeviceCommunicationIF.cpp @@ -1,5 +1,5 @@ -#include "../rmap/RmapDeviceCommunicationIF.h" -#include "../rmap/RMAP.h" +#include "RmapDeviceCommunicationIF.h" +#include "RMAP.h" //TODO Cast here are all potential bugs RmapDeviceCommunicationIF::~RmapDeviceCommunicationIF() { diff --git a/rmap/RmapDeviceCommunicationIF.h b/rmap/RmapDeviceCommunicationIF.h index 52efa3de..1333966a 100644 --- a/rmap/RmapDeviceCommunicationIF.h +++ b/rmap/RmapDeviceCommunicationIF.h @@ -1,5 +1,5 @@ -#ifndef MISSION_RMAP_RMAPDEVICECOMMUNICATIONINTERFACE_H_ -#define MISSION_RMAP_RMAPDEVICECOMMUNICATIONINTERFACE_H_ +#ifndef FSFW_RMAP_RMAPDEVICECOMMUNICATIONINTERFACE_H_ +#define FSFW_RMAP_RMAPDEVICECOMMUNICATIONINTERFACE_H_ #include "../devicehandlers/DeviceCommunicationIF.h" @@ -86,4 +86,4 @@ public: uint32_t getParameter(CookieIF* cookie); }; -#endif /* MISSION_RMAP_RMAPDEVICECOMMUNICATIONINTERFACE_H_ */ +#endif /* FSFW_RMAP_RMAPDEVICECOMMUNICATIONINTERFACE_H_ */ diff --git a/rmap/rmapStructs.h b/rmap/rmapStructs.h index bf0fb260..11d8bb85 100644 --- a/rmap/rmapStructs.h +++ b/rmap/rmapStructs.h @@ -1,7 +1,7 @@ -#ifndef RMAPSTRUCTS_H_ -#define RMAPSTRUCTS_H_ +#ifndef FSFW_RMAP_RMAPSTRUCTS_H_ +#define FSFW_RMAP_RMAPSTRUCTS_H_ -#include +#include //SHOULDDO: having the defines within a namespace would be nice. Problem are the defines referencing the previous define, eg RMAP_COMMAND_WRITE @@ -95,4 +95,4 @@ struct rmap_write_reply_header { } -#endif /* RMAPSTRUCTS_H_ */ +#endif /* FSFW_RMAP_RMAPSTRUCTS_H_ */