QCanBusFrame Class

QCanBusFrame is a container class representing a single CAN frame. More...

Header: #include <QCanBusFrame>
qmake: QT += serialbus
Since: Qt 5.8

This class was introduced in Qt 5.8.

Public Types

class TimeStamp
enum FrameError { NoError, TransmissionTimeoutError, LostArbitrationError, ControllerError, ProtocolViolationError, …, AnyError }
enum FrameType { UnknownFrame, DataFrame, ErrorFrame, RemoteRequestFrame, InvalidFrame }

Detailed Description

QCanBusDevice can use QCanBusFrame for read and write operations. It contains the frame identifier and the data payload. QCanBusFrame contains the timestamp of the moment it was read.

See also QCanBusFrame::TimeStamp.

Member Type Documentation

enum QCanBusFrame::FrameError

This enum describes the possible error types.

ConstantValueDescription
QCanBusFrame::NoError0No error has occurred.
QCanBusFrame::TransmissionTimeoutError(1 << 0)The transmission has timed out.
QCanBusFrame::LostArbitrationError(1 << 1)The frame could not be sent due to lost arbitration on the bus.
QCanBusFrame::ControllerError(1 << 2)The controller encountered an error.
QCanBusFrame::ProtocolViolationError(1 << 3)A protocol violation has occurred.
QCanBusFrame::TransceiverError(1 << 4)A transceiver error occurred
QCanBusFrame::MissingAcknowledgmentError(1 << 5)The transmission received no acknowledgment.
QCanBusFrame::BusOffError(1 << 6)The CAN bus is offline.
QCanBusFrame::BusError(1 << 7)A CAN bus error occurred.
QCanBusFrame::ControllerRestartError(1 << 8)The controller restarted.
QCanBusFrame::UnknownError(1 << 9)An unknown error has occurred.
QCanBusFrame::AnyError0x1FFFFFFFUMatches every other error type.

enum QCanBusFrame::FrameType

This enum describes the type of the CAN frame.

ConstantValueDescription
QCanBusFrame::UnknownFrame0x0The frame type is unknown.
QCanBusFrame::DataFrame0x1This value represents a data frame.
QCanBusFrame::ErrorFrame0x2This value represents an error frame.
QCanBusFrame::RemoteRequestFrame0x3This value represents a remote request.
QCanBusFrame::InvalidFrame0x4This value represents an invalid frame. This type is used for error reporting.

See also setFrameType().