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 "kernel_types.h"
28 
29 #include "can/can.h"
30 #include "can/pkt.h"
31 
35 void can_router_init(void);
36 
48 int can_router_register(can_reg_entry_t *entry, canid_t can_id, canid_t mask, void *param);
49 
65 int can_router_unregister(can_reg_entry_t *entry, canid_t can_id, canid_t mask, void *param);
66 
78 int can_router_free_frame(struct can_frame *frame);
79 
93 
103 
113 
114 #ifdef __cplusplus
115 }
116 #endif
117 
118 #endif /* CAN_ROUTER_H */
119 
can_router_free_frame
int can_router_free_frame(struct can_frame *frame)
Free a received frame.
can.h
Definitions high-level CAN interface.
can_router_register
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.
can_frame
Controller Area Network frame.
Definition: can.h:88
can_router_dispatch_tx_conf
int can_router_dispatch_tx_conf(can_pkt_t *pkt)
Dispatch a TX confirmation to the sender's thread.
can_pkt_t
A CAN packet.
Definition: pkt.h:41
pkt.h
CAN memory allocation module.
can_router_init
void can_router_init(void)
Initialize CAN router.
can_router_unregister
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.
can_router_dispatch_tx_error
int can_router_dispatch_tx_error(can_pkt_t *pkt)
Dispatch a TX error to the sender's thread.
can_reg_entry
registry entry
Definition: common.h:143
can_router_dispatch_rx_indic
int can_router_dispatch_rx_indic(can_pkt_t *pkt)
Dispatch a RX indication to subscribers threads.
kernel_types.h
Types used by the kernel.
canid_t
uint32_t canid_t
Controller Area Network Identifier structure.
Definition: can.h:83