CanUtils
Source locationmrx/can/CanUtils.hpp
Helpers for constructing extended CAN data frames.
Public Static Methods
Section titled “Public Static Methods”| Return | Name | Description |
|---|---|---|
quint32 | extendedFrameId static | Returns the lower 29 identifier bits, removing all higher bits. |
QByteArray | zeroPayload static | Returns a payload of the requested length filled with zero bytes; negative lengths produce an empty payload. |
QCanBusFrame | createExtendedFrame static | Constructs an extended data frame with the lower 29 ID bits and the given payload. |
QCanBusFrame | createExtendedFrameFromStruct static inline | Copies the complete object representation into an extended data frame. |
static
extendedFrameId
Section titled “extendedFrameId”Source locationmrx/can/CanUtils.hpp
Returns the lower 29 identifier bits, removing all higher bits.
static
zeroPayload
Section titled “zeroPayload”Source locationmrx/can/CanUtils.hpp
Returns a payload of the requested length filled with zero bytes; negative lengths produce an empty payload.
static
createExtendedFrame
Section titled “createExtendedFrame”Source locationmrx/can/CanUtils.hpp
Constructs an extended data frame with the lower 29 ID bits and the given payload.
The payload is preserved without padding or truncation. Qt determines CAN FD format from the payload length; callers can inspect QCanBusFrame::isValid().
static inline
createExtendedFrameFromStruct
Section titled “createExtendedFrameFromStruct”Source locationmrx/can/CanUtils.hpp
Copies the complete object representation into an extended data frame.
T must be trivially copyable. This is a byte copy, not serialization: the caller is responsible for padding, initialization, byte order and protocol compatibility. The payload length is exactly sizeof(T).