This class implements the CanOpen PDO protocol. More...
#include <pdo.h>
Classes | |
struct | PDOReceivedCallback |
A PDO message receiver function together with it's COB-ID Important: Never call add_pdo_received_callback or process_incoming_message from within (-> deadlock)! More... | |
Public Member Functions | |
PDO (Core &core) | |
Constructor. More... | |
PDO (const PDO &)=delete | |
Copy constructor deleted because of mutexes. | |
void | process_incoming_message (const Message &message) const |
Handler for an incoming PDO message. More... | |
void | send (uint16_t cob_id, const std::vector< uint8_t > &data) |
Sends a PDO message. More... | |
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. More... | |
This class implements the CanOpen PDO protocol.
All methods are thread-safe.
kaco::PDO::PDO | ( | Core & | core | ) |
void kaco::PDO::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.
cob_id | COB-ID to listen for |
callback | Callback function, which takes a const Message reference as argument. |
void kaco::PDO::process_incoming_message | ( | const Message & | message | ) | const |
void kaco::PDO::send | ( | uint16_t | cob_id, |
const std::vector< uint8_t > & | data | ||
) |