QKnxNetIpTunnelingAcknowledgeProxy Class

The QKnxNetIpTunnelingAcknowledgeProxy class provides the means to read a tunneling acknowledgment from the generic QKnxNetIpFrame class and to create a KNXnet/IP frame based on the information. More...

Header: #include <QKnxNetIpTunnelingAcknowledgeProxy>
qmake: QT += knx

Public Types

class Builder

Public Functions

QKnxNetIpTunnelingAcknowledgeProxy(const QKnxNetIpFrame &frame)
quint8 channelId() const
bool isValid() const
quint8 sequenceNumber() const
QKnxNetIp::Error status() const

Static Public Members

QKnxNetIpTunnelingAcknowledgeProxy::Builder builder()

Detailed Description

The QKnxNetIpTunnelingAcknowledgeProxy class provides the means to read a tunneling acknowledgment from the generic QKnxNetIpFrame class and to create a KNXnet/IP frame based on the information.

Tunneling means that Engineering Tool Software (ETS) sends a single KNX frame in a KNXnet/IP frame and waits until the response arrives or a time-out is reached.

A tunneling request is sent by a KNXnet/IP client to establish a data connection to the endpoint of a KNXnet/IP server for sending a KNX frame. When a KNXnet/IP server receives a tunneling request, it immediately sends a tunneling acknowledgment to the KNXnet/IP client to confirm the reception of the request and then processes the received KNX frame.

A tunneling acknowledgment frame contains the ID and status of the communication channel between a KNXnet/IP client and server, as well as the sequence number of a tunneling request frame.

The server only processes frames with the expected sequence number or one less the expected sequence number. It discards frames with other sequence numbers and does not send a tunneling acknowledgment upon receiving them.

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

Note: When using QKnxNetIpTunnelingAcknowledgeProxy, 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 tunneling acknowledgment information sent by a KNXnet/IP client:

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

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

auto chanId = proxy.channelId();
auto seqNum = proxy.sequenceNumber();
auto tunnelStatus = proxy.status();

See also builder(), QKnxNetIpTunnelingRequestProxy, Qt KNX Tunneling Classes, and Qt KNXnet/IP Connection Classes.

Member Function Documentation

QKnxNetIpTunnelingAcknowledgeProxy::QKnxNetIpTunnelingAcknowledgeProxy(const QKnxNetIpFrame &frame)

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

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

Returns a builder object to create a KNXnet/IP tunneling acknowledgment frame.

quint8 QKnxNetIpTunnelingAcknowledgeProxy::channelId() const

Returns the ID of the communication channel between a KNXnet/IP client and server.

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

See also QKnxNetIpFrameHeader::totalSize().

quint8 QKnxNetIpTunnelingAcknowledgeProxy::sequenceNumber() const

Returns the sequence number of a tunneling acknowledgment frame.

QKnxNetIp::Error QKnxNetIpTunnelingAcknowledgeProxy::status() const

Returns the status of the communication channel between a KNXnet/IP client and server.

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