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 .
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.
Returns the control endpoint of the KNXnet/IP client sending the connection request.
Returns the data endpoint of the KNXnet/IP client sending the connection request.
返回
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 ().
Returns the connection request information (CRI) set by the KNXnet/IP client for the requested connection.