39 #include <forward_list>
67 enter_preoperational = 0x80,
69 reset_communication = 0x82
116 static const bool debug =
false;
120 std::vector<NewDeviceCallback> m_device_alive_callbacks;
121 mutable std::mutex m_device_alive_callbacks_mutex;
123 static const bool m_cleanup_futures =
true;
124 std::forward_list<std::future<void>> m_callback_futures;
125 mutable std::mutex m_callback_futures_mutex;
void send_nmt_message(uint8_t node_id, Command cmd)
Sends a NMT message to a given device.
void broadcast_nmt_message(Command cmd)
Sends a broadcast NMT message.
void register_device_alive_callback(const DeviceAliveCallback &callback)
Registers a callback which will be called when a slave sends it's state via NMT and the state indicat...
This class implements the CanOpen NMT protocol.
DeviceAliveCallback NewDeviceCallback
Type of a new device callback function.
This class implements the Core of KaCanOpen It communicates with the CAN driver, sends CAN messages a...
void discover_nodes()
Discovers nodes in the network via node guard protocol.
void register_new_device_callback(const NewDeviceCallback &callback)
Registers a callback which will be called when a new slave device is discovered.
void process_incoming_message(const Message &message)
Process incoming NMT message.
NMT(Core &core)
Constructor.
std::function< void(const uint8_t node_id) > DeviceAliveCallback
Type of a device alive callback function Important: Never call register_device_alive_callback() from ...
This struct represents a CANOpen message.
void reset_all_nodes()
Resets all nodes in the network.