Functions for routing RX can frames. More...
Functions for routing RX can frames.
Definition in file router.h.
Go to the source code of this file.
void | can_router_init (void) |
Initialize CAN router. | |
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 . More... | |
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 . More... | |
int | can_router_free_frame (struct can_frame *frame) |
Free a received frame. More... | |
int | can_router_dispatch_rx_indic (can_pkt_t *pkt) |
Dispatch a RX indication to subscribers threads. More... | |
int | can_router_dispatch_tx_conf (can_pkt_t *pkt) |
Dispatch a TX confirmation to the sender's thread. More... | |
int | can_router_dispatch_tx_error (can_pkt_t *pkt) |
Dispatch a TX error to the sender's thread. More... | |
int can_router_dispatch_rx_indic | ( | can_pkt_t * | pkt | ) |
Dispatch a RX indication to subscribers threads.
This function goes through the list of subscribed filters to send a message to each subscriber's thread. If all the subscriber's threads cannot receive message, the packet is freed.
[in] | pkt | the packet to dispatch |
int can_router_dispatch_tx_conf | ( | can_pkt_t * | pkt | ) |
Dispatch a TX confirmation to the sender's thread.
[in] | pkt | the correctly sent packet |
int can_router_dispatch_tx_error | ( | can_pkt_t * | pkt | ) |
Dispatch a TX error to the sender's thread.
[in] | pkt | the error packet |
int can_router_free_frame | ( | struct can_frame * | frame | ) |
Free a received frame.
This function decrements the ref counter of the packet and frees it if the packet is no more in use.
[in] | frame | the frame to free, it must be a frame returned by the stack |
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
.
[in] | entry | the entry containing ifnum and user info |
[in] | can_id | the CAN ID of the frame to receive |
[in] | mask | the mask of the frame to receive |
[in] | param | a user private pointer |
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
.
The filter is unregistered from the 'router' layer if can_id
, mask
and param
matches a registered entry.
[in] | entry | the entry containing ifnum and user info which was registered |
[in] | can_id | the CAN ID of the frame to stop receiving |
[in] | mask | the mask of the frame to stop receiving |
[in] | param | a user private pointer |
can_id
is not used anymore can_id
is still used by another pid