QKnxNetIpConfigDibProxy Class

The QKnxNetIpConfigDibProxy class provides the means to read the IP configuration from the generic QKnxNetIpDib class and to create a KNXnet/IP current IP configuration (DIB) structure based on the information. 更多...

頭: #include <QKnxNetIpConfigDibProxy>
qmake: QT += knx

公共類型

class Builder

公共函數

QKnxNetIpConfigDibProxy (const QKnxNetIpDib & dib )
QKnxNetIp::AssignmentMethods assignmentMethods () const
QKnxNetIp::Capabilities capabilities () const
QHostAddress defaultGateway () const
QKnxNetIp::DescriptionType descriptionType () const
QHostAddress ipAddress () const
bool isValid () const
QHostAddress subnetMask () const

靜態公共成員

QKnxNetIpConfigDibProxy::Builder builder ()

詳細描述

注意: When using QKnxNetIpConfigDibProxy, care must be taken to ensure that the referenced KNXnet/IP DIB structure outlives the proxy on all code paths, lest the proxy ends up referencing deleted data.

Reading the IP configuration can be achieved like this:

auto dib = QKnxNetIpDib::fromBytes(...);
QKnxNetIpConfigDibProxy proxy(dib);
if (!proxy.isValid())
    return;
auto infos = proxy.ipAddress();
auto subnetMask = proxy.subnetMask();
auto gateway = proxy.defaultGateway();
auto caps = proxy.capabilities();
auto assignmentMethods = proxy.assignmentMethods();
					

另請參閱 builder () 和 Qt KNXnet/IP Connection Classes .

成員函數文檔編製

QKnxNetIpConfigDibProxy:: QKnxNetIpConfigDibProxy (const QKnxNetIpDib & dib )

Constructs a proxy object with the specified KNXnet/IP DIB structure dib to read the supported service families and versions.

QKnxNetIp::AssignmentMethods QKnxNetIpConfigDibProxy:: assignmentMethods () const

Returns the enabled IP address assignment methods for setting the current IP address if the object that was passed during construction was valid; otherwise returns QKnx::NetIp::Unknown .

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

Returns a builder object to create a KNXnet/IP IP configuration DIB structure.

QKnxNetIp::Capabilities QKnxNetIpConfigDibProxy:: capabilities () const

Returns the IP capabilities supported by the KNXnet/IP device if the object that was passed during construction was valid; otherwise returns QKnx::NetIp::Unknown .

QHostAddress QKnxNetIpConfigDibProxy:: defaultGateway () const

Returns the default gateway of this KNXnet/IP structure if the object that was passed during construction was valid; otherwise returns an invalid QHostAddress .

QKnxNetIp::DescriptionType QKnxNetIpConfigDibProxy:: descriptionType () const

Returns the description type of this KNXnet/IP structure if the object that was passed during construction was valid; otherwise returns QKnx::NetIp::Unknown .

QHostAddress QKnxNetIpConfigDibProxy:: ipAddress () const

Returns the fixed IP address of this KNXnet/IP structure if the object that was passed during construction was valid; otherwise returns an invalid QHostAddress .

bool QKnxNetIpConfigDibProxy:: isValid () const

返迴 true if the KNXnet/IP structure to create the object is a valid KNXnet/IP DIB structure; otherwise returns false .

QHostAddress QKnxNetIpConfigDibProxy:: subnetMask () const

Returns the subnet mask of this KNXnet/IP structure if the object that was passed during construction was valid; otherwise returns an invalid QHostAddress .