QKnxNetIpConnectRequestProxy Class

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

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

公共类型

class Builder

公共函数

QKnxNetIpConnectRequestProxy (const QKnxNetIpFrame & frame )
QKnxNetIpHpai controlEndpoint () const
QKnxNetIpHpai dataEndpoint () const
bool isValid () const
QKnxNetIpCri requestInformation () const

静态公共成员

QKnxNetIpConnectRequestProxy::Builder builder ()

详细描述

A connection request is sent by a KNXnet/IP client to establish a communication channel to a KNXnet/IP server. The connection request provides information about the requested connection type, such as data tunneling or remote logging, general and connection type-specific options, such as data link layer or busmonitor mode, and the data endpoint host address protocol information (HPAI) that the client wants to use for this communication channel.

In most programs, the QKnxNetIpConnectRequestProxy class will not be used directly. Instead, the QKnxNetIpTunnel or QKnxNetIpDeviceManagement class are used to establish a functional connection to a KNXnet/IP server.

Before sending a connection request, the KNXnet/IP client should use QKnxNetIpServerDescriptionAgent and QKnxNetIpServerInfo to check that the server supports the requested connection type and options.

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

auto frame = QKnxNetIpFrame::fromBytes(...);
const QKnxNetIpConnectRequestProxy proxy(frame);
if (!proxy.isValid())
    return;
auto ctrlEndpoint = proxy.controlEndpoint();
auto dataEndpoint = proxy.dataEndpoint();
auto cri = proxy. requestInformation();
					

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

成员函数文档编制

QKnxNetIpConnectRequestProxy:: QKnxNetIpConnectRequestProxy (const QKnxNetIpFrame & frame )

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

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

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

QKnxNetIpHpai QKnxNetIpConnectRequestProxy:: controlEndpoint () const

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

QKnxNetIpHpai QKnxNetIpConnectRequestProxy:: dataEndpoint () const

Returns the data endpoint of the KNXnet/IP client sending the connection request.

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

QKnxNetIpCri QKnxNetIpConnectRequestProxy:: requestInformation () const

Returns the connection request information (CRI) set by the KNXnet/IP client for the requested connection.