yarp-devices
|
Representation of CAN EMCY protocol.
#include <EmcyConsumer.hpp>
Public Types | |
using | code_t = std::pair< std::uint16_t, std::string > |
Emergency error code. | |
Public Member Functions | |
EmcyConsumer () | |
Constructor. | |
~EmcyConsumer () | |
Destructor. | |
bool | accept (const std::uint8_t *data) |
Invoke callback on parsed CAN message data. | |
template<typename T > | |
void | setErrorCodeRegistry () |
Instantiate a non-default EMCY message parser. | |
template<typename Fn > | |
void | registerHandler (Fn &&fn) |
Register callback. | |
void | unregisterHandler () |
Unregister callback. | |
Private Types | |
using | HandlerFn = std::function< void(code_t, std::uint8_t, const std::uint8_t *)> |
Private Attributes | |
HandlerFn | callback |
EmcyCodeRegistry * | codeRegistry |