QKnxNetIpDescriptionResponseProxy Class

The QKnxNetIpDescriptionResponseProxy class provides the means to read a description response from the generic QKnxNetIpFrame class and to create a KNXnet/IP frame based on the information. More...

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

Public Types

class Builder

Public Functions

QKnxNetIpDescriptionResponseProxy(const QKnxNetIpFrame &frame)
QKnxNetIpDib deviceHardware() const
bool isValid() const
QVector<QKnxNetIpDib> optionalDibs() const
QKnxNetIpDib supportedFamilies() const

Static Public Members

QKnxNetIpDescriptionResponseProxy::Builder builder()

Detailed Description

When a KNXnet/IP server receives a description request from a KNXnet/IP client, it replies by sending a description response frame that contains information about the supported protocol version range, its own capabilities, state information, and optionally a friendly name for this server's KNX connection.

In most programs, this class will not be used directly. Instead, the QKnxNetIpServerDescriptionAgent and QKnxNetIpServerInfo are provided to check that the server supports the requested connection type and options.

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

The following code sample illustrates how to read the description response information sent by a KNXnet/IP server:

auto netIpFrame = QKnxNetIpFrame::fromBytes(...);

const QKnxNetIpDescriptionResponseProxy proxy(netIpFrame);
if (!proxy.isValid())
    return;

auto hardware = proxy.deviceHardware();
auto families = proxy.supportedFamilies();

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

Member Function Documentation

QKnxNetIpDescriptionResponseProxy::QKnxNetIpDescriptionResponseProxy(const QKnxNetIpFrame &frame)

Constructs a proxy object to read the description response information carried by the specified KNXnet/IP frame frame.

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

Returns a builder object to create a KNXnet/IP description response frame.

QKnxNetIpDib QKnxNetIpDescriptionResponseProxy::deviceHardware() const

Returns information about the KNXnet/IP server hardware.

bool QKnxNetIpDescriptionResponseProxy::isValid() const

Returns true if the frame contains initialized values and is in itself valid, otherwise returns false. A valid KNXnet/IP frame consists of at least a valid header and a size in bytes corresponding to the total size of the KNXnet/IP frame header.

Note: If the QKnxNetIpFrame used to create the response proxy contains tunneling information description objects, it is also considered invalid.

See also QKnxNetIpFrameHeader::totalSize().

QVector<QKnxNetIpDib> QKnxNetIpDescriptionResponseProxy::optionalDibs() const

Returns a vector of optional KNXnet/IP server device information block (DIB) structures. The vector can be empty if no such structures are present or in case of an error while extracting the optional DIBs.

Note: The function does not perform validity checks on the QKnxNetIpFrame used to create the description response proxy object.

QKnxNetIpDib QKnxNetIpDescriptionResponseProxy::supportedFamilies() const

Returns information about the service families that the KNXnet/IP server supports.

Note: The returned service families must be allowed in a description response. A service family higher than or equal to the security family is not allowed in this case.

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