2016-06-15 23:48:41 +02:00
|
|
|
#ifndef COOKIE_H_
|
|
|
|
#define COOKIE_H_
|
2020-03-23 17:58:23 +01:00
|
|
|
#include <framework/devicehandlers/DeviceHandlerIF.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
|
|
|
|
* To use this class, implement a communication specific child cookie. This cookie
|
|
|
|
* can be used in the device communication interface by performing
|
2020-03-23 17:58:23 +01:00
|
|
|
* a C++ dynamic cast and passing it to a child device handler, which stores
|
|
|
|
* it and passes the Cookie to the communication interface where it can be used
|
|
|
|
* by again performing a dynamic cast.
|
|
|
|
* The cookie can be used to store all kinds of information
|
|
|
|
* about the communication, like slave addresses, communication status,
|
|
|
|
* communication parameters etc.
|
|
|
|
* @ingroup comm
|
2019-10-18 13:37:09 +02:00
|
|
|
*/
|
2016-06-15 23:48:41 +02:00
|
|
|
class Cookie{
|
|
|
|
public:
|
2020-03-23 17:58:23 +01:00
|
|
|
Cookie() = default;
|
|
|
|
Cookie(address_t logicalAddress_);
|
2016-06-15 23:48:41 +02:00
|
|
|
virtual ~Cookie(){}
|
|
|
|
|
2020-03-23 17:58:23 +01:00
|
|
|
void setMaxReplyLen(size_t maxReplyLen_);
|
|
|
|
|
|
|
|
address_t getAddress() const;
|
|
|
|
size_t getMaxReplyLen() const;
|
|
|
|
private:
|
|
|
|
address_t logicalAddress = 0;
|
|
|
|
size_t maxReplyLen = 0;
|
|
|
|
};
|
2016-06-15 23:48:41 +02:00
|
|
|
|
|
|
|
#endif /* COOKIE_H_ */
|