EduArt Sensor Ring Library 4.0.0
Loading...
Searching...
No Matches
eduart::sensorring::com::CanParams Struct Reference

Shared parameters for a CAN interfaces. More...

#include <InterfaceParams.hpp>

Inheritance diagram for eduart::sensorring::com::CanParams:
[legend]
Collaboration diagram for eduart::sensorring::com::CanParams:
[legend]

Public Member Functions

void send_with_brs (bool enable)
 Enable CAN FD bit rate switching for the data phase when the host sends messages to the sensor boards. The send_with_brs parameter is protected by this function to prevent accidental misuse. Be sure that the host CAN controller supports TDC (transmitter delay compensation), otherwise communication may become unreliable.
bool send_with_brs () const
 Get whether CAN FD bit rate switching for the data phase is enabled when the host sends messages to the sensor boards.
 CanParams (std::string interface_name, bool respond_with_brs=false, unsigned int data_bitrate=0, float data_sample_point=0.0f)

Public Attributes

bool respond_with_brs = false
 Enable CAN FD bit rate switching for the data phase when the sensor boards send messages to the host.
unsigned int data_bitrate = 0
 Data bitrate in bits per second in the range [1000000, 8000000]. Only relevant if one of the brs settings is true. Default 0 uses the same bitrate for arbitration and data phase (1 Mbps).
float data_sample_point = 0.0f
 Data sample point in the range [0, 1]. Optional parameter for fine-tuning. Default 0 uses the CAN controller's default sample point.
Public Attributes inherited from eduart::sensorring::com::InterfaceParams
std::string name
 Interface identifier (e.g. "can0" for SocketCAN, serial number for USBtingo).

Additional Inherited Members

Protected Member Functions inherited from eduart::sensorring::com::InterfaceParams
 InterfaceParams (std::string name)

Detailed Description

Shared parameters for a CAN interfaces.

Member Function Documentation

◆ send_with_brs() [1/2]

bool eduart::sensorring::com::CanParams::send_with_brs ( ) const
inline

Get whether CAN FD bit rate switching for the data phase is enabled when the host sends messages to the sensor boards.

Returns
Whether BRS for sending messages is enabled.

◆ send_with_brs() [2/2]

void eduart::sensorring::com::CanParams::send_with_brs ( bool enable)
inline

Enable CAN FD bit rate switching for the data phase when the host sends messages to the sensor boards. The send_with_brs parameter is protected by this function to prevent accidental misuse. Be sure that the host CAN controller supports TDC (transmitter delay compensation), otherwise communication may become unreliable.

Parameters
enableWhether to enable BRS for sending messages.

The documentation for this struct was generated from the following file: