modm API documentation
|
#include <modm/communication/xpcc/postman/dynamic_postman.hpp>
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 &)) |
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.
|
overridevirtual |
Check if a component is available on this board.
component | Id of the component |
true
if the postman is available to delivier messages to the given component, false
otherwise. Implements xpcc::Postman.