yarp-devices
|
Representation of NMT protocol.
#include <NmtProtocol.hpp>
Public Member Functions | |
NmtProtocol (std::uint8_t id, ICanSenderDelegate *sender=nullptr) | |
Constructor, registers CAN sender handle. | |
void | configureSender (ICanSenderDelegate *sender) |
Configure CAN sender delegate handle. | |
bool | issueServiceCommand (NmtService command) |
Send NMT service indication. | |
bool | accept (const std::uint8_t *data) |
Invoke callback on parsed CAN message data. | |
template<typename Fn > | |
void | registerHandler (Fn &&fn) |
Register callback. | |
void | unregisterHandler () |
Unregister callback. | |
Static Public Attributes | |
static constexpr std::uint8_t | BROADCAST = 0 |
Broadcast CAN ID. | |
Private Types | |
using | HandlerFn = std::function< void(NmtState)> |
Private Attributes | |
std::uint8_t | id |
ICanSenderDelegate * | sender |
HandlerFn | callback |