2016-06-15 23:48:41 +02:00
|
|
|
|
#ifndef COOKIE_H_
|
|
|
|
|
#define COOKIE_H_
|
2020-03-23 19:09:42 +01:00
|
|
|
|
#include <framework/devicehandlers/CookieIF.h>
|
2016-06-15 23:48:41 +02:00
|
|
|
|
|
2019-10-18 13:37:09 +02:00
|
|
|
|
/**
|
2020-03-19 00:49:47 +01:00
|
|
|
|
* @brief This datatype is used to identify different connection over a single interface
|
|
|
|
|
* (like RMAP or I2C)
|
|
|
|
|
* @details
|
2020-03-23 19:09:42 +01:00
|
|
|
|
* To use this class, implement a communication specific child cookie which
|
|
|
|
|
* inherits Cookie. Cookie instances are created in config/ Factory.cpp by calling
|
|
|
|
|
* CookieIF* childCookie = new ChildCookie(...).´
|
|
|
|
|
*
|
|
|
|
|
* This cookie is then passed to the child device handlers, which stores the
|
|
|
|
|
* pointer and passes it to the communication interface functions.
|
|
|
|
|
*
|
2020-03-23 17:58:23 +01:00
|
|
|
|
* The cookie can be used to store all kinds of information
|
|
|
|
|
* about the communication, like slave addresses, communication status,
|
|
|
|
|
* communication parameters etc.
|
2020-03-23 19:09:42 +01:00
|
|
|
|
*
|
2020-03-23 17:58:23 +01:00
|
|
|
|
* @ingroup comm
|
2019-10-18 13:37:09 +02:00
|
|
|
|
*/
|
2020-03-23 19:09:42 +01:00
|
|
|
|
class Cookie: public CookieIF {
|
2016-06-15 23:48:41 +02:00
|
|
|
|
public:
|
2020-03-23 19:09:42 +01:00
|
|
|
|
Cookie();
|
2020-03-23 17:58:23 +01:00
|
|
|
|
Cookie(address_t logicalAddress_);
|
2020-03-23 19:09:42 +01:00
|
|
|
|
virtual ~Cookie() {};
|
2016-06-15 23:48:41 +02:00
|
|
|
|
|
2020-03-23 19:09:42 +01:00
|
|
|
|
virtual void setAddress(address_t logicalAddres_);
|
|
|
|
|
virtual void setMaxReplyLen(size_t maxReplyLen_);
|
2020-03-23 17:58:23 +01:00
|
|
|
|
|
2020-03-23 19:09:42 +01:00
|
|
|
|
virtual address_t getAddress() const;
|
|
|
|
|
virtual size_t getMaxReplyLen() const;
|
2020-03-23 17:58:23 +01:00
|
|
|
|
private:
|
|
|
|
|
address_t logicalAddress = 0;
|
|
|
|
|
size_t maxReplyLen = 0;
|
|
|
|
|
};
|
2016-06-15 23:48:41 +02:00
|
|
|
|
|
|
|
|
|
#endif /* COOKIE_H_ */
|