CAN CoreX 2.3.1
Table-driven CAN, CAN FD, ISO-TP, network simulation, and bus monitoring library
Loading...
Searching...
No Matches
Network

Simulation. More...

Data Structures

struct  CCX_net_node_settings_t
 Network node settings. More...
struct  CCX_net_node_t
 Network node entry. More...
struct  CCX_net_t
 CAN network structure. More...

Macros

#define CCX_MAX_INSTANCE_IN_NETWORK   12
 Maximum number of CAN instances that can be connected to a single network.

Typedefs

typedef struct CCX_net_t CCX_net_t

Enumerations

enum  CCX_net_status_t { CCX_NET_OK = 0 , CCX_NET_ALREDY_EXISTING , CCX_NET_DOES_NOT_EXISTING , CCX_NET_NULL }
 Network operation status codes.
enum  CCX_net_replication_t { CCX_NET_TX_REPLICATION = 0 , CCX_NET_TX_RX_REPLICATION }
 Message replication modes for network nodes. More...
enum  CCX_net_node_type_t { CCX_NET_NODE_IN_NET = 0 , CCX_NET_NODE_REPEATER }
 Network node types. More...

Functions

CCX_net_status_t CCX_net_init (CCX_net_t *net)
 Initialize a CAN network.
CCX_net_status_t CCX_net_deinit (CCX_net_t *net)
 Remove a CAN network from global list.
CCX_net_status_t CCX_net_clear_nodes (CCX_net_t *net)
 Clear all nodes from a network.

Detailed Description

Simulation.

Message replication between multiple CAN CoreX instances.

Enumeration Type Documentation

◆ CCX_net_node_type_t

Network node types.

Defines whether a node's transmitted messages propagate to the network.

Note
Example:
  • NODE_IN_NET: Node A transmits → message reaches Node B, C, D
  • NODE_REPEATER: Node A transmits → message stays local, but Node A still repeats messages from B, C, D to its physical bus

◆ CCX_net_replication_t

Message replication modes for network nodes.

Defines how messages from other nodes in the network are handled.

Note
Example: Node A sends message → Node B receives it:
  • TX_REPLICATION: Message appears only in Node B's TX buffer (forwarded to bus)
  • TX_RX_REPLICATION: Message appears in both TX and RX buffers (forwarded + processed)

Function Documentation

◆ CCX_net_clear_nodes()

CCX_net_status_t CCX_net_clear_nodes ( CCX_net_t * net)

Clear all nodes from a network.

Resets all node entries to NULL with default settings:

  • NodeInstance: NULL
  • Replication: CCX_NET_TX_REPLICATION
  • NodeType: CCX_NET_NODE_IN_NET
Parameters
netPointer to network to clear
Returns
CCX_NET_OK on success
CCX_NET_NULL if net is NULL
Note
This does NOT remove the network from the global list (use CCX_net_deinit for that)

◆ CCX_net_deinit()

CCX_net_status_t CCX_net_deinit ( CCX_net_t * net)

Remove a CAN network from global list.

Removes the network from the global linked list. Does not affect node instances.

Parameters
netPointer to network to remove
Returns
CCX_NET_OK on success
CCX_NET_NULL if net is NULL
CCX_NET_DOES_NOT_EXISTING if network not found in list

◆ CCX_net_init()

CCX_net_status_t CCX_net_init ( CCX_net_t * net)

Initialize a CAN network.

Adds the network to the global network list. Networks are managed as a linked list to support multiple independent networks.

Parameters
netPointer to network structure to initialize
Returns
CCX_NET_OK on success
CCX_NET_NULL if net is NULL
CCX_NET_ALREDY_EXISTING if network already in list
Note
Network node list is NOT cleared - call CCX_net_clear_nodes() first if needed