QtCanBus Namespace

The QtCanBus namespace provides some commons enums that are used in the CAN bus handling part of the QtSerialPort 模块。 更多...

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

类型

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

详细描述

类型文档编制

enum class QtCanBus:: DataFormat

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

常量 描述
QtCanBus::DataFormat::SignedInteger 0 The signal value is a signed integer.
QtCanBus::DataFormat::UnsignedInteger 1 The signal value is an unsigned integer.
QtCanBus::DataFormat::Float 2 The signal value is float.
QtCanBus::DataFormat::Double 3 The signal value is double.
QtCanBus::DataFormat::AsciiString 4 The signal value is an ASCII string.

enum class QtCanBus:: DataSource

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

常量 描述
QtCanBus::DataSource::Payload 0 The data will be extracted from the payload.
QtCanBus::DataSource::FrameId 1 The data will be extracted from the frame ID.

enum class QtCanBus:: MultiplexState

This enum represents the possible multiplex states of a signal.

常量 描述
QtCanBus::MultiplexState::None 0x00 The signal is not used in multiplexing.
QtCanBus::MultiplexState::MultiplexorSwitch 0x01 The signal is used as a multiplexor switch, which means that other signals depend on the values of this signal.
QtCanBus::MultiplexState::MultiplexedSignal 0x02 The signal is multiplexed by some switch, and therefore its value can only be extracted when the switch has a specific value.
QtCanBus::MultiplexState::SwitchAndSignal MultiplexorSwitch | MultiplexedSignal The 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.