QKnxNetIpCrdProxy Class

The QKnxNetIpCrdProxy class provides the means to read the KNXnet/IP connection response data (CRD) from the generic QKnxNetIpCrd class and to create a KNXnet/IP CRD structure based on the information. More...

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

Public Types

class Builder

Public Functions

QKnxNetIpCrdProxy(const QKnxNetIpCrd &crd)
QKnxByteArray additionalData() const
QKnxNetIp::ConnectionType connectionType() const
QKnxAddress individualAddress() const
bool isValid() const

Static Public Members

QKnxNetIpCrdProxy::Builder builder()

Detailed Description

A KNXnet/IP CRD structure contains the data block returned with the connect response QKnxNetIpFrame. The content of such a frame can be viewed by using the QKnxNetIpConnectResponseProxy proxy class.

The structure may contain host protocol dependent and independent data, but the current KNX specification foresees additional data only in the case of tunneling.

Note: When using QKnxNetIpCrdProxy, care must be taken to ensure that the referenced KNXnet/IP CRD structure outlives the proxy on all code paths, lest the proxy ends up referencing deleted data.

Reading the connection type and assigned individual address can be achieved like this:

auto crd = QKnxNetIpCrd::fromBytes(...);

QKnxNetIpCrdProxy proxy(crd);
if (!proxy.isValid())
    return;

if (proxy.connectionType() != QKnxNetIp::ConnectionType::Tunnel)
    return;
auto address = proxy.individualAddress(); // read the individual address

See also builder() and Qt KNXnet/IP Connection Classes.

Member Function Documentation

QKnxNetIpCrdProxy::QKnxNetIpCrdProxy(const QKnxNetIpCrd &crd)

Constructs a proxy object with the specified a KNXnet/IP structure crd to read the connection response data block (CRD).

QKnxByteArray QKnxNetIpCrdProxy::additionalData() const

Returns the additional data of this KNXnet/IP structure.

The current KNX specification foresees additional data only in the case of tunneling.

See also individualAddress().

[static] QKnxNetIpCrdProxy::Builder QKnxNetIpCrdProxy::builder()

Returns a builder object to create a KNXnet/IP connection response data block structure.

QKnxNetIp::ConnectionType QKnxNetIpCrdProxy::connectionType() const

Returns the connection type of this KNXnet/IP structure if the object that was passed during construction was valid; otherwise returns QKnx::NetIp::Unknown.

QKnxAddress QKnxNetIpCrdProxy::individualAddress() const

Returns the individual address of this KNXnet/IP structure if the object that was passed during construction was valid and the connection type is QKnx::NetIp::Tunnel; otherwise returns QKnx::NetIp::Unknown.

See also additionalData().

bool QKnxNetIpCrdProxy::isValid() const

Returns true if the KNXnet/IP structure to create the object is a valid KNXnet/IP CRD structure; otherwise returns false.

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