QKnxNetIpDescriptionRequestProxy Class

The QKnxNetIpDescriptionRequestProxy class provides the means to read a description request from the generic QKnxNetIpFrame class and to create a KNXnet/IP frame based on the information. 更多...

頭: #include <QKnxNetIpDescriptionRequestProxy>
qmake: QT += knx

公共類型

class Builder

公共函數

QKnxNetIpDescriptionRequestProxy (const QKnxNetIpFrame & frame )
QKnxNetIpHpai controlEndpoint () const
bool isValid () const

靜態公共成員

QKnxNetIpDescriptionRequestProxy::Builder builder ()

詳細描述

After discovering a KNXnet/IP server, the KNXnet/IP client sends a description request through a unicast or point-to-point connection to all control endpoints of the server.

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.

注意: When using QKnxNetIpDescriptionRequestProxy, 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 request information sent by a KNXnet/IP client:

auto netIpFrame = QKnxNetIpFrame::fromBytes(...);
const QKnxNetIpDescriptionRequestProxy proxy(netIpFrame);
if (!proxy.isValid())
    return;
auto endPoint = proxy.controlEndpoint();
					

另請參閱 builder (), QKnxNetIpDescriptionResponseProxy ,和 Qt KNXnet/IP Connection Classes .

成員函數文檔編製

QKnxNetIpDescriptionRequestProxy:: QKnxNetIpDescriptionRequestProxy (const QKnxNetIpFrame & frame )

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

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

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

QKnxNetIpHpai QKnxNetIpDescriptionRequestProxy:: controlEndpoint () const

Returns the control endpoint of the KNXnet/IP client sending the description request.

bool QKnxNetIpDescriptionRequestProxy:: 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 ().