QKnxNetIpKnxAddressesDibProxy Class

The QKnxNetIpKnxAddressesDibProxy class provides the means to read all assigned individual addresses of a KNXnet/IP device from the generic QKnxNetIpDib class and to create a KNXnet/IP addresses device information block (DIB) structure. More...

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

Public Types

class Builder

Public Functions

QKnxNetIpKnxAddressesDibProxy(const QKnxNetIpDib &dib)
QKnxNetIp::DescriptionType descriptionType() const
QVector<QKnxAddress> individualAddresses() const
bool isValid() const

Static Public Members

QKnxNetIpKnxAddressesDibProxy::Builder builder()

Detailed Description

Note: When using QKnxNetIpKnxAddressesDibProxy, 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 assigned addresses can be achieved like this:

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

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

auto addresses = proxy.individualAddresses();

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

Member Function Documentation

QKnxNetIpKnxAddressesDibProxy::QKnxNetIpKnxAddressesDibProxy(const QKnxNetIpDib &dib)

Constructs a proxy object with the specified KNXnet/IP DIB structure dib to read all assigned individual addresses of a KNXnet/IP device.

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

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

QKnxNetIp::DescriptionType QKnxNetIpKnxAddressesDibProxy::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.

QVector<QKnxAddress> QKnxNetIpKnxAddressesDibProxy::individualAddresses() const

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

bool QKnxNetIpKnxAddressesDibProxy::isValid() const

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

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