1
0
forked from fsfw/fsfw

DHB/Cookie refactoring

This commit is contained in:
2020-04-01 12:41:54 +02:00
parent 5218a0d84f
commit 996dbc9e4b
14 changed files with 142 additions and 213 deletions

View File

@ -1,30 +1,33 @@
/**
* @file CookieIF.h
*
* @date 23.03.2020
*/
#ifndef FRAMEWORK_DEVICEHANDLERS_COOKIEIF_H_
#define FRAMEWORK_DEVICEHANDLERS_COOKIEIF_H_
#include <framework/devicehandlers/DeviceHandlerIF.h>
/**
* @brief Physical address type
*/
typedef uint32_t address_t;
class CookieIF {
public:
/**
* Default empty virtual destructor.
*/
virtual ~CookieIF() {};
virtual void setAddress(address_t logicalAddress_) = 0;
virtual address_t getAddress() const = 0;
virtual void setMaxReplyLen(size_t maxReplyLen_) = 0;
virtual size_t getMaxReplyLen() const = 0;
};
#endif /* FRAMEWORK_DEVICEHANDLERS_COOKIEIF_H_ */
#ifndef COOKIE_H_
#define COOKIE_H_
#include <framework/devicehandlers/CookieIF.h>
#include <stdint.h>
/**
* @brief Physical address type
*/
typedef uint32_t address_t;
/**
* @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 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.
*
* The cookie can be used to store all kinds of information
* about the communication, like slave addresses, communication status,
* communication parameters etc.
*
* @ingroup comm
*/
class CookieIF {
public:
virtual ~CookieIF() {};
};
#endif /* COOKIE_H_ */