QKnxNetIpRoutingLostMessageProxy Class

The QKnxNetIpRoutingLostMessageProxy class provides the means to read a routing-lost message from the generic QKnxNetIpFrame class and to create a KNXnet/IP frame based on the information. 更多...

头: #include <QKnxNetIpRoutingLostMessageProxy>
qmake: QT += knx

公共类型

class Builder

公共函数

QKnxNetIpRoutingLostMessageProxy (const QKnxNetIpFrame & frame )
QKnxNetIp::DeviceState deviceState () const
bool isValid () const
quint16 lostMessageCount () const

静态公共成员

QKnxNetIpRoutingLostMessageProxy::Builder builder ()

详细描述

Depending on the configuration, a KNXnet/IP router or device can receive more datagrams than it can forward to the KNX subnetwork. This can lead to an overflow of the datagram queue and subsequent loss of one or more KNXnet/IP telegrams, because they could not be transferred from the network buffer to the queue to the underlying KNX subnetwork.

A routing-lost message is multicast by a KNXnet/IP router to notify that KNXnet/IP routing indication frames were lost. The message contains the state of the router or device ( QKnx::NetIp::DeviceState ) and the number of lost frames.

注意: When using QKnxNetIpRoutingLostMessageProxy, 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 routing-lost message information sent by a KNXnet/IP router:

auto netIpFrame = QKnxNetIpFrame::fromBytes(...);
QKnxNetIpRoutingLostMessageProxy proxy(netIpFrame);
if (!proxy.isValid())
    return;
if (proxy.deviceState() == QKnx::NetIp::DeviceState::KnxFault) {
    ....
}
					

另请参阅 builder (), QKnxNetIpRoutingIndicationProxy , QKnxNetIpRoutingBusyProxy ,和 Qt KNXnet/IP Connection Classes .

成员函数文档编制

QKnxNetIpRoutingLostMessageProxy:: QKnxNetIpRoutingLostMessageProxy (const QKnxNetIpFrame & frame )

Constructs a proxy object to read the routing-lost message information carried by the specified KNXnet/IP frame frame .

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

Returns a builder object to create a KNXnet/IP routing-lost message frame.

QKnxNetIp::DeviceState QKnxNetIpRoutingLostMessageProxy:: deviceState () const

Returns the state of a KNXnet/IP router or device.

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

另请参阅 QKnxNetIpFrameHeader::totalSize ().

quint16 QKnxNetIpRoutingLostMessageProxy:: lostMessageCount () const

Returns the number of frames that were lost.