QKnxNetIpDeviceConfigurationRequestProxy Class

The QKnxNetIpDeviceConfigurationRequestProxy class provides the means to read a device configuration request from the generic QKnxNetIpFrame class and to create a KNXnet/IP frame based on the information. 更多...

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

公共类型

class Builder

公共函数

QKnxNetIpDeviceConfigurationRequestProxy (const QKnxNetIpFrame & frame )
QKnxDeviceManagementFrame cemi () const
quint8 channelId () const
bool isValid () const
quint8 sequenceNumber () const

静态公共成员

QKnxNetIpDeviceConfigurationRequestProxy::Builder builder ()

详细描述

KNXnet/IP device configuration and management is based on interface object properties. Devices accept configuration through KNX network telegrams, whereas routers accept configuration through routing frames that carry common external message interface (cEMI) frames addressed to the individual address of the router.

Each subnetwork connected to a KNXnet/IP server is represented by a control endpoint. KNXnet/IP clients can discover the control endpoints by using the discovery procedure.

In addition, each subnetwork is represented by a configuration and management endpoint that enables access to device parameters, filter table, and so on, after a connection is established through the control endpoint. The host address protocol information (HPAI) of the configuration and management endpoint is used by KNXnet/IP devices to exchange configuration information with ETS.

A KNXnet/IP client connects to a configuration and management data endpoint of a KNXnet/IP server to send device configuration request frames and to receive device configuration acknowledgment frames. A device configuration request is used to read and write KNXnet/IP device configuration data. When a server receives a configuration request, it responds with a device configuration acknowledgment to confirm the reception of the request.

A device configuration request frame contains the ID of the communication channel between a KNXnet/IP client and server, the sequence number of the frame, and a cEMI frame with the configuration message.

The KNXnet/IP server discards frames with unexpected sequence numbers and does not send a device configuration 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.

注意: When using QKnxNetIpDeviceConfigurationRequestProxy, 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 device configuration request information sent by a KNXnet/IP client:

auto netIpFrame = QKnxNetIpFrame::fromBytes(...);
const QKnxNetIpDeviceConfigurationRequestProxy proxy(netIpFrame);
if (!proxy.isValid())
    return;
quint8 chanId = proxy.channelId();
quint8 seqNum = proxy.sequenceNumber();
auto knxLinkFrame = proxy.cemi();
					

另请参阅 builder (), QKnxNetIpServerDiscoveryAgent , QKnxNetIpDeviceConfigurationAcknowledgeProxy , Qt KNX Device Management Classes ,和 Qt KNXnet/IP Connection Classes .

成员函数文档编制

QKnxNetIpDeviceConfigurationRequestProxy:: QKnxNetIpDeviceConfigurationRequestProxy (const QKnxNetIpFrame & frame )

Constructs a proxy object to read the device configuration request information carried by the specified KNXnet/IP frame frame .

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

Returns a builder object to create a KNXnet/IP device configuration request frame.

QKnxDeviceManagementFrame QKnxNetIpDeviceConfigurationRequestProxy:: cemi () const

Returns a cEMI frame that contains the configuration message.

quint8 QKnxNetIpDeviceConfigurationRequestProxy:: channelId () const

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

bool QKnxNetIpDeviceConfigurationRequestProxy:: 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 ().

quint8 QKnxNetIpDeviceConfigurationRequestProxy:: sequenceNumber () const

Returns the sequence number of a device configuration request frame.