QKnxNetIpSessionStatusProxy Class

The QKnxNetIpSessionStatusProxy class provides the means to introspect secure session status data inside the generic QKnxNetIpFrame class and to create a KNXnet/IP secure session status frame from provided data. More...

Header: #include <QKnxNetIpSessionStatusProxy>
qmake: QT += knx
Since: Qt 5.12

Public Types

class Builder

Public Functions

QKnxNetIpSessionStatusProxy(const QKnxNetIpFrame &frame)
bool isValid() const
QKnxNetIp::SecureSessionStatus status() const

Static Public Members

QKnxNetIpSessionStatusProxy::Builder builder()

Detailed Description

The QKnxNetIpSessionStatusProxy class provides the means to introspect secure session status data inside the generic QKnxNetIpFrame class and to create a KNXnet/IP secure session status frame from provided data.

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 may be sent by the KNXnet/IP secure server to the KNXnet/IP secure client or by the KNXnet/IP secure client to the KNXnet/IP secure server at any stage of the secure session handshake to indicate an error condition or to convey status information.

Note: When using QKnxNetIpSessionStatusProxy, 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 status information:

auto netIpFrame = QKnxNetIpFrame::fromBytes(...);

const QKnxNetIpSessionStatusProxy proxy(netIpFrame);
if (!proxy.isValid())
    return;

auto currentStatus = proxy.status();

See also builder() and Qt KNXnet/IP Connection Classes.

Member Function Documentation

QKnxNetIpSessionStatusProxy::QKnxNetIpSessionStatusProxy(const QKnxNetIpFrame &frame)

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

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

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

bool QKnxNetIpSessionStatusProxy::isValid() const

Returns 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.

Note: KNXnet/IP session status frames currently have a fixed size of 8 bytes.

See also QKnxNetIpFrameHeader::totalSize().

QKnxNetIp::SecureSessionStatus QKnxNetIpSessionStatusProxy::status() const

Returns the session status from the generic KNXnet/IP session status frame.

© 2018 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.