VCAN  2.0.0
Virtual CAN bus
Data Fields
vcan_node Struct Reference

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...
 

Detailed Description

Virtual node.

Contains a copy of the last received message and a callback function, which is called whenever a message is received.

Field Documentation

◆ callback_on_rx

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.

Parameters
nodethe 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.

◆ other_custom_data

void* vcan_node::other_custom_data

Any data the callback may need, such as a flag to trigger on reception.

Can be NULL.

◆ id

uint32_t vcan_node::id

Identifier of the node.

Can be set to anything, VCAN does not use it.


The documentation for this struct was generated from the following file: