libnl 3.7.0

Controller Area Network link module. More...

Control Mode Translation

char * rtnl_link_can_ctrlmode2str (int ctrlmode, char *buf, size_t len)
 
int rtnl_link_can_str2ctrlmode (const char *name)
 

CAN Object

int rtnl_link_is_can (struct rtnl_link *link)
 Check if link is a CAN link. More...
 
int rtnl_link_can_restart (struct rtnl_link *link)
 Restart CAN device. More...
 
int rtnl_link_can_freq (struct rtnl_link *link, uint32_t *freq)
 Get CAN base frequency. More...
 
int rtnl_link_can_state (struct rtnl_link *link, uint32_t *state)
 Get CAN state. More...
 
int rtnl_link_can_berr_rx (struct rtnl_link *link)
 Get CAN RX bus error count. More...
 
int rtnl_link_can_berr_tx (struct rtnl_link *link)
 Get CAN TX bus error count. More...
 
int rtnl_link_can_berr (struct rtnl_link *link, struct can_berr_counter *berr)
 Get CAN bus error count. More...
 
int rtnl_link_can_get_bt_const (struct rtnl_link *link, struct can_bittiming_const *bt_const)
 Get CAN hardware-dependent bit-timing constant. More...
 
int rtnl_link_can_get_bittiming (struct rtnl_link *link, struct can_bittiming *bit_timing)
 Get CAN device bit-timing. More...
 
int rtnl_link_can_set_bittiming (struct rtnl_link *link, const struct can_bittiming *bit_timing)
 Set CAN device bit-timing. More...
 
int rtnl_link_can_get_bitrate (struct rtnl_link *link, uint32_t *bitrate)
 Get CAN device bit-timing. More...
 
int rtnl_link_can_set_bitrate (struct rtnl_link *link, uint32_t bitrate)
 Set CAN device bit-rate. More...
 
int rtnl_link_can_get_sample_point (struct rtnl_link *link, uint32_t *sp)
 Get CAN device sample point. More...
 
int rtnl_link_can_set_sample_point (struct rtnl_link *link, uint32_t sp)
 Set CAN device sample point. More...
 
int rtnl_link_can_get_restart_ms (struct rtnl_link *link, uint32_t *interval)
 Get CAN device restart intervall. More...
 
int rtnl_link_can_set_restart_ms (struct rtnl_link *link, uint32_t interval)
 Set CAN device restart intervall. More...
 
int rtnl_link_can_get_ctrlmode (struct rtnl_link *link, uint32_t *ctrlmode)
 Get CAN control mode. More...
 
int rtnl_link_can_set_ctrlmode (struct rtnl_link *link, uint32_t ctrlmode)
 Set a CAN Control Mode. More...
 
int rtnl_link_can_unset_ctrlmode (struct rtnl_link *link, uint32_t ctrlmode)
 Unset a CAN Control Mode. More...
 
int rtnl_link_can_get_data_bittiming_const (struct rtnl_link *link, struct can_bittiming_const *data_bt_const)
 Get CAN FD hardware-dependent data bit-timing constant. More...
 
int rtnl_link_can_set_data_bittiming_const (struct rtnl_link *link, const struct can_bittiming_const *data_bt_const)
 Set CAN FD device data bit-timing-const. More...
 
int rtnl_link_can_get_data_bittiming (struct rtnl_link *link, struct can_bittiming *data_bit_timing)
 Get CAN FD device data bit-timing. More...
 
int rtnl_link_can_set_data_bittiming (struct rtnl_link *link, const struct can_bittiming *data_bit_timing)
 Set CAN FD device data bit-timing. More...
 

Detailed Description

Controller Area Network link module.

Link Type Name: "can"

CAN Documentation (Netlink Routing Development Guide)

Function Documentation

◆ rtnl_link_is_can()

int rtnl_link_is_can ( struct rtnl_link link)

Check if link is a CAN link.

Parameters
linkLink object
Returns
True if link is a CAN link, otherwise false is returned.

Definition at line 389 of file can.c.

◆ rtnl_link_can_restart()

int rtnl_link_can_restart ( struct rtnl_link link)

Restart CAN device.

Parameters
linkLink object
Returns
0 on success or a negative error code

Definition at line 400 of file can.c.

◆ rtnl_link_can_freq()

int rtnl_link_can_freq ( struct rtnl_link link,
uint32_t *  freq 
)

Get CAN base frequency.

Parameters
linkLink object
freqfrequency in Hz
Returns
0 on success or a negative error code

Definition at line 419 of file can.c.

◆ rtnl_link_can_state()

int rtnl_link_can_state ( struct rtnl_link link,
uint32_t *  state 
)

Get CAN state.

Parameters
linkLink object
stateCAN bus state
Returns
0 on success or a negative error code

Definition at line 441 of file can.c.

◆ rtnl_link_can_berr_rx()

int rtnl_link_can_berr_rx ( struct rtnl_link link)

Get CAN RX bus error count.

Parameters
linkLink object
Returns
RX bus error count on success or a negative error code

Definition at line 460 of file can.c.

◆ rtnl_link_can_berr_tx()

int rtnl_link_can_berr_tx ( struct rtnl_link link)

Get CAN TX bus error count.

Parameters
linkLink object
Returns
TX bus error count on success or a negative error code

Definition at line 478 of file can.c.

◆ rtnl_link_can_berr()

int rtnl_link_can_berr ( struct rtnl_link link,
struct can_berr_counter *  berr 
)

Get CAN bus error count.

Parameters
linkLink object
berrBus error count
Returns
0 on success or a negative error code

Definition at line 497 of file can.c.

◆ rtnl_link_can_get_bt_const()

int rtnl_link_can_get_bt_const ( struct rtnl_link link,
struct can_bittiming_const *  bt_const 
)

