62 using Callback = std::function< void(std::vector<uint8_t>) >;
89 void send(uint16_t cob_id,
const std::vector<uint8_t>& data);
100 static const bool debug =
false;
103 std::vector<PDOReceivedCallback> m_receive_callbacks;
104 mutable std::mutex m_receive_callbacks_mutex;
This class implements the CanOpen PDO protocol.
void send(uint16_t cob_id, const std::vector< uint8_t > &data)
Sends a PDO message.
std::function< void(std::vector< uint8_t >) > Callback
Type of the callback.
uint16_t cob_id
The COB-ID of the PDO to receive.
This class implements the Core of KaCanOpen It communicates with the CAN driver, sends CAN messages a...
void process_incoming_message(const Message &message) const
Handler for an incoming PDO message.
void add_pdo_received_callback(uint16_t cob_id, PDOReceivedCallback::Callback callback)
Adds a callback which will be called when a PDO has been received with the given COB-ID.
PDO(Core &core)
Constructor.
A PDO message receiver function together with it's COB-ID Important: Never call add_pdo_received_call...
This struct represents a CANOpen message.
Callback callback
The callback.