Loading...
Searching...
No Matches
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
9#pragma once
10
21
22#ifdef __cplusplus
23extern "C" {
24#endif
25
26#include "can/can.h"
27#include "can/pkt.h"
28
32void can_router_init(void);
33
45int can_router_register(can_reg_entry_t *entry, canid_t can_id, canid_t mask, void *param);
46
62int can_router_unregister(can_reg_entry_t *entry, canid_t can_id, canid_t mask, void *param);
63
76
90
100
110
111#ifdef __cplusplus
112}
113#endif
114
CAN memory allocation module.
struct can_reg_entry can_reg_entry_t
registry entry
struct can_frame can_frame_t
CAN frame.
Definition can.h:178
uint32_t canid_t
Controller Area Network Identifier structure.
Definition can.h:95
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.
A CAN packet.
Definition pkt.h:40
Definitions high-level CAN interface.