Builder Class

class QKnxNetIpConnectionStateRequestProxy ::Builder

The QKnxNetIpConnectionStateRequestProxy::Builder class provides the means to create a KNXnet/IP connection state request frame. 更多...

公共函数

QKnxNetIpFrame create () const
Builder & setChannelId (quint8 channelId )
Builder & setControlEndpoint (const QKnxNetIpHpai & hpai )

详细描述

A KNXnet/IP client sends a connection state request frame regularly to the KNXnet/IP server's control endpoint to check the state of a connection established to the server. The server responds immediately with a connection state response frame, QKnxNetIpConnectionStateResponseProxy .

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.

The common way to create a connection state request is:

auto hpai = QKnxNetIpHpaiProxy::builder().create();
auto netIpFrame = QKnxNetIpConnectionStateRequestProxy::builder()
    .setChannelId(255)
    .setControlEndpoint(hpai)
    .create();
					

If the KNXnet/IP client does not receive the connection state response within a timeout, or the status of the received response indicates that errors occurred, the client repeats the connection state request three times. It then terminates the connection by sending a disconnect request, QKnxNetIpDisconnectRequestProxy , to the server's control endpoint.

成员函数文档编制

QKnxNetIpFrame Builder:: create () const

Creates and returns a KNXnet/IP connection state request frame.

注意: The returned frame may be invalid depending on the values used during setup.

另请参阅 isValid ().

Builder &Builder:: setChannelId ( quint8 channelId )

Sets the ID of the communication channel to channelId and returns a reference to the builder.

Builder &Builder:: setControlEndpoint (const QKnxNetIpHpai & hpai )

Sets the control endpoint of the KNXnet/IP client to hpai and returns a reference to the builder.