QKnxNetIpDeviceDibProxy Class

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

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

Public Types

class Builder

Public Functions

QKnxNetIpDeviceDibProxy(const QKnxNetIpDib &dib)
QKnxNetIp::DescriptionType descriptionType() const
QByteArray deviceName() const
QKnxNetIp::ProgrammingMode deviceStatus() const
QKnxAddress individualAddress() const
bool isValid() const
QKnxByteArray macAddress() const
QKnx::MediumType mediumType() const
QHostAddress multicastAddress() const
quint16 projectInstallationId() const
QKnxByteArray serialNumber() const

Static Public Members

QKnxNetIpDeviceDibProxy::Builder builder()

Detailed Description

Note: When using QKnxNetIpDeviceDibProxy, 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 device information can be achieved like this:

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

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

auto mediumType = proxy.mediumType();
auto programmingMode = proxy.deviceStatus();
...
auto deviceName = proxy.deviceName();

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

Member Function Documentation

QKnxNetIpDeviceDibProxy::QKnxNetIpDeviceDibProxy(const QKnxNetIpDib &dib)

Constructs a proxy object with the specified KNXnet/IP DIB structure dib to read the device information of a KNXnet/IP device.

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

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

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

QByteArray QKnxNetIpDeviceDibProxy::deviceName() const

Returns the device name contained inside the KNXnet/IP DIB structure if the object that was passed during construction was valid; otherwise returns an empty byte array.

QKnxNetIp::ProgrammingMode QKnxNetIpDeviceDibProxy::deviceStatus() const

Returns the device status contained inside the KNXnet/IP DIB structure.

See also QKnx::NetIp::ProgrammingMode.

QKnxAddress QKnxNetIpDeviceDibProxy::individualAddress() const

Returns the individual address contained inside the KNXnet/IP DIB structure if the object that was passed during construction was valid; otherwise returns a default constructed QKnxAddress.

bool QKnxNetIpDeviceDibProxy::isValid() const

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

QKnxByteArray QKnxNetIpDeviceDibProxy::macAddress() const

Returns the MAC address contained inside the KNXnet/IP DIB structure if the object that was passed during construction was valid; otherwise returns an empty byte array.

QKnx::MediumType QKnxNetIpDeviceDibProxy::mediumType() const

Returns the medium type contained inside the KNXnet/IP DIB structure if the object that was passed during construction was valid; otherwise returns QKnx::Unknown.

QHostAddress QKnxNetIpDeviceDibProxy::multicastAddress() const

Returns the multicast address contained inside the KNXnet/IP DIB structure if the object that was passed during construction was valid; otherwise returns a default constructed QHostAddress.

quint16 QKnxNetIpDeviceDibProxy::projectInstallationId() const

Returns the KNX project installation ID contained inside the KNXnet/IP DIB structure.

QKnxByteArray QKnxNetIpDeviceDibProxy::serialNumber() const

Returns the device serial number contained inside the KNXnet/IP DIB structure if the object that was passed during construction was valid; otherwise returns an empty byte array.

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