QtCanBus Namespace

The QtCanBus namespace provides some commons enums that are used in the CAN bus handling part of the QtSerialPort module. More...

Header: #include <QtCanBus>
CMake: find_package(Qt6 REQUIRED COMPONENTS SerialBus)
target_link_libraries(mytarget PRIVATE Qt6::SerialBus)
qmake: QT += serialbus
Since: Qt 6.5

Types

enum class DataFormat { SignedInteger, UnsignedInteger, Float, Double, AsciiString }
enum class DataSource { Payload, FrameId }
enum class MultiplexState { None, MultiplexorSwitch, MultiplexedSignal, SwitchAndSignal }
enum class UniqueId { }

Detailed Description

Type Documentation

enum class QtCanBus::DataFormat

This enum represents the possible data formats. The format defines how the value will be extracted from its source.

ConstantValueDescription
QtCanBus::DataFormat::SignedInteger0The signal value is a signed integer.
QtCanBus::DataFormat::UnsignedInteger1The signal value is an unsigned integer.
QtCanBus::DataFormat::Float2The signal value is float.
QtCanBus::DataFormat::Double3The signal value is double.
QtCanBus::DataFormat::AsciiString4The signal value is an ASCII string.

enum class QtCanBus::DataSource

This enum represents the placement of the data within the CAN frame.

ConstantValueDescription
QtCanBus::DataSource::Payload0The data will be extracted from the payload.
QtCanBus::DataSource::FrameId1The data will be extracted from the frame ID.

enum class QtCanBus::MultiplexState

This enum represents the possible multiplex states of a signal.

ConstantValueDescription
QtCanBus::MultiplexState::None0x00The signal is not used in multiplexing.
QtCanBus::MultiplexState::MultiplexorSwitch0x01The signal is used as a multiplexor switch, which means that other signals depend on the values of this signal.
QtCanBus::MultiplexState::MultiplexedSignal0x02The signal is multiplexed by some switch, and therefore its value can only be extracted when the switch has a specific value.
QtCanBus::MultiplexState::SwitchAndSignalMultiplexorSwitch | MultiplexedSignalThe multiplexor switch of the signal must have the value that enables us to use this signal. When used, the signal also acts as a multiplexor switch for other multiplexed signals.

enum class QtCanBus::UniqueId

Represents a CAN unique identifier. The underlying type is quint32.

An enum is used to avoid implicit conversions to or from unsigned int.