QKnxDeviceManagementFrame Class

The QKnxDeviceManagementFrame class represents a cEMI frame dedicated to KNXnet/IP device management. 更多...

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

公共类型

class Builder
class FunctionPropertyCommandBuilder
class FunctionPropertyStateReadBuilder
class PropertyInfoBuilder
class PropertyReadBuilder
class PropertyWriteBuilder
class ResetBuilder
enum class MessageCode { Unknown, PropertyReadRequest, PropertyReadConfirmation, PropertyWriteRequest, PropertyWriteConfirmation, …, ResetIndication }

公共函数

QKnxDeviceManagementFrame (QKnxDeviceManagementFrame && other )
QKnxDeviceManagementFrame (const QKnxDeviceManagementFrame & other )
QKnxDeviceManagementFrame (QKnxDeviceManagementFrame::MessageCode code , const QKnxByteArray & serviceInfo )
QKnxDeviceManagementFrame (QKnxDeviceManagementFrame::MessageCode code )
QKnxDeviceManagementFrame ()
QKnxDeviceManagementFrame & operator= (QKnxDeviceManagementFrame && other )
QKnxDeviceManagementFrame & operator= (const QKnxDeviceManagementFrame & other )
~QKnxDeviceManagementFrame ()
QKnxByteArray bytes () const
QKnxByteArray data () const
QKnxNetIpCemiServer::Error error () const
bool isNegativeConfirmation () const
bool isNull () const
bool isValid () const
QKnxDeviceManagementFrame::MessageCode messageCode () const
quint8 numberOfElements () const
quint8 objectInstance () const
QKnxInterfaceObjectType objectType () const
QKnxInterfaceObjectProperty property () const
QKnxNetIpCemiServer::ReturnCode returnCode () const
QKnxByteArray serviceInformation () const
void setData (const QKnxByteArray & newData )
void setError (QKnxNetIpCemiServer::Error error )
void setMessageCode (QKnxDeviceManagementFrame::MessageCode code )
void setNumberOfElements (quint8 numOfElements )
void setObjectInstance (quint8 实例 )
void setObjectType (QKnxInterfaceObjectType type )
void setProperty (QKnxInterfaceObjectProperty pid )
void setReturnCode (QKnxNetIpCemiServer::ReturnCode code )
void setServiceInformation (const QKnxByteArray & serviceInfo )
void setStartIndex (quint16 index )
quint16 size () const
quint16 startIndex () const
void swap (QKnxDeviceManagementFrame & other )
bool operator!= (const QKnxDeviceManagementFrame & other ) const
bool operator== (const QKnxDeviceManagementFrame & other ) const

静态公共成员

QKnxDeviceManagementFrame::Builder builder ()
QKnxDeviceManagementFrame fromBytes (const QKnxByteArray & data , quint16 index , quint16 size )
QKnxDeviceManagementFrame::FunctionPropertyCommandBuilder functionPropertyCommandBuilder ()
QKnxDeviceManagementFrame::FunctionPropertyStateReadBuilder functionPropertyStateReadBuilder ()
QKnxDeviceManagementFrame::PropertyInfoBuilder propertyInfoBuilder ()
QKnxDeviceManagementFrame::PropertyReadBuilder propertyReadBuilder ()
QKnxDeviceManagementFrame::PropertyWriteBuilder propertyWriteBuilder ()
QKnxDeviceManagementFrame::ResetBuilder resetBuilder ()
QDebug operator<< (QDebug debug , const QKnxDeviceManagementFrame & frame )

详细描述

A device management connection is established between a common external message interface (cEMI) client and a cEMI server to transmit cEMI device management frames. A cEMI frame specifies the service to use and the MessageCode that determines whether the frame carries a request, confirmation, or indication related to the selected service.

The following services are available:

  • Property read ( M_PropRead.req and M_PropRead.con )
  • Property write ( M_PropWrite.req and M_PropWrite.con )
  • Property info indication service ( M_PropInfo.ind )
  • Function property command ( M_FuncPropCommand.req and M_FuncPropCommand.con )
  • Function property state read ( M_FuncPropStateRead.req and M_FuncPropStateRead.con )
  • Reset and restart service ( M_Reset.req )

