QKnxNetIpSessionResponseProxy Class

The QKnxNetIpSessionResponseProxy class provides the means to introspect session response data inside the generic QKnxNetIpFrame class and to create a KNXnet/IP session response frame from provided data. 更多...

頭: #include <QKnxNetIpSessionResponseProxy>
qmake: QT += knx
Since: Qt 5.12

該類在 Qt 5.12 引入。

公共類型

class Builder
class SecureBuilder

公共函數

QKnxNetIpSessionResponseProxy (const QKnxNetIpFrame & frame )
bool isValid () const
QKnxByteArray messageAuthenticationCode () const
QKnxByteArray publicKey () const
quint16 secureSessionId () const

靜態公共成員

QKnxNetIpSessionResponseProxy::Builder builder ()
QKnxNetIpSessionResponseProxy::SecureBuilder secureBuilder ()

詳細描述

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 the KNXnet/IP secure server to the KNXnet/IP secure client control endpoint in response to a received secure session request frame.

注意: When using QKnxNetIpSessionResponseProxy, 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 response information:

auto netIpFrame = QKnxNetIpFrame::fromBytes(...);
const QKnxNetIpSessionResponseProxy proxy(netIpFrame);
if (!proxy.isValid())
    return;
auto endPoint = proxy.controlEndpoint();
auto serverPublicKey = proxy.publicKey();
auto authenticationCode = proxy.messageAuthenticationCode();
					

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

成員函數文檔編製

QKnxNetIpSessionResponseProxy:: QKnxNetIpSessionResponseProxy (const QKnxNetIpFrame & frame )

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

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

Returns a builder object to create a KNXnet/IP session response frame.

bool QKnxNetIpSessionResponseProxy:: 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.

注意: KNXnet/IP session response frames currently have a fixed size of 56 字節。

另請參閱 QKnxNetIpFrameHeader::totalSize ().

QKnxByteArray QKnxNetIpSessionResponseProxy:: messageAuthenticationCode () const

Returns the AES128 CCM message authentication code (MAC) from the generic KNXnet/IP session response frame with a fixed size of 16 字節。

QKnxByteArray QKnxNetIpSessionResponseProxy:: publicKey () const

Returns the public key from the generic KNXnet/IP session response frame. The public key needs to be generated using the Curve25519 algorithm and has a fixed size of 32 字節。

[static] QKnxNetIpSessionResponseProxy::SecureBuilder QKnxNetIpSessionResponseProxy:: secureBuilder ()

Returns a builder object to create a KNXnet/IP session response frame.

quint16 QKnxNetIpSessionResponseProxy:: secureSessionId () const

Returns the secure session ID from the generic KNXnet/IP session response frame if the object that was passed during construction was valid; otherwise returns a 默認構造值 which can be 0 .