QKnxNetIpTunnelingInfoDibProxy Class

The QKnxNetIpTunnelingInfoDibProxy class provides the means to read the maximum ADPU length supported by a KNXnet/IP tunneling interface and tunneling slot information from the generic QKnxNetIpDib class and to create a KNXnet/IP tunneling information block (DIB) structure. More...

Header: #include <QKnxNetIpTunnelingInfoDibProxy>
qmake: QT += knx
Since: Qt 5.12

Public Types

class Builder

Public Functions

QKnxNetIpTunnelingInfoDibProxy(const QKnxNetIpDib &dib)
QKnxNetIp::DescriptionType descriptionType() const
bool isValid() const
quint16 maximumInterfaceApduLength() const
QVector<QKnxNetIpTunnelingSlotInfo> optionalSlotInfos() const
QKnxNetIpTunnelingSlotInfo tunnelingSlotInfo() const

Static Public Members

QKnxNetIpTunnelingInfoDibProxy::Builder builder()

Detailed Description

The QKnxNetIpTunnelingInfoDibProxy class provides the means to read the maximum ADPU length supported by a KNXnet/IP tunneling interface and tunneling slot information from the generic QKnxNetIpDib class and to create a KNXnet/IP tunneling information block (DIB) structure.

If a KNXnet/IP server supports tunneling, it can send more detailed information about the supported tunnel connections. The tunneling slot info class can be used to represent this information. Usually it includes the individual addresses used for the connection once it has been established and whether the connection slot is available at all.

In most programs, this class will not be used directly. Instead, the QKnxNetIpServerDiscoveryAgent and QKnxNetIpServerInfo are provided.

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

Reading the application layer protocol data unit (APDU) length and default tunneling slot information can be achieved like this:

auto dib = QKnxNetIpDib::fromBytes(...);

QKnxNetIpTunnelingInfoDibProxy proxy(dib);
if (!proxy.isValid())
    return;

quint16 apduLength = proxy.maximumInterfaceApduLength();
auto tunnelingSlotInfo = proxy.tunnelingSlotInfo(); // mandatory

See also builder(), QKnxNetIpTunnelingSlotInfo, Qt KNX Tunneling Classes, and Qt KNXnet/IP Connection Classes.

Member Function Documentation

QKnxNetIpTunnelingInfoDibProxy::QKnxNetIpTunnelingInfoDibProxy(const QKnxNetIpDib &dib)

Constructs a proxy object with the specified KNXnet/IP DIB structure dib to read the maximum APDU length and tunneling slot information.

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

Returns a builder object to create a KNXnet/IP tunneling info DIB structure.

QKnxNetIp::DescriptionType QKnxNetIpTunnelingInfoDibProxy::descriptionType() const

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

bool QKnxNetIpTunnelingInfoDibProxy::isValid() const

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

A KNXnet/IP tunneling information DIB structure is considered valid if it contains the maximum APDU length and at least one tunneling slot information object.

quint16 QKnxNetIpTunnelingInfoDibProxy::maximumInterfaceApduLength() const

Returns the maximum APDU length carried by this KNXnet/IP DIB structure.

Note: If the object passed during construction was invalid, the function returns a default-constructed value which can be 0.

See also isValid().

QVector<QKnxNetIpTunnelingSlotInfo> QKnxNetIpTunnelingInfoDibProxy::optionalSlotInfos() const

Returns a vector of QKnxNetIpTunnelingSlotInfo objects carried by this KNXnet/IP DIB structure if the object that was passed during construction was valid; otherwise returns an empty vector.

QKnxNetIpTunnelingSlotInfo QKnxNetIpTunnelingInfoDibProxy::tunnelingSlotInfo() const

Returns the mandatory tunneling slot information carried by this KNXnet/IP DIB structure or a default-constructed value in case of an error.

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