QKnxNetIpCurrentConfigDibProxy Class

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

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

公共类型

class Builder

公共函数

QKnxNetIpCurrentConfigDibProxy (const QKnxNetIpDib & dib )
QKnxNetIp::AssignmentMethod assignmentMethod () const
QHostAddress defaultGateway () const
QKnxNetIp::DescriptionType descriptionType () const
QHostAddress dhcpOrBootP () const
QHostAddress ipAddress () const
bool isValid () const
QHostAddress subnetMask () const

静态公共成员

QKnxNetIpCurrentConfigDibProxy::Builder builder ()

详细描述

A KNXnet/IP current IP configuration DIB structure contains a set of values currently used on the device for IP communication.

注意: When using QKnxNetIpCurrentConfigDibProxy, 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 current IP configuration can be achieved like this:

auto dib = QKnxNetIpDib::fromBytes(...);
QKnxNetIpCurrentConfigDibProxy proxy(dib);
if (!proxy.isValid())
    return;
auto infos = proxy.ipAddress();
auto subnetMask = proxy.subnetMask();
auto gateway = proxy.defaultGateway();
auto dhcp = proxy.dhcpOrBootP();
auto assignmentMethod = proxy.assignmentMethod();
					

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

成员函数文档编制

QKnxNetIpCurrentConfigDibProxy:: QKnxNetIpCurrentConfigDibProxy (const QKnxNetIpDib & dib )

Constructs a proxy object with the specified KNXnet/IP DIB structure dib to read the current KNX device configuration.

QKnxNetIp::AssignmentMethod QKnxNetIpCurrentConfigDibProxy:: assignmentMethod () const

Returns the currently employed IP address assignment method of this KNXnet/IP structure if the object that was passed during construction was valid; otherwise returns QKnx::NetIp::Unknown .

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

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

QHostAddress QKnxNetIpCurrentConfigDibProxy:: defaultGateway () const

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

QKnxNetIp::DescriptionType QKnxNetIpCurrentConfigDibProxy:: 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 QKnxNetIpCurrentConfigDibProxy:: dhcpOrBootP () const

Returns the IP address of the DHCP/BootP server the KNXnet/IP device last received its IP address from of this KNXnet/IP structure if the object that was passed during construction was valid; otherwise returns a invalid QHostAddress .

QHostAddress QKnxNetIpCurrentConfigDibProxy:: ipAddress () const

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

bool QKnxNetIpCurrentConfigDibProxy:: isValid () const

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

QHostAddress QKnxNetIpCurrentConfigDibProxy:: subnetMask () const

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