Definitions of low-level CAN DLL interface. More...

Detailed Description

Definitions of low-level CAN DLL interface.

Author
Vincent Dupont vince.nosp@m.nt@o.nosp@m.takey.nosp@m.s.co.nosp@m.m
Toon Stegen toon..nosp@m.steg.nosp@m.en@al.nosp@m.tran.nosp@m..com

Definition in file dll.h.

#include "can/common.h"
#include "can/pkt.h"
#include "can/device.h"
#include "thread.h"
+ Include dependency graph for dll.h:

Go to the source code of this file.

int can_dll_init (void)
 Initialize the CAN DLL. More...
 
int can_dll_register_candev (candev_dev_t *candev)
 Register a CAN device into the DLL. More...
 
int can_dll_dispatch_rx_frame (struct can_frame *frame, kernel_pid_t pid)
 Dispatch a received frame. More...
 
int can_dll_dispatch_tx_conf (can_pkt_t *pkt)
 Dispatch a tx confirmation. More...
 
int can_dll_dispatch_tx_error (can_pkt_t *pkt)
 Dispatch a tx error. More...
 
int can_dll_dispatch_bus_off (kernel_pid_t pid)
 Dispatch RX error from a device. More...
 

Function Documentation

◆ can_dll_dispatch_bus_off()

int can_dll_dispatch_bus_off ( kernel_pid_t  pid)

Dispatch RX error from a device.

Dispatch RX error from a device to receivers threads which have subscribed to frames on that interface

Parameters
[in]pidthe device thread pid
Returns
0 on success

◆ can_dll_dispatch_rx_frame()

int can_dll_dispatch_rx_frame ( struct can_frame frame,
kernel_pid_t  pid 
)

Dispatch a received frame.

This function is used to send a message to the DLL thread when a frame is received from the device identified by its pid

Parameters
[in]framethe received frame
[in]pidthe pid of the receiver device
Returns
0 on success
-ENOMEM if the message can not be sent

◆ can_dll_dispatch_tx_conf()

int can_dll_dispatch_tx_conf ( can_pkt_t pkt)

Dispatch a tx confirmation.

This function is used to send a message to the sender thread when the pkt has been sent correctly.

Parameters
[in]pktthe pkt which has been sent
Returns
0 on success
-ENOMEM if the message can not be sent

◆ can_dll_dispatch_tx_error()

int can_dll_dispatch_tx_error ( can_pkt_t pkt)

Dispatch a tx error.

This function is used to send a message to the sender thread when the pkt has not been sent correctly

Parameters
[in]pktthe pkt which has not been sent correctly
Returns
0 on success
-ENOMEM if the message can not be sent

◆ can_dll_init()

int can_dll_init ( void  )

Initialize the CAN DLL.

Returns
0 on success

◆ can_dll_register_candev()

int can_dll_register_candev ( candev_dev_t candev)

Register a CAN device into the DLL.

This function must be called by the device thread to register the device into the DLL

Parameters
[in]candevthe candev to register
Returns
interface number on success
-ENODEV if ifnum is invalid