QKnxNetIpFrameHeader Class

The QKnxNetIpFrameHeader class is a KNXnet/IP frame header. More...

Header: #include <QKnxNetIpFrameHeader>
qmake: QT += knx

Public Functions

QKnxNetIpFrameHeader(QKnxNetIp::ServiceType type, quint16 dataSize)
QKnxNetIpFrameHeader(QKnxNetIp::ServiceType type)
QKnxNetIpFrameHeader()
~QKnxNetIpFrameHeader()
quint8 byte(quint8 index) const
QKnxByteArray bytes() const
quint16 dataSize() const
bool isNull() const
bool isValid() const
quint8 protocolVersion() const
QKnxNetIp::ServiceType serviceType() const
void setDataSize(quint16 dataSize)
void setProtocolVersion(quint8 version)
void setServiceType(QKnxNetIp::ServiceType type)
quint8 setSize(quint8 size)
quint8 size() const
quint16 totalSize() const
bool operator!=(const QKnxNetIpFrameHeader &other) const
bool operator==(const QKnxNetIpFrameHeader &other) const

Static Public Members

QKnxNetIpFrameHeader fromBytes(const QKnxByteArray &bytes, quint16 index = 0)
QDebug operator<<(QDebug debug, const QKnxNetIpFrameHeader &header)

Detailed Description

The QKnxNetIpFrameHeader class contains the data and meta data related to a KNXnet/IP frame. Every KNXnet/IP frame consists of at least the common KNXnet/IP header. The common KNXnet/IP header contains information about the protocol version, the header and total packet size, and a KNXnet/IP service type identifier.

See also Qt KNXnet/IP Connection Classes.

Member Function Documentation

QKnxNetIpFrameHeader::QKnxNetIpFrameHeader(QKnxNetIp::ServiceType type, quint16 dataSize)

Constructs a valid frame header object. Sets the KNXnet/IP service type identifier to type and the data size to dataSize and updates the total size accordingly.

Note: By default a KNXnet/IP Version 1.0 frame header is constructed.

See also isValid(), serviceType(), setServiceType(), dataSize(), and setDataSize().

QKnxNetIpFrameHeader::QKnxNetIpFrameHeader(QKnxNetIp::ServiceType type)

Constructs a valid frame header object and sets the KNXnet/IP service type identifier to type.

Note: By default a KNXnet/IP Version 1.0 frame header is constructed.

See also isValid(), serviceType(), and setServiceType().

QKnxNetIpFrameHeader::QKnxNetIpFrameHeader()

Constructs an empty invalid frame header object.

See also isNull() and isValid().

QKnxNetIpFrameHeader::~QKnxNetIpFrameHeader()

Destroys the frame header object and releases all allocated resources.

quint8 QKnxNetIpFrameHeader::byte(quint8 index) const

Returns the byte at position index in the header.

QKnxByteArray QKnxNetIpFrameHeader::bytes() const

Returns an array of bytes that represent the KNXnet/IP frame header.

quint16 QKnxNetIpFrameHeader::dataSize() const

Returns the size of the KNXnet/IP frame's data if the header is valid, otherwise returns null. The data size excludes the size of the KNXnet/IP frame's header.

See also setDataSize(), isNull(), isValid(), size(), and totalSize().

[static] QKnxNetIpFrameHeader QKnxNetIpFrameHeader::fromBytes(const QKnxByteArray &bytes, quint16 index = 0)

Constructs the KNXnet/IP frame header from the byte array bytes starting at position index inside the array.

See also isNull() and isValid().

bool QKnxNetIpFrameHeader::isNull() const

Returns true if this is a default constructed header, otherwise returns false. A header is considered null if it contains no initialized values.

bool QKnxNetIpFrameHeader::isValid() const

Returns true if the frame header contains initialized values and is in itself valid, otherwise returns false. A valid KNXnet/IP frame header consist of a header size, protocol version, a known serviceType identifier, and a minimum total size.

See also isNull().

quint8 QKnxNetIpFrameHeader::protocolVersion() const

Returns the protocol version of the KNXnet/IP frame.

See also setProtocolVersion(), isNull(), and isValid().

QKnxNetIp::ServiceType QKnxNetIpFrameHeader::serviceType() const

Returns the service type identifier of the KNXnet/IP frame.

See also setServiceType().

void QKnxNetIpFrameHeader::setDataSize(quint16 dataSize)

Sets the KNXnet/IP frame's data size to dataSize and updates the total size accordingly.

See also dataSize().

void QKnxNetIpFrameHeader::setProtocolVersion(quint8 version)

Sets the protocol version of the KNXnet/IP frame header to version.

See also protocolVersion().

void QKnxNetIpFrameHeader::setServiceType(QKnxNetIp::ServiceType type)

Sets the service type identifier of the KNXnet/IP frame to type.

See also serviceType().

quint8 QKnxNetIpFrameHeader::setSize(quint8 size)

Sets the size of the KNXnet/IP frame header to size.

See also size().

quint8 QKnxNetIpFrameHeader::size() const

Returns the size of the KNXnet/IP frame header.

See also setSize(), isNull(), and isValid().

quint16 QKnxNetIpFrameHeader::totalSize() const

Returns the total size of the KNXnet/IP frame if the header is valid, otherwise returns null. The total size includes the size of the header and the size of the KNXnet/IP frame data.

See also isNull(), isValid(), size(), and dataSize().

bool QKnxNetIpFrameHeader::operator!=(const QKnxNetIpFrameHeader &other) const

Returns true if this object and the given other are not equal; otherwise returns false.

bool QKnxNetIpFrameHeader::operator==(const QKnxNetIpFrameHeader &other) const

Returns true if this object and the given other are equal; otherwise returns false.

Related Non-Members

QDebug operator<<(QDebug debug, const QKnxNetIpFrameHeader &header)

Writes the KNXnet/IP frame header header to the debug stream.

© 2023 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.