Application layer services are invoked by the transport layer frames request (.req) , indication (.ind) ,和 confirmation (.con) . The same frames are used by the remote device to respond to a remote confirmed service.

Typically, a device management frame contains at least the following arguments:

The QKnxDeviceManagementFrame::Builder class can be used to construct local device management cEMI frames. The following more specialized versions of the builder are also provided, and it is recommended to prefer them over the generic version:

另请参阅 Qt KNX Device Management Classes .

成员类型文档编制

enum class QKnxDeviceManagementFrame:: MessageCode

This enum holds the message codes of a local device management frame.

常量 描述
QKnxDeviceManagementFrame::MessageCode::Unknown 0x00 Unknown message code, do not use.
QKnxDeviceManagementFrame::MessageCode::PropertyReadRequest 0xfc Message code for a property read request frame, M_PropRead.req .
QKnxDeviceManagementFrame::MessageCode::PropertyReadConfirmation 0xfb Message code for a property read confirmation frame, M_PropRead.con .
QKnxDeviceManagementFrame::MessageCode::PropertyWriteRequest 0xf6 Message code for a property write request frame, M_PropWrite.req .
QKnxDeviceManagementFrame::MessageCode::PropertyWriteConfirmation 0xf5 Message code for a property write confirmation frame, M_PropWrite.con .
QKnxDeviceManagementFrame::MessageCode::PropertyInfoIndication 0xf7 Message code for a property info indication frame, M_PropInfo.ind .
QKnxDeviceManagementFrame::MessageCode::FunctionPropertyCommandRequest 0xf8 Message code for a function property command frame, M_FuncPropCommand.req .
QKnxDeviceManagementFrame::MessageCode::FunctionPropertyStateReadRequest 0xf9 Message code for a function property state read request frame, M_FuncPropStateRead.req .
QKnxDeviceManagementFrame::MessageCode::FunctionPropertyCommandConfirmation 0xfa Message code for a function property command confirmation frame, M_FuncPropCommand.con .
QKnxDeviceManagementFrame::MessageCode::FunctionPropertyStateReadConfirmation 0xfa Message code for a function property state read confirmation frame, M_FuncPropStateRead.con .
QKnxDeviceManagementFrame::MessageCode::ResetRequest 0xf1 Message code for a reset request frame, M_Reset.req .
QKnxDeviceManagementFrame::MessageCode::ResetIndication 0xf0 Message code for a reset indication frame, M_Reset.ind .

成员函数文档编制

QKnxDeviceManagementFrame:: QKnxDeviceManagementFrame ( QKnxDeviceManagementFrame && other )

Move-constructs an object instance, making it point to the same object that other 所指向的。

QKnxDeviceManagementFrame:: QKnxDeviceManagementFrame (const QKnxDeviceManagementFrame & other )

构造副本为 other .

QKnxDeviceManagementFrame:: QKnxDeviceManagementFrame ( QKnxDeviceManagementFrame::MessageCode code , const QKnxByteArray & serviceInfo )

Constructs a local device management frame with the message code set to code and service information set to serviceInfo .

QKnxDeviceManagementFrame:: QKnxDeviceManagementFrame ( QKnxDeviceManagementFrame::MessageCode code )

Constructs an empty local device management frame with the message code set to code .

QKnxDeviceManagementFrame:: QKnxDeviceManagementFrame ()

Constructs an empty invalid local device management frame.

QKnxDeviceManagementFrame &QKnxDeviceManagementFrame:: operator= ( QKnxDeviceManagementFrame && other )

移动赋值 other to this object instance.

QKnxDeviceManagementFrame &QKnxDeviceManagementFrame:: operator= (const QKnxDeviceManagementFrame & other )

赋值指定 other 到此对象。

QKnxDeviceManagementFrame:: ~QKnxDeviceManagementFrame ()

