diff --git a/devicehandlers/CookieIF.h b/devicehandlers/CookieIF.h index 6b2bb559..e25ef258 100644 --- a/devicehandlers/CookieIF.h +++ b/devicehandlers/CookieIF.h @@ -17,6 +17,7 @@ typedef uint32_t address_t; * calling @code{.cpp} CookieIF* childCookie = new ChildCookie(...) * @endcode . * + * [not implemented yet] * This cookie is then passed to the child device handlers, which stores the * pointer and passes it to the communication interface functions. * diff --git a/devicehandlers/DeviceCommunicationIF.h b/devicehandlers/DeviceCommunicationIF.h index e0aca573..35a64cee 100644 --- a/devicehandlers/DeviceCommunicationIF.h +++ b/devicehandlers/DeviceCommunicationIF.h @@ -1,7 +1,7 @@ #ifndef DEVICECOMMUNICATIONIF_H_ #define DEVICECOMMUNICATIONIF_H_ -#include +#include #include class DeviceCommunicationIF: public HasReturnvaluesIF { @@ -20,7 +20,7 @@ public: } - virtual ReturnValue_t open(Cookie **cookie, uint32_t address, + virtual ReturnValue_t open(CookieIF **cookie, uint32_t address, uint32_t maxReplyLen) = 0; /** @@ -34,29 +34,29 @@ public: * @param maxReplyLen * @return */ - virtual ReturnValue_t reOpen(Cookie *cookie, uint32_t address, + virtual ReturnValue_t reOpen(CookieIF *cookie, uint32_t address, uint32_t maxReplyLen) = 0; - virtual void close(Cookie *cookie) = 0; + virtual void close(CookieIF *cookie) = 0; //SHOULDDO can data be const? - virtual ReturnValue_t sendMessage(Cookie *cookie, uint8_t *data, + virtual ReturnValue_t sendMessage(CookieIF *cookie, uint8_t *data, uint32_t len) = 0; - virtual ReturnValue_t getSendSuccess(Cookie *cookie) = 0; + virtual ReturnValue_t getSendSuccess(CookieIF *cookie) = 0; - virtual ReturnValue_t requestReceiveMessage(Cookie *cookie) = 0; + virtual ReturnValue_t requestReceiveMessage(CookieIF *cookie) = 0; - virtual ReturnValue_t readReceivedMessage(Cookie *cookie, uint8_t **buffer, + virtual ReturnValue_t readReceivedMessage(CookieIF *cookie, uint8_t **buffer, uint32_t *size) = 0; - virtual ReturnValue_t setAddress(Cookie *cookie, uint32_t address) = 0; + virtual ReturnValue_t setAddress(CookieIF *cookie, uint32_t address) = 0; - virtual uint32_t getAddress(Cookie *cookie) = 0; + virtual uint32_t getAddress(CookieIF *cookie) = 0; - virtual ReturnValue_t setParameter(Cookie *cookie, uint32_t parameter) = 0; + virtual ReturnValue_t setParameter(CookieIF *cookie, uint32_t parameter) = 0; - virtual uint32_t getParameter(Cookie *cookie) = 0; + virtual uint32_t getParameter(CookieIF *cookie) = 0; }; diff --git a/devicehandlers/DeviceHandlerBase.h b/devicehandlers/DeviceHandlerBase.h index 756ad530..ec5e3cd8 100644 --- a/devicehandlers/DeviceHandlerBase.h +++ b/devicehandlers/DeviceHandlerBase.h @@ -244,7 +244,7 @@ protected: /** * Cookie used for communication */ - Cookie *cookie; + CookieIF *cookie; /** * The MessageQueue used to receive device handler commands and to send replies. diff --git a/rmap/RMAPCookie.h b/rmap/RMAPCookie.h index c091ba18..4890c516 100644 --- a/rmap/RMAPCookie.h +++ b/rmap/RMAPCookie.h @@ -1,12 +1,12 @@ #ifndef RMAPCOOKIE_H_ #define RMAPCOOKIE_H_ -#include +#include #include class RMAPChannelIF; -class RMAPCookie : public Cookie{ +class RMAPCookie : public CookieIF { public: //To Uli: Sorry, I need an empty ctor to initialize an array of cookies. RMAPCookie(); diff --git a/rmap/RmapDeviceCommunicationIF.cpp b/rmap/RmapDeviceCommunicationIF.cpp index 4958b3ed..674d050d 100644 --- a/rmap/RmapDeviceCommunicationIF.cpp +++ b/rmap/RmapDeviceCommunicationIF.cpp @@ -5,43 +5,43 @@ RmapDeviceCommunicationIF::~RmapDeviceCommunicationIF() { } -ReturnValue_t RmapDeviceCommunicationIF::sendMessage(Cookie* cookie, +ReturnValue_t RmapDeviceCommunicationIF::sendMessage(CookieIF* cookie, uint8_t* data, uint32_t len) { return RMAP::sendWriteCommand((RMAPCookie *) cookie, data, len); } -ReturnValue_t RmapDeviceCommunicationIF::getSendSuccess(Cookie* cookie) { +ReturnValue_t RmapDeviceCommunicationIF::getSendSuccess(CookieIF* cookie) { return RMAP::getWriteReply((RMAPCookie *) cookie); } ReturnValue_t RmapDeviceCommunicationIF::requestReceiveMessage( - Cookie* cookie) { + CookieIF* cookie) { return RMAP::sendReadCommand((RMAPCookie *) cookie, ((RMAPCookie *) cookie)->getMaxReplyLen()); } -ReturnValue_t RmapDeviceCommunicationIF::readReceivedMessage(Cookie* cookie, +ReturnValue_t RmapDeviceCommunicationIF::readReceivedMessage(CookieIF* cookie, uint8_t** buffer, uint32_t* size) { return RMAP::getReadReply((RMAPCookie *) cookie, buffer, size); } -ReturnValue_t RmapDeviceCommunicationIF::setAddress(Cookie* cookie, +ReturnValue_t RmapDeviceCommunicationIF::setAddress(CookieIF* cookie, uint32_t address) { ((RMAPCookie *) cookie)->setAddress(address); return HasReturnvaluesIF::RETURN_OK; } -uint32_t RmapDeviceCommunicationIF::getAddress(Cookie* cookie) { +uint32_t RmapDeviceCommunicationIF::getAddress(CookieIF* cookie) { return ((RMAPCookie *) cookie)->getAddress(); } -ReturnValue_t RmapDeviceCommunicationIF::setParameter(Cookie* cookie, +ReturnValue_t RmapDeviceCommunicationIF::setParameter(CookieIF* cookie, uint32_t parameter) { //TODO Empty? return HasReturnvaluesIF::RETURN_FAILED; } -uint32_t RmapDeviceCommunicationIF::getParameter(Cookie* cookie) { +uint32_t RmapDeviceCommunicationIF::getParameter(CookieIF* cookie) { return 0; } diff --git a/rmap/RmapDeviceCommunicationIF.h b/rmap/RmapDeviceCommunicationIF.h index 12ae67e4..9d756ea2 100644 --- a/rmap/RmapDeviceCommunicationIF.h +++ b/rmap/RmapDeviceCommunicationIF.h @@ -25,7 +25,7 @@ public: * @param maxReplyLen Maximum length of expected reply * @return */ - virtual ReturnValue_t open(Cookie **cookie, uint32_t address, + virtual ReturnValue_t open(CookieIF **cookie, uint32_t address, uint32_t maxReplyLen) = 0; /** @@ -39,7 +39,7 @@ public: * @param maxReplyLen * @return */ - virtual ReturnValue_t reOpen(Cookie *cookie, uint32_t address, + virtual ReturnValue_t reOpen(CookieIF *cookie, uint32_t address, uint32_t maxReplyLen) = 0; @@ -47,7 +47,7 @@ public: * Closing call of connection and memory free of cookie. Mission dependent call * @param cookie */ - virtual void close(Cookie *cookie) = 0; + virtual void close(CookieIF *cookie) = 0; //SHOULDDO can data be const? /** @@ -58,23 +58,23 @@ public: * @param len Length of the data to be send * @return - Return codes of RMAP::sendWriteCommand() */ - virtual ReturnValue_t sendMessage(Cookie *cookie, uint8_t *data, + virtual ReturnValue_t sendMessage(CookieIF *cookie, uint8_t *data, uint32_t len); - virtual ReturnValue_t getSendSuccess(Cookie *cookie); + virtual ReturnValue_t getSendSuccess(CookieIF *cookie); - virtual ReturnValue_t requestReceiveMessage(Cookie *cookie); + virtual ReturnValue_t requestReceiveMessage(CookieIF *cookie); - virtual ReturnValue_t readReceivedMessage(Cookie *cookie, uint8_t **buffer, + virtual ReturnValue_t readReceivedMessage(CookieIF *cookie, uint8_t **buffer, uint32_t *size); - virtual ReturnValue_t setAddress(Cookie *cookie, uint32_t address); + virtual ReturnValue_t setAddress(CookieIF *cookie, uint32_t address); - virtual uint32_t getAddress(Cookie *cookie); + virtual uint32_t getAddress(CookieIF *cookie); - virtual ReturnValue_t setParameter(Cookie *cookie, uint32_t parameter); + virtual ReturnValue_t setParameter(CookieIF *cookie, uint32_t parameter); - virtual uint32_t getParameter(Cookie *cookie); + virtual uint32_t getParameter(CookieIF *cookie); }; #endif /* MISSION_RMAP_RMAPDEVICECOMMUNICATIONINTERFACE_H_ */