Get CAN hardware-dependent bit-timing constant.

Parameters
linkLink object
bt_constBit-timing constant
Returns
0 on success or a negative error code

Definition at line 520 of file can.c.

◆ rtnl_link_can_get_bittiming()

int rtnl_link_can_get_bittiming ( struct rtnl_link link,
struct can_bittiming *  bit_timing 
)

Get CAN device bit-timing.

Parameters
linkLink object
bit_timingCAN bit-timing
Returns
0 on success or a negative error code

Definition at line 544 of file can.c.

◆ rtnl_link_can_set_bittiming()

int rtnl_link_can_set_bittiming ( struct rtnl_link link,
const struct can_bittiming *  bit_timing 
)

Set CAN device bit-timing.

Parameters
linkLink object
bit_timingCAN bit-timing
Returns
0 on success or a negative error code

Definition at line 568 of file can.c.

◆ rtnl_link_can_get_bitrate()

int rtnl_link_can_get_bitrate ( struct rtnl_link link,
uint32_t *  bitrate 
)

Get CAN device bit-timing.

Parameters
linkLink object
bitrateCAN bitrate
Returns
0 on success or a negative error code

Definition at line 590 of file can.c.

◆ rtnl_link_can_set_bitrate()

int rtnl_link_can_set_bitrate ( struct rtnl_link link,
uint32_t  bitrate 
)

Set CAN device bit-rate.

Parameters
linkLink object
bitrateCAN bitrate
Returns
0 on success or a negative error code

Definition at line 613 of file can.c.

◆ rtnl_link_can_get_sample_point()

int rtnl_link_can_get_sample_point ( struct rtnl_link link,
uint32_t *  sp 
)

Get CAN device sample point.

Parameters
linkLink object
spCAN sample point
Returns
0 on success or a negative error code

Definition at line 632 of file can.c.

◆ rtnl_link_can_set_sample_point()

int rtnl_link_can_set_sample_point ( struct rtnl_link link,
uint32_t  sp 
)

Set CAN device sample point.

Parameters
linkLink object
spCAN sample point
Returns
0 on success or a negative error code

Definition at line 655 of file can.c.

◆ rtnl_link_can_get_restart_ms()

int rtnl_link_can_get_restart_ms ( struct rtnl_link link,
uint32_t *  interval 
)

Get CAN device restart intervall.

Parameters
linkLink object
intervalRestart intervall in ms
Returns
0 on success or a negative error code

Definition at line 674 of file can.c.

◆ rtnl_link_can_set_restart_ms()

int rtnl_link_can_set_restart_ms ( struct rtnl_link link,
uint32_t  interval 
)

Set CAN device restart intervall.

Parameters
linkLink object
intervalRestart intervall in ms
Returns
0 on success or a negative error code

Definition at line 697 of file can.c.

◆ rtnl_link_can_get_ctrlmode()

int rtnl_link_can_get_ctrlmode ( struct rtnl_link link,
uint32_t *  ctrlmode 
)

Get CAN control mode.

Parameters
linkLink object
ctrlmodeCAN control mode
Returns
0 on success or a negative error code

Definition at line 716 of file can.c.

◆ rtnl_link_can_set_ctrlmode()

int rtnl_link_can_set_ctrlmode ( struct rtnl_link link,
uint32_t  ctrlmode 
)

Set a CAN Control Mode.

Parameters
linkLink object
ctrlmodeCAN control mode
Returns
0 on success or a negative error code

Definition at line 739 of file can.c.

◆ rtnl_link_can_unset_ctrlmode()

int rtnl_link_can_unset_ctrlmode ( struct rtnl_link link,
uint32_t  ctrlmode 
)

Unset a CAN Control Mode.

Parameters
linkLink object
ctrlmodeCAN control mode
Returns
0 on success or a negative error code

Definition at line 759 of file can.c.

◆ rtnl_link_can_get_data_bittiming_const()

int rtnl_link_can_get_data_bittiming_const ( struct rtnl_link link,
struct can_bittiming_const *  data_bt_const 
)

Get CAN FD hardware-dependent data bit-timing constant.

Parameters
linkLink object
data_bt_constCAN FD data bit-timing constant
Returns
0 on success or a negative error code

Definition at line 779 of file can.c.

◆ rtnl_link_can_set_data_bittiming_const()

int rtnl_link_can_set_data_bittiming_const ( struct rtnl_link link,
const struct can_bittiming_const *  data_bt_const 
)

Set CAN FD device data bit-timing-const.

Parameters
linkLink object
data_bit_timingCAN FD data bit-timing
Returns
0 on success or a negative error code

Definition at line 803 of file can.c.

◆ rtnl_link_can_get_data_bittiming()

int rtnl_link_can_get_data_bittiming ( struct rtnl_link link,
struct can_bittiming *  data_bit_timing 
)

Get CAN FD device data bit-timing.

Parameters
linkLink object
data_bit_timingCAN FD data bit-timing
Returns
0 on success or a negative error code

Definition at line 825 of file can.c.

◆ rtnl_link_can_set_data_bittiming()

int rtnl_link_can_set_data_bittiming ( struct rtnl_link link,
const struct can_bittiming *  data_bit_timing 
)

Set CAN FD device data bit-timing.

Parameters
linkLink object
data_bit_timingCAN FD data bit-timing
Returns
0 on success or a negative error code

Definition at line 849 of file can.c.

◆ rtnl_link_can_ctrlmode2str()

char * rtnl_link_can_ctrlmode2str ( int  ctrlmode,
char *  buf,
size_t  len 
)

Definition at line 882 of file can.c.

◆ rtnl_link_can_str2ctrlmode()

int rtnl_link_can_str2ctrlmode ( const char *  name)

Definition at line 888 of file can.c.