QKnxNetIpTunnelingFeatureResponseProxy Class

The QKnxNetIpTunnelingFeatureResponseProxy class provides the means to access the information carried by a generic tunneling feature-response service QKnxNetIpFrame frame and to create a KNXnet/IP frame based on the information. More...

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

This class was introduced in Qt 5.12.

Public Types

class Builder

Public Functions

QKnxNetIpTunnelingFeatureResponseProxy(const QKnxNetIpFrame &frame)
quint8 channelId() const
QKnx::InterfaceFeature featureIdentifier() const
QKnxByteArray featureValue() const
bool isValid() const
QKnx::ReturnCode returnCode() const
quint8 sequenceNumber() const

Static Public Members

QKnxNetIpTunnelingFeatureResponseProxy::Builder builder()

Detailed Description

A tunneling feature-response service frame is sent by a KNXnet/IP server after receiving a tunneling feature-get or feature-set service frame. A tunneling feature-response service frame contains the ID of the communication channel between a KNXnet/IP client and server, the sequence number of the frame, the interface feature identifier service used, the return code in case of feature-set service, and the feature value as a byte array.

Note: When using QKnxNetIpTunnelingFeatureResponseProxy, 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 tunneling feature-response information sent by a KNXnet/IP server:

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

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

 auto id = proxy.featureIdentifier();
 auto returnCode = proxy.returnCode();
 auto value = proxy.featureValue();

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

Member Function Documentation

QKnxNetIpTunnelingFeatureResponseProxy::QKnxNetIpTunnelingFeatureResponseProxy(const QKnxNetIpFrame &frame)

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

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

Returns a builder object to create a KNXnet/IP tunneling feature-response service frame.

quint8 QKnxNetIpTunnelingFeatureResponseProxy::channelId() const

Returns the ID of the communication channel between a KNXnet/IP client and server.

QKnx::InterfaceFeature QKnxNetIpTunnelingFeatureResponseProxy::featureIdentifier() const

Returns the tunneling interface feature identifier of a tunneling feature-response service frame.

QKnxByteArray QKnxNetIpTunnelingFeatureResponseProxy::featureValue() const

Returns the tunneling interface feature value of a tunneling feature-response service frame.

bool QKnxNetIpTunnelingFeatureResponseProxy::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.

See also QKnxNetIpFrameHeader::totalSize().

QKnx::ReturnCode QKnxNetIpTunnelingFeatureResponseProxy::returnCode() const

Returns the tunneling interface feature return code of a tunneling feature-response service frame. If the return code is not present, the function always returns QKnx::Error.

quint8 QKnxNetIpTunnelingFeatureResponseProxy::sequenceNumber() const

Returns the sequence number of a tunneling feature-response service frame.