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 ().