Classes | Functions
socketcan.h File Reference
#include <canard.h>
Include dependency graph for socketcan.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  SocketCANInstance
 

Functions

int16_t socketcanClose (SocketCANInstance *ins)
 
int socketcanGetSocketFileDescriptor (const SocketCANInstance *ins)
 
int16_t socketcanInit (SocketCANInstance *out_ins, const char *can_iface_name)
 
int16_t socketcanReceive (SocketCANInstance *ins, CanardCANFrame *out_frame, int32_t timeout_msec)
 
int16_t socketcanTransmit (SocketCANInstance *ins, const CanardCANFrame *frame, int32_t timeout_msec)
 

Function Documentation

◆ socketcanClose()

int16_t socketcanClose ( SocketCANInstance ins)

Deinitializes the SocketCAN instance. Returns 0 on success, negative on error.

Definition at line 89 of file socketcan.c.

◆ socketcanGetSocketFileDescriptor()

int socketcanGetSocketFileDescriptor ( const SocketCANInstance ins)

Returns the file descriptor of the CAN socket. Can be used for external IO multiplexing.

Definition at line 180 of file socketcan.c.

◆ socketcanInit()

int16_t socketcanInit ( SocketCANInstance out_ins,
const char *  can_iface_name 
)

Initializes the SocketCAN instance. Returns 0 on success, negative on error.

Definition at line 45 of file socketcan.c.

◆ socketcanReceive()

int16_t socketcanReceive ( SocketCANInstance ins,
CanardCANFrame *  out_frame,
int32_t  timeout_msec 
)

Receives a CanardCANFrame from the CAN socket. Use negative timeout to block infinitely. Returns 1 on successful reception, 0 on timeout, negative on error.

Definition at line 136 of file socketcan.c.

◆ socketcanTransmit()

int16_t socketcanTransmit ( SocketCANInstance ins,
const CanardCANFrame *  frame,
int32_t  timeout_msec 
)

Transmits a CanardCANFrame to the CAN socket. Use negative timeout to block infinitely. Returns 1 on successful transmission, 0 on timeout, negative on error.

Definition at line 96 of file socketcan.c.



uavcan_communicator
Author(s):
autogenerated on Fri Dec 13 2024 03:10:03