Destroys the local device management frame and frees all allocated resources.

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

Returns an instance of a generic device management frame builder.

QKnxByteArray QKnxDeviceManagementFrame:: bytes () const

Returns an array of bytes that represent the local device management frame.

QKnxByteArray QKnxDeviceManagementFrame:: data () const

Returns the data field of the local device management frame as an array of bytes.

The length of the data depends on the property datatype of the property and in case of an array-structured property value also on the number of array elements that are accessed.

In case of an error, the data field stores the error code as a single byte.

另请参阅 setData ().

QKnxNetIpCemiServer::Error QKnxDeviceManagementFrame:: error () const

Returns the error code stored in the local device management frame if the frame is a PropertyReadConfirmation or PropertyWriteConfirmation frame and the number of elements is set to 0 . Otherwise returns None .

另请参阅 setError (), data (),和 isNegativeConfirmation ().

[static] QKnxDeviceManagementFrame QKnxDeviceManagementFrame:: fromBytes (const QKnxByteArray & data , quint16 index , quint16 size )

Constructs the local device management frame from the byte array data starting at the position index inside the array with the size size .

[static] QKnxDeviceManagementFrame::FunctionPropertyCommandBuilder QKnxDeviceManagementFrame:: functionPropertyCommandBuilder ()

Returns an instance of a device management function property command frame builder.

[static] QKnxDeviceManagementFrame::FunctionPropertyStateReadBuilder QKnxDeviceManagementFrame:: functionPropertyStateReadBuilder ()

Returns an instance of a device management function property state read frame builder.

bool QKnxDeviceManagementFrame:: isNegativeConfirmation () const

返回 true if this local device management frame is a negative confirmation; otherwise returns false .

For property read or write confirmation frames, the data field of a negative confirmation contains the error information.

For function property command or function property state read confirmation frames, neither a return code nor data are transmitted with the frame.

另请参阅 data (), error (),和 returnCode ().

bool QKnxDeviceManagementFrame:: isNull () const

返回 true if this is a default constructed device management frame, otherwise returns false . A frame is considered null if it contains no initialized values.

bool QKnxDeviceManagementFrame:: isValid () const

返回 true if the local device management frame is valid, returns false 否则。

QKnxDeviceManagementFrame::MessageCode QKnxDeviceManagementFrame:: messageCode () const

Returns the message code of this local device management frame.

另请参阅 setMessageCode ().

quint8 QKnxDeviceManagementFrame:: numberOfElements () const

Returns the number of elements for an array-structured property. A return value of 0 indicates a negative response.

另请参阅 setNumberOfElements () 和 isNegativeConfirmation ().

quint8 QKnxDeviceManagementFrame:: objectInstance () const

Returns the object instance if available; otherwise returns 0 .

另请参阅 setObjectInstance ().

QKnxInterfaceObjectType QKnxDeviceManagementFrame:: objectType () const

Returns the object type carried by the frame if available; otherwise returns QKnxInterfaceObjectType::Invalid.

另请参阅 setObjectType ().

QKnxInterfaceObjectProperty QKnxDeviceManagementFrame:: property () const

Returns the interface object property if available; otherwise returns QKnxInterfaceObjectProperty::Invalid.

另请参阅 setProperty ().

[static] QKnxDeviceManagementFrame::PropertyInfoBuilder QKnxDeviceManagementFrame:: propertyInfoBuilder ()

Returns an instance of a device management property info frame builder.

[static] QKnxDeviceManagementFrame::PropertyReadBuilder QKnxDeviceManagementFrame:: propertyReadBuilder ()

Returns an instance of a device management property read frame builder.

[static] QKnxDeviceManagementFrame::PropertyWriteBuilder QKnxDeviceManagementFrame:: propertyWriteBuilder ()

Returns an instance of a device management property write frame builder.

[static] QKnxDeviceManagementFrame::ResetBuilder QKnxDeviceManagementFrame:: resetBuilder ()

Returns an instance of a device management reset frame builder.

QKnxNetIpCemiServer::ReturnCode QKnxDeviceManagementFrame:: returnCode () const

