The QKnxNetIpDescriptionResponseProxy class provides the means to read a description response from the generic QKnxNetIpFrame class and to create a KNXnet/IP frame based on the information. 更多...
头: | #include <QKnxNetIpDescriptionResponseProxy> |
qmake: | QT += knx |
class | Builder |
QKnxNetIpDescriptionResponseProxy (const QKnxNetIpFrame & frame ) | |
QKnxNetIpDib | deviceHardware () const |
bool | isValid () const |
QVector<QKnxNetIpDib> | optionalDibs () const |
QKnxNetIpDib | supportedFamilies () const |
QKnxNetIpDescriptionResponseProxy::Builder | builder () |
When a KNXnet/IP server receives a description request from a KNXnet/IP client, it replies by sending a description response frame that contains information about the supported protocol version range, its own capabilities, state information, and optionally a friendly name for this server's KNX connection.
In most programs, this class will not be used directly. Instead, the QKnxNetIpServerDescriptionAgent and QKnxNetIpServerInfo are provided to check that the server supports the requested connection type and options.
注意: When using QKnxNetIpDescriptionResponseProxy, 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 description response information sent by a KNXnet/IP server:
auto netIpFrame = QKnxNetIpFrame::fromBytes(...); const QKnxNetIpDescriptionResponseProxy proxy(netIpFrame); if (!proxy.isValid()) return; auto hardware = proxy.deviceHardware(); auto families = proxy.supportedFamilies();
另请参阅 builder (), QKnxNetIpDescriptionRequestProxy ,和 Qt KNXnet/IP Connection Classes .
Constructs a proxy object to read the description response information carried by the specified KNXnet/IP frame frame .
[static]
QKnxNetIpDescriptionResponseProxy::Builder
QKnxNetIpDescriptionResponseProxy::
builder
()
Returns a builder object to create a KNXnet/IP description response frame.
Returns information about the KNXnet/IP server hardware.
返回
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.
注意: 若 QKnxNetIpFrame used to create the response proxy contains tunneling information description objects, it is also considered invalid.
另请参阅 QKnxNetIpFrameHeader::totalSize ().
Returns a vector of optional KNXnet/IP server device information block (DIB) structures. The vector can be empty if no such structures are present or in case of an error while extracting the optional DIBs.
注意: The function does not perform validity checks on the QKnxNetIpFrame used to create the description response proxy object.
Returns information about the service families that the KNXnet/IP server supports.
注意: The returned service families must be allowed in a description response. A service family higher than or equal to the security family is not allowed in this case.