modm API documentation

#include <modm/communication/xpcc/postman/dynamic_postman.hpp>

Inheritance diagram for xpcc::DynamicPostman:
xpcc::Postman

Public Types

enum  DeliverInfo {
  OK = 0, ERROR, NO_COMPONENT, NO_ACTION,
  WRONG_ACTION_PARAMETER, NO_EVENT, WRONG_EVENT_PARAMETER, NOT_IMPLEMENTED_YET_ERROR
}
 

Public Member Functions

DeliverInfo deliverPacket (const Header &header, const modm::SmartPointer &payload) override
 
bool isComponentAvailable (uint8_t component) const override
 Check if a component is available on this board. More...
 
template<class C >
bool registerEventListener (const uint8_t eventId, C *componentObject, void (C::*memberFunction)(const Header &))
 
template<class C , typename P >
bool registerEventListener (const uint8_t eventId, C *componentObject, void (C::*memberFunction)(const Header &, const P &))
 
template<class C >
bool registerActionHandler (const uint8_t componentId, const uint8_t actionId, C *componentObject, void (C::*memberFunction)(const ResponseHandle &))
 
template<class C , typename P >
bool registerActionHandler (const uint8_t componentId, const uint8_t actionId, C *componentObject, void (C::*memberFunction)(const ResponseHandle &, const P &))
 

Detailed Description

The Dynamic Postman is a generic Postman, which allows components to add Action Handlers and Event Listeners at runtime. This class should be used in hosted targets only, as the static Postman generated by XPCC is much more efficient.

On hosted however, this class allows for much easier registering of callbacks.

Author
Niklas Hauser

Member Function Documentation

bool xpcc::DynamicPostman::isComponentAvailable ( uint8_t  component) const
overridevirtual

Check if a component is available on this board.

Parameters
componentId of the component
Returns
true if the postman is available to delivier messages to the given component, false otherwise.

Implements xpcc::Postman.


The documentation for this class was generated from the following files: