Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-75502

Clarify the implications of QCanBusFrame::setFrameId() on frame format in documentation

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Done
    • P3: Somewhat important
    • 5.12.5, 5.13.1, 5.14.0 Alpha
    • 5.11, 5.12, 5.13
    • Documentation
    • None
    • All
    • 4fb3e302a30c675b3d515d6eb5dd08301727d4c1 (qt/qtserialbus/5.12)

    Description

      In the description of

      QCanBusFrame::setFrameId()

      is stated, that the CAN extended frame format setting is automatically adapted to match newFrameId.

      Actually, that sentence suggests, that one frame that had an extended id before, but is now adjusted to have a base format id, will automatically get isExtendedFormat removed, which is not the case due to

          void setFrameId(quint32 newFrameId)
          {
              if (Q_LIKELY(newFrameId < 0x20000000U)) {
                  isValidFrameId = true;
                  canId = newFrameId;
                  setExtendedFrameFormat(isExtendedFrame || (newFrameId & 0x1FFFF800U));
              } else {
                  isValidFrameId = false;
                  canId = 0;
              }
          }
      

      I suggest the following change in qcanbusframe.cpp;

      /*!
          \fn QCanBusFrame::setFrameId(quint32 newFrameId)
          Sets the identifier of the CAN frame to \a newFrameId. The maximum size of a CAN frame
          identifier is 11 bits, which can be extended up to 29 bits by supporting the \e {CAN extended frame
          format}. The \e {CAN extended frame format} setting is automatically adapted to match \a newFrameId with more than 11 bits in size. When the format is extended and \a newFrameId with up to 11 bits or less is passed, the  \e {CAN extended frame format} setting is \a not changed. You have to manually adjust the setting back to base format.
          \sa frameId(), hasExtendedFrameFormat()
      */
      

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            paulwicking Paul Wicking
            darkmattercoder Jochen Bauer
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes