The QKnxNetIpSessionRequestProxy class provides the means to introspect session request data inside the generic QKnxNetIpFrame class and to create a KNXnet/IP session request frame from provided data. 更多...
头: | #include <QKnxNetIpSessionRequestProxy> |
qmake: | QT += knx |
Since: | Qt 5.12 |
该类在 Qt 5.12 引入。
class | Builder |
QKnxNetIpSessionRequestProxy (const QKnxNetIpFrame & frame ) | |
QKnxNetIpHpai | controlEndpoint () const |
bool | isValid () const |
QKnxByteArray | publicKey () const |
QKnxNetIpSessionRequestProxy::Builder | builder () |
This class is part of the Qt KNX module and currently available as a Technology Preview, and therefore the API and functionality provided by the class may be subject to change at any time without prior notice.
This frame will be sent by a KNXnet/IP secure client to the control endpoint of the KNXnet/IP secure server to initiate the secure session setup handshake for a new secure communication channel. The maximum time a KNXnet/IP secure client will wait for a response of the KNXnet/IP secure server is 10 seconds.
注意: When using QKnxNetIpSessionRequestProxy, 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 session request information:
auto netIpFrame = QKnxNetIpFrame::fromBytes(...); const QKnxNetIpSessionRequestProxy proxy(netIpFrame); if (!proxy.isValid()) return; auto endPoint = proxy.controlEndpoint(); auto publicKey = proxy.publicKey();
另请参阅 builder (), QKnxNetIpSessionResponseProxy ,和 Qt KNXnet/IP Connection Classes .
Constructs a proxy object to read the session request information carried by the specified KNXnet/IP frame frame .
[static]
QKnxNetIpSessionRequestProxy::Builder
QKnxNetIpSessionRequestProxy::
builder
()
Returns a builder object to create a KNXnet/IP session request frame.
Returns the control endpoint from the generic KNXnet/IP session request frame.
返回
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.
注意:
KNXnet/IP session request frames currently have a fixed size of
46
字节。
另请参阅 QKnxNetIpFrameHeader::totalSize ().
Returns the public key from the generic KNXnet/IP session request frame. The public key needs to be generated using the Curve25519 algorithm and has a fixed size of
32
字节。