router.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2016-2018 OTA keys S.A.
3  *
4  * This file is subject to the terms and conditions of the GNU Lesser General
5  * Public License v2.1. See the file LICENSE in the top level directory for more
6  * details.
7  */
8 
20 #ifndef CAN_ROUTER_H
21 #define CAN_ROUTER_H
22 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 
27 #include "can/can.h"
28 #include "can/pkt.h"
29 
33 void can_router_init(void);
34 
46 int can_router_register(can_reg_entry_t *entry, canid_t can_id, canid_t mask, void *param);
47 
63 int can_router_unregister(can_reg_entry_t *entry, canid_t can_id, canid_t mask, void *param);
64 
77 
91 
101 
111 
112 #ifdef __cplusplus
113 }
114 #endif
115 
116 #endif /* CAN_ROUTER_H */
CAN memory allocation module.
uint32_t canid_t
Controller Area Network Identifier structure.
Definition: can.h:96
int can_router_register(can_reg_entry_t *entry, canid_t can_id, canid_t mask, void *param)
Register a user entry to receive a frame can_id.
void can_router_init(void)
Initialize CAN router.
int can_router_unregister(can_reg_entry_t *entry, canid_t can_id, canid_t mask, void *param)
Unregister a user entry from receiving can_id.
int can_router_free_frame(can_frame_t *frame)
Free a received frame.
int can_router_dispatch_tx_error(can_pkt_t *pkt)
Dispatch a TX error to the sender's thread.
int can_router_dispatch_tx_conf(can_pkt_t *pkt)
Dispatch a TX confirmation to the sender's thread.
int can_router_dispatch_rx_indic(can_pkt_t *pkt)
Dispatch a RX indication to subscribers threads.
Controller Area Network frame.
Definition: can.h:101
A CAN packet.
Definition: pkt.h:41
registry entry
Definition: common.h:156
Definitions high-level CAN interface.