QCanUniqueIdDescription Class▲
-
Header: QCanUniqueIdDescription
-
Since: Qt 6.5
-
CMake:
find_package(Qt6 REQUIRED COMPONENTS SerialBus)
target_link_libraries(mytarget PRIVATE Qt6::SerialBus)
-
qmake: QT += serialbus
This class is under development and is subject to change.
I. Detailed Description▲
A unique identifier is used to distinguish different CAN bus frames and apply proper QCanMessageDescriptions to encode or decode them. Different CAN protocols can use different parts of the CAN frame as a unique identifier (e.g. the DBC protocol uses the whole FrameId as a unique identifier).
This class contains parameters to specify the unique identifier position within a CAN frame in a flexible way:
-
The part of the frame which will be used to extract the unique identifier (FrameId or payload).
-
The start bit of the unique identifier, relative to the selected part of the frame. The bits are counted starting from the LSB.
-
The number of bits used to represent the unique identifier.
-
The endian used to extract the value.
Check the Data Endianness Processing section of the QCanSignalDescription documentation to see how the start bit value depends on the data endianness. The approach that is described there is also used for unique id description.
The actual value of a unique identifier is represented by the QtCanBus::UniqueId type.
I-1. See Also▲
See also QCanMessageDescription
II. Member Function Documentation▲
II-1. QCanUniqueIdDescription::QCanUniqueIdDescription()▲
Creates an empty unique identifier description.
II-2. QCanUniqueIdDescription::QCanUniqueIdDescription(const QCanUniqueIdDescription &other)▲
Creates a unique identifier description with the values copied from other.
II-3. QCanUniqueIdDescription::QCanUniqueIdDescription(QCanUniqueIdDescription &&other)▲
Creates a unique identifier description by moving from other.
The moved-from QCanUniqueIdDescription object can only be destroyed or assigned to. The effect of calling other functions than the destructor or one of the assignment operators is undefined.
II-4. QCanUniqueIdDescription::~QCanUniqueIdDescription()▲
Destroys this unique identifier description.
II-5. quint8 QCanUniqueIdDescription::bitLength() const▲
Returns the bit length of the unique identifier.
II-5-1. See Also▲
See also setBitLength(), startBit(), setStartBit()
II-6. QSysInfo::Endian QCanUniqueIdDescription::endian() const▲
Returns the data endian of the unique identifier.
By default, LittleEndian is used.
II-6-1. See Also▲
See also setEndian(), QSysInfo::Endian
II-7. bool QCanUniqueIdDescription::isValid() const▲
Returns true when this unique identifier description is valid and false otherwise.
A valid unique identifier description must have a bitLength() which is greater than zero and does not exceed the number of bits of the QtCanBus::UniqueId type.
II-7-1. See Also▲
See also bitLength()
II-8. void QCanUniqueIdDescription::setBitLength(quint8 length)▲
Sets the bit length of the unique identifier to length.
II-8-1. See Also▲
See also bitLength(), startBit(), setStartBit()
II-9. void QCanUniqueIdDescription::setEndian(QSysInfo::Endian endian)▲
Sets the data endian of the unique identifier to endian.
II-9-1. See Also▲
See also endian(), QSysInfo::Endian
II-10. void QCanUniqueIdDescription::setSource(QtCanBus::DataSource source)▲
Sets the data source of the unique identifier to source.
II-10-1. See Also▲
See also source(), QtCanBus::DataSource
II-11. void QCanUniqueIdDescription::setStartBit(quint16 bit)▲
Sets the start bit of the unique identifier in the source() to bit.
II-11-1. See Also▲
See also startBit(), bitLength(), setBitLength()
II-12. QtCanBus::DataSource QCanUniqueIdDescription::source() const▲
Returns the data source of the unique identifier.
By default, FrameId is used.
II-12-1. See Also▲
See also setSource(), QtCanBus::DataSource
II-13. quint16 QCanUniqueIdDescription::startBit() const▲
Returns the start bit of the unique identifier in the source().
II-13-1. See Also▲
See also setStartBit(), bitLength(), setBitLength()
II-14. QCanUniqueIdDescription &QCanUniqueIdDescription::operator=(const QCanUniqueIdDescription &other)▲
Assigns the values from other to this unique identifier description.
II-15. QCanUniqueIdDescription &QCanUniqueIdDescription::operator=(QCanUniqueIdDescription &&other)▲
Move-assigns the values from other to this unique identifier description.
The moved-from QCanUniqueIdDescription object can only be destroyed or assigned to. The effect of calling other functions than the destructor or one of the assignment operators is undefined.