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 .