CAN CoreX 2.3.1
Table-driven CAN, CAN FD, ISO-TP, network simulation, and bus monitoring library
Loading...
Searching...
No Matches
can_corex_net.h
Go to the documentation of this file.
1/*
2 * This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
5 *
6 * Author: Adrian Pietrzak
7 * GitHub: https://github.com/AdrianPietrzak1998
8 * Created: Aug 26, 2025
9 */
10
11#ifndef CAN_COREX_CAN_COREX_NET_H_
12#define CAN_COREX_CAN_COREX_NET_H_
13
14#include "can_corex.h"
15
16#ifdef __cplusplus
17extern "C"
18{
19#endif
20
30
36#define CCX_MAX_INSTANCE_IN_NETWORK 12
37
41 typedef enum
42 {
43 CCX_NET_OK = 0, /* Operation successful */
44 CCX_NET_ALREDY_EXISTING, /* Network already exists in global list */
45 CCX_NET_DOES_NOT_EXISTING, /* Network not found in global list */
46 CCX_NET_NULL /* NULL pointer provided */
48
59 typedef enum
60 {
61 CCX_NET_TX_REPLICATION = 0, /* Forward to TX buffer only (physical layer forwarding) */
62 CCX_NET_TX_RX_REPLICATION, /* Forward to TX and RX buffers (act as if received locally) */
64
75 typedef enum
76 {
77 CCX_NET_NODE_IN_NET = 0, /* Full participant - TX messages reach network */
78 CCX_NET_NODE_REPEATER, /* Repeater only - TX stays local, RX is repeated */
80
84 typedef struct
85 {
86 CCX_net_replication_t Replication; /* How to handle messages from other nodes */
87 CCX_net_node_type_t NodeType; /* Full participant vs repeater */
89
93 typedef struct
94 {
95 CCX_instance_t *NodeInstance; /* CAN instance for this node */
96 CCX_net_node_settings_t NodeSettings; /* Node behavior configuration */
98
99 typedef struct CCX_net_t CCX_net_t;
100
139 {
140 CCX_net_node_t NodeList[CCX_MAX_INSTANCE_IN_NETWORK]; /* Array of nodes in this network */
141 CCX_net_t *next; /* Next network in global linked list */
142 };
143
158
170
186
188
189#ifdef __cplusplus
190}
191#endif
192
193#endif /* CAN_COREX_CAN_COREX_NET_H_ */
Core CAN CoreX public API.
CCX_net_node_type_t
Network node types.
Definition can_corex_net.h:76
CCX_net_status_t CCX_net_deinit(CCX_net_t *net)
Remove a CAN network from global list.
#define CCX_MAX_INSTANCE_IN_NETWORK
Maximum number of CAN instances that can be connected to a single network.
Definition can_corex_net.h:36
CCX_net_status_t CCX_net_init(CCX_net_t *net)
Initialize a CAN network.
CCX_net_status_t CCX_net_clear_nodes(CCX_net_t *net)
Clear all nodes from a network.
CCX_net_status_t
Network operation status codes.
Definition can_corex_net.h:42
CCX_net_replication_t
Message replication modes for network nodes.
Definition can_corex_net.h:60
Definition can_corex.h:460
Network node settings.
Definition can_corex_net.h:85
Network node entry.
Definition can_corex_net.h:94
CAN network structure.
Definition can_corex_net.h:139