The QCanMessageDescription class describes the rules to process a CAN message and represent it in an application-defined format. More...
| Header: | #include <QCanMessageDescription> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS SerialBus)target_link_libraries(mytarget PRIVATE Qt6::SerialBus) |
| qmake: | QT += serialbus |
| Since: | Qt 6.5 |
| Status: | Preliminary |
This class is under development and is subject to change.
| QCanMessageDescription() | |
| QCanMessageDescription(const QCanMessageDescription &other) | |
| QCanMessageDescription(QCanMessageDescription &&other) | |
| ~QCanMessageDescription() | |
| void | addSignalDescription(const QCanSignalDescription &description) |
| void | clearSignalDescriptions() |
| QString | comment() const |
| bool | isValid() const |
| QString | name() const |
| void | setComment(const QString &text) |
| void | setName(const QString &name) |
| void | setSignalDescriptions(const QList<QCanSignalDescription> &descriptions) |
| void | setSize(quint8 size) |
| void | setTransmitter(const QString &transmitter) |
| void | setUniqueId(QtCanBus::UniqueId id) |
| QCanSignalDescription | signalDescriptionForName(const QString &name) const |
| QList<QCanSignalDescription> | signalDescriptions() const |
| quint8 | size() const |
| QString | transmitter() const |
| QtCanBus::UniqueId | uniqueId() const |
| QCanMessageDescription & | operator=(QCanMessageDescription &&other) |
| QCanMessageDescription & | operator=(const QCanMessageDescription &other) |
A CAN message is basically a QCanBusFrame. The description of a CAN message includes the following:
The QCanMessageDescription class provides methods to control all those parameters.
The message ID is a unique identifier, which is used to select the proper message description when decoding the incoming QCanBusFrame or encoding a QCanBusFrame based on the provided data.
See QCanUniqueIdDescription documentation for more details on the unique identifier description.
The signal description is represented by the QCanSignalDescription class. The QCanMessageDescription class only provides a list of signals that belong to the message.
See also QCanSignalDescription and QCanUniqueIdDescription.
Creates an empty message description.
Creates a message description with the values copied from other.
[noexcept] QCanMessageDescription::QCanMessageDescription(QCanMessageDescription &&other)Creates a message description by moving from other.
Note: The moved-from QCanMessageDescription 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.
[noexcept] QCanMessageDescription::~QCanMessageDescription()Destroys this message description.
Adds a new signal description description to this message description.
If the message description already has a signal description for a signal with the same name, it is overwritten.
See also signalDescriptions(), signalDescriptionForName(), setSignalDescriptions(), and clearSignalDescriptions().
Clears all the signal descriptions of this message.
See also signalDescriptions(), signalDescriptionForName(), addSignalDescription(), and setSignalDescriptions().
Returns the comment for the message.
This parameter is introduced only for extra description. It's not used during message encoding or decoding.
See also setComment().
Returns true when the message description is valid and false otherwise.
A valid message description must have at least one signal description. All signal descriptions must be valid as well.
See also signalDescriptions() and QCanSignalDescription::isValid().
Returns the name of the CAN message.
This parameter is introduced only for extra description. It's not used during message encoding or decoding.
See also setName().
Sets the comment for the message to text.
This parameter is introduced only for extra description. It's not used during message encoding or decoding.
See also comment().
Sets the name of the CAN message to name.
This parameter is introduced only for extra description. It's not used during message encoding or decoding.
See also name().
Sets the descriptions of the signals belonging to this message description to descriptions.
Note: Message description must have signal descriptions with unique signal names, so if the descriptions list contains entries with duplicated names, only the last entry will be added.
See also signalDescriptions(), signalDescriptionForName(), addSignalDescription(), and clearSignalDescriptions().
Sets the size in bytes of the CAN message to size.
See also size().
Sets the transmitter node of the message to transmitter.
This parameter is introduced only for extra description. It's not used during message encoding or decoding.
See also transmitter().
Sets the unique identifier of the CAN message to id.
See the Message ID section for more information about the unique identifier.
See also uniqueId().
Returns the signal description of a signal with the name name.
If the message description does not have such signal description, a default-constructed QCanSignalDescription object is returned.
See also signalDescriptions(), addSignalDescription(), setSignalDescriptions(), and clearSignalDescriptions().
Returns the list of signal descriptions that belong to this message description.
See also signalDescriptionForName(), addSignalDescription(), setSignalDescriptions(), and clearSignalDescriptions().
Returns the size in bytes of the CAN message.
See also setSize().
Returns the transmitter node of the message.
This parameter is introduced only for extra description. It's not used during message encoding or decoding.
See also setTransmitter().
Returns the unique identifier of the CAN message.
See the Message ID section for more information about the unique identifier.
See also setUniqueId().
[noexcept] QCanMessageDescription
&QCanMessageDescription::operator=(QCanMessageDescription &&other)Move-assigns the values from other to this message description.
Note: The moved-from QCanMessageDescription 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.
Assigns the values from other to this message description.