Returns the code set by the cEMI server after a cEMI function property service request if the frame is a FunctionPropertyCommandConfirmation or FunctionPropertyStateReadConfirmation and is also not a negative confirmation. Otherwise returns NoError .

注意: A return code larger than NoError indicates the negative result of a function property command or function property state read execution.

另请参阅 setReturnCode (), data (),和 isNegativeConfirmation ().

QKnxByteArray QKnxDeviceManagementFrame:: serviceInformation () const

Returns the service information of the local device management frame as an array of bytes.

另请参阅 setServiceInformation ().

void QKnxDeviceManagementFrame:: setData (const QKnxByteArray & newData )

Sets the data field of the local device management frame to newData . No validation checks are done on the function argument.

另请参阅 data () 和 isValid ().

void QKnxDeviceManagementFrame:: setError ( QKnxNetIpCemiServer::Error error )

Sets the error code stored in the frame to error if the frame is a PropertyReadConfirmation or PropertyWriteConfirmation frame; does nothing otherwise.

另请参阅 error ().

void QKnxDeviceManagementFrame:: setMessageCode ( QKnxDeviceManagementFrame::MessageCode code )

Sets the message code of this local device management frame to code .

另请参阅 messageCode ().

void QKnxDeviceManagementFrame:: setNumberOfElements ( quint8 numOfElements )

Sets the number of elements for an array-structured property to numOfElements . A value of 0 is used to indicate a negative response.

注意: The range for the number of elements is from 0 to 15 .

另请参阅 numberOfElements ().

void QKnxDeviceManagementFrame:: setObjectInstance ( quint8 实例 )

Sets the object instance to 实例 if the argument is valid; does nothing otherwise.

注意: The range for the object instance is from 1 to 255 .

另请参阅 objectInstance ().

void QKnxDeviceManagementFrame:: setObjectType ( QKnxInterfaceObjectType type )

Sets the interface object type to type if the argument is a valid; otherwise does nothing.

另请参阅 objectType ().

void QKnxDeviceManagementFrame:: setProperty ( QKnxInterfaceObjectProperty pid )

Sets the interface object property identifier to pid if the argument is valid; otherwise does nothing.

另请参阅 property ().

void QKnxDeviceManagementFrame:: setReturnCode ( QKnxNetIpCemiServer::ReturnCode code )

Sets the return code stored in the frame to code if the frame is a FunctionPropertyCommandConfirmation or FunctionPropertyStateReadConfirmation frame; does nothing otherwise.

另请参阅 returnCode ().

void QKnxDeviceManagementFrame:: setServiceInformation (const QKnxByteArray & serviceInfo )

Sets the service information of the local device management frame to serviceInfo . No validation checks are done on the function argument.

另请参阅 serviceInformation () 和 isValid ().

void QKnxDeviceManagementFrame:: setStartIndex ( quint16 index )

Sets the start index within an array-structured property. The first element is placed at the index 1 . The array element 0 contains the current number of valid array elements.

注意: The range for the number of elements is from 0 to 4095 .

另请参阅 startIndex ().

quint16 QKnxDeviceManagementFrame:: size () const

Returns the number of bytes of the local device management frame.

quint16 QKnxDeviceManagementFrame:: startIndex () const

Returns the start index within an array-structured property if available; otherwise returns 0 .

另请参阅 setStartIndex ().

void QKnxDeviceManagementFrame:: swap ( QKnxDeviceManagementFrame & other )

交换 other 与此对象。此操作非常快且从不失败。

bool QKnxDeviceManagementFrame:: operator!= (const QKnxDeviceManagementFrame & other ) const

返回 true if this object and the given other 不相等;则返回 false .

bool QKnxDeviceManagementFrame:: operator== (const QKnxDeviceManagementFrame & other ) const

返回 true if this object and the given other 相等;否则返回 false .

相关非成员

QDebug operator<< ( QDebug debug , const QKnxDeviceManagementFrame & frame )

Writes the local device management frame frame debug stream.