File can_driver.h

FileList > examples > python_api > inc > can_driver.h

Go to the source code of this file

  • #include <stdint.h>

Classes

Type Name
struct can_driver_t

Public Functions

Type Name
int can_receive (uint32_t * id, uint8_t * data, uint8_t * len)
Receives a CAN frame using the active CAN driver.
int can_send (uint32_t id, const uint8_t * data, uint8_t len)
Sends a CAN frame using the active CAN driver.
void can_set_driver (const can_driver_t * driver)
Sets the active CAN driver to be used by the ISO-TP implementation.

Public Functions Documentation

function can_receive

Receives a CAN frame using the active CAN driver.

int can_receive (
    uint32_t * id,
    uint8_t * data,
    uint8_t * len
) 

Parameters:

  • id Pointer to store the received CAN ID.
  • data Pointer to buffer to store the received CAN data.
  • len Pointer to variable to store the length of the received CAN data.

Returns:

int 0 on success, -1 if the queue is empty or if the driver is not set.


function can_send

Sends a CAN frame using the active CAN driver.

int can_send (
    uint32_t id,
    const uint8_t * data,
    uint8_t len
) 

Parameters:

  • id CAN ID to send.
  • data Pointer to the CAN data to send.
  • len Length of the CAN data to send.

Returns:

int 0 on success, -1 on failure (e.g., if the driver is not set or if send fails).


function can_set_driver

Sets the active CAN driver to be used by the ISO-TP implementation.

void can_set_driver (
    const can_driver_t * driver
) 

Parameters:

  • driver Pointer to the CAN driver to set as active.


The documentation for this class was generated from the following file examples/python_api/inc/can_driver.h