#include <canard.h>
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) |
int16_t socketcanClose | ( | SocketCANInstance * | ins | ) |
Deinitializes the SocketCAN instance. Returns 0 on success, negative on error.
Definition at line 89 of file socketcan.c.
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.
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.
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.
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.