QKnxNetIpStruct Class

The QKnxNetIpStruct class represents a generic data structure encapsulated in a KNXnet/IP frame. More...

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

Public Functions

QKnxNetIpStruct()
QKnxNetIpStruct(CodeType code, const QKnxByteArray &data = ...)
QKnxNetIpStruct(const QKnxNetIpStructHeader<CodeType> &header, const QKnxByteArray &data = ...)
~QKnxNetIpStruct()
QKnxByteArray bytes() const
CodeType code() const
const QKnxByteArray &constData() const
QKnxByteArray data() const
quint16 dataSize() const
QKnxNetIpStructHeader<CodeType> header() const
bool isNull() const
bool isValid() const
void setData(const QKnxByteArray &data)
void setHeader(const QKnxNetIpStructHeader<CodeType> &header)
quint16 size() const
bool operator!=(const QKnxNetIpStruct<CodeType> &other) const
bool operator==(const QKnxNetIpStruct<CodeType> &other) const

Static Public Members

QKnxNetIpStruct<CodeType> fromBytes(const QKnxByteArray &bytes, quint16 index = 0)
QDebug operator<<(QDebug debug, const QKnxNetIpStruct<QKnxNetIp::HostProtocol> &hpai)
QDebug operator<<(QDebug debug, const QKnxNetIpStruct<QKnxNetIp::ConnectionType> &cr)
QDebug operator<<(QDebug debug, const QKnxNetIpStruct<QKnxNetIp::DescriptionType> &dib)
QDebug operator<<(QDebug debug, const QKnxNetIpStruct<QKnxNetIp::SearchParameterType> &srp)

Detailed Description

The QKnxNetIpStruct class represents a generic data structure encapsulated in a KNXnet/IP frame.

The following types of KNXnet/IP structures can be encapsulated in QKnxNetIpFrame: QKnxNetIpHpai for host protocol address information (HPAI), QKnxNetIpCri for connection request information (CRI), QKnxNetIpCrd for connection response data (CRD) and QKnxNetIpDib for a description information block (DIB).

See also Qt KNXnet/IP Connection Classes.

Member Function Documentation

QKnxNetIpStruct::QKnxNetIpStruct()

Creates an empty invalid KNXnet/IP structure.

QKnxNetIpStruct::QKnxNetIpStruct(CodeType code, const QKnxByteArray &data = ...)

Creates a new KNXnet/IP structure with the specified code and payload data.

QKnxNetIpStruct::QKnxNetIpStruct(const QKnxNetIpStructHeader<CodeType> &header, const QKnxByteArray &data = ...)

Creates a new KNXnet/IP structure with the specified header and payload data.

The header is expected to be fully set up and all values describing the payload are expected to match the specified payload.

Note: No adjustments are made to the function arguments.

QKnxNetIpStruct::~QKnxNetIpStruct()

Destroys the instance of QKnxNetIpStruct.

QKnxByteArray QKnxNetIpStruct::bytes() const

Returns an array of bytes representing the KNXnet/IP structure including the header and the payload.

CodeType QKnxNetIpStruct::code() const

Returns the generic code stored in the KNXnet/IP structure.

const QKnxByteArray &QKnxNetIpStruct::constData() const

Returns the data stored in the KNXnet/IP structure.

QKnxByteArray QKnxNetIpStruct::data() const

Returns the data stored in the KNXnet/IP structure.

See also setData().

quint16 QKnxNetIpStruct::dataSize() const

Returns the size of the data stored in the KNXnet/IP structure.

[static] QKnxNetIpStruct<CodeType> QKnxNetIpStruct::fromBytes(const QKnxByteArray &bytes, quint16 index = 0)

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

See also isNull() and isValid().

Returns the header stored in the KNXnet/IP structure.

See also setHeader().

bool QKnxNetIpStruct::isNull() const

Returns true if this is a default constructed structure; otherwise returns false.

bool QKnxNetIpStruct::isValid() const

Returns true if the structure contains initialized values and is in itself valid; otherwise returns false.

See also isNull().

void QKnxNetIpStruct::setData(const QKnxByteArray &data)

Sets the data stored in the KNXnet/IP structure to data and updates the data size accordingly.

See also data().

void QKnxNetIpStruct::setHeader(const QKnxNetIpStructHeader<CodeType> &header)

Sets the header stored in the KNXnet/IP structure to header.

See also header().

quint16 QKnxNetIpStruct::size() const

Returns the size of the KNXnet/IP structure.

bool QKnxNetIpStruct::operator!=(const QKnxNetIpStruct<CodeType> &other) const

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

bool QKnxNetIpStruct::operator==(const QKnxNetIpStruct<CodeType> &other) const

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

Related Non-Members

QDebug operator<<(QDebug debug, const QKnxNetIpStruct<QKnxNetIp::HostProtocol> &hpai)

Writes the KNXnet/IP host protocol address information structure hpai to the debug stream.

QDebug operator<<(QDebug debug, const QKnxNetIpStruct<QKnxNetIp::ConnectionType> &cr)

Writes the KNXnet/IP connection request information structure cr to the debug stream.

QDebug operator<<(QDebug debug, const QKnxNetIpStruct<QKnxNetIp::DescriptionType> &dib)

Writes the KNXnet/IP description information block structure dib to the debug stream.

QDebug operator<<(QDebug debug, const QKnxNetIpStruct<QKnxNetIp::SearchParameterType> &srp)

Writes the KNXnet/IP extended search parameter request srp to the debug stream.

This function was introduced in Qt 5.12.

© 2018 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.