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. 更多...

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

该类在 Qt 5.12 引入。

公共类型

class Builder

公共函数

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

静态公共成员

QKnxNetIpTunnelingFeatureResponseProxy::Builder builder ()

详细描述

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.

注意: 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();
					

另请参阅 builder (), QKnxNetIpTunnelingFeatureGetProxy , QKnxNetIpTunnelingFeatureSetProxy , Qt KNX Tunneling Classes ,和 Qt KNXnet/IP Connection Classes .

成员函数文档编制

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

返回 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.

另请参阅 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.