QKnxNetIpCrdProxy Class

The QKnxNetIpCrdProxy class provides the means to read the KNXnet/IP connection response data (CRD) from the generic QKnxNetIpCrd class and to create a KNXnet/IP CRD structure based on the information. 更多...

头: #include <QKnxNetIpCrdProxy>
qmake: QT += knx

公共类型

class Builder

公共函数

QKnxNetIpCrdProxy (const QKnxNetIpCrd & crd )
QKnxByteArray additionalData () const
QKnxNetIp::ConnectionType connectionType () const
QKnxAddress individualAddress () const
bool isValid () const

静态公共成员

QKnxNetIpCrdProxy::Builder builder ()

详细描述

A KNXnet/IP CRD structure contains the data block returned with the connect response QKnxNetIpFrame . The content of such a frame can be viewed by using the QKnxNetIpConnectResponseProxy proxy class.

The structure may contain host protocol dependent and independent data, but the current KNX specification foresees additional data only in the case of tunneling.

注意: When using QKnxNetIpCrdProxy, care must be taken to ensure that the referenced KNXnet/IP CRD structure outlives the proxy on all code paths, lest the proxy ends up referencing deleted data.

Reading the connection type and assigned individual address can be achieved like this:

auto crd = QKnxNetIpCrd::fromBytes(...);
QKnxNetIpCrdProxy proxy(crd);
if (!proxy.isValid())
    return;
if (proxy.connectionType() != QKnxNetIp::ConnectionType::Tunnel)
    return;
auto address = proxy.individualAddress(); // read the individual address
					

另请参阅 builder () 和 Qt KNXnet/IP Connection Classes .

成员函数文档编制

QKnxNetIpCrdProxy:: QKnxNetIpCrdProxy (const QKnxNetIpCrd & crd )

Constructs a proxy object with the specified a KNXnet/IP structure crd to read the connection response data block (CRD).

QKnxByteArray QKnxNetIpCrdProxy:: additionalData () const

Returns the additional data of this KNXnet/IP structure.

The current KNX specification foresees additional data only in the case of tunneling.

另请参阅 individualAddress ().

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

Returns a builder object to create a KNXnet/IP connection response data block structure.

QKnxNetIp::ConnectionType QKnxNetIpCrdProxy:: connectionType () const

Returns the connection type of this KNXnet/IP structure if the object that was passed during construction was valid; otherwise returns QKnx::NetIp::Unknown .

QKnxAddress QKnxNetIpCrdProxy:: individualAddress () const

Returns the individual address of this KNXnet/IP structure if the object that was passed during construction was valid and the connection type is QKnx::NetIp::Tunnel ;否则返回 QKnx::NetIp::Unknown .

另请参阅 additionalData ().

bool QKnxNetIpCrdProxy:: isValid () const

返回 true if the KNXnet/IP structure to create the object is a valid KNXnet/IP CRD structure; otherwise returns false .