VCAN
2.0.0
Virtual CAN bus
|
Virtual node. More...
#include <vcan.h>
Data Fields | |
void(* | callback_on_rx )(struct vcan_node *node, const vcan_msg_t *msg) |
Callback called when a message has been written into received_msg . More... | |
void * | other_custom_data |
Any data the callback may need, such as a flag to trigger on reception. More... | |
uint32_t | id |
Identifier of the node. More... | |
Virtual node.
Contains a copy of the last received message and a callback function, which is called whenever a message is received.
void(* vcan_node::callback_on_rx) (struct vcan_node *node, const vcan_msg_t *msg) |
Callback called when a message has been written into received_msg
.
NOTE: the callback should be simple and fast, e.g. copying the message somewhere else and triggering a flag.
node | the address of this node. The whole node itself is passed to the callback, so the function has access to itself (for recursion), to any custom data it may need and of course to the just received message. |
void* vcan_node::other_custom_data |
Any data the callback may need, such as a flag to trigger on reception.
Can be NULL.
uint32_t vcan_node::id |
Identifier of the node.
Can be set to anything, VCAN does not use it.