QKnxDeviceManagementFrame Class
The QKnxDeviceManagementFrame class represents a cEMI frame dedicated to KNXnet/IP device management. More...
Header: | #include <QKnxDeviceManagementFrame> |
qmake: | QT += knx |
Public Types
class | Builder |
class | FunctionPropertyCommandBuilder |
class | FunctionPropertyStateReadBuilder |
class | PropertyInfoBuilder |
class | PropertyReadBuilder |
class | PropertyWriteBuilder |
class | ResetBuilder |
enum class | MessageCode { Unknown, PropertyReadRequest, PropertyReadConfirmation, PropertyWriteRequest, PropertyWriteConfirmation, …, ResetIndication } |
Public Functions
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 instance) |
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 |
Static Public Members
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() |
Related Non-Members
QDebug | operator<<(QDebug debug, const QKnxDeviceManagementFrame &frame) |
Detailed Description
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
andM_PropRead.con
) - Property write (
M_PropWrite.req
andM_PropWrite.con
) - Property info indication service (
M_PropInfo.ind
) - Function property command (
M_FuncPropCommand.req
andM_FuncPropCommand.con
) - Function property state read (
M_FuncPropStateRead.req
andM_FuncPropStateRead.con
) - Reset and restart service (
M_Reset.req
)
Application layer services are invoked by the transport layer frames request (.req), indication (.ind), and 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 code describing the service to use, QKnxDeviceManagementFrame::MessageCode.
- The type of the interface object holding the property to access, QKnxInterfaceObjectType.
- The instance of this interface object, because it is possible to have more than one realization of an interface object in a given device.
- The property of the interface object to access, QKnxInterfaceObjectProperty.
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:
See also Qt KNX Device Management Classes.
Member Type Documentation
enum class QKnxDeviceManagementFrame::MessageCode
This enum holds the message codes of a local device management frame.
Constant | Value | Description |
---|---|---|
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 . |
Member Function Documentation
QKnxDeviceManagementFrame::QKnxDeviceManagementFrame(QKnxDeviceManagementFrame &&other)
Move-constructs an object instance, making it point to the same object that other was pointing to.
QKnxDeviceManagementFrame::QKnxDeviceManagementFrame(const QKnxDeviceManagementFrame &other)
Constructs a copy of 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)
Move-assigns other to this object instance.
QKnxDeviceManagementFrame &QKnxDeviceManagementFrame::operator=(const QKnxDeviceManagementFrame &other)
Assigns the specified other to this object.
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.
See also 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
.
See also setError(), data(), and 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
Returns 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.
See also data(), error(), and returnCode().
bool QKnxDeviceManagementFrame::isNull() const
Returns 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
Returns true
if the local device management frame is valid, returns false
otherwise.
QKnxDeviceManagementFrame::MessageCode QKnxDeviceManagementFrame::messageCode() const
Returns the message code of this local device management frame.
See also setMessageCode().
quint8 QKnxDeviceManagementFrame::numberOfElements() const
Returns the number of elements for an array-structured property. A return value of 0
indicates a negative response.
See also setNumberOfElements() and isNegativeConfirmation().
quint8 QKnxDeviceManagementFrame::objectInstance() const
Returns the object instance if available; otherwise returns 0
.
See also setObjectInstance().
QKnxInterfaceObjectType QKnxDeviceManagementFrame::objectType() const
Returns the object type carried by the frame if available; otherwise returns QKnxInterfaceObjectType::Invalid.
See also setObjectType().
QKnxInterfaceObjectProperty QKnxDeviceManagementFrame::property() const
Returns the interface object property if available; otherwise returns QKnxInterfaceObjectProperty::Invalid.
See also 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
.
Note: A return code larger than NoError
indicates the negative result of a function property command or function property state read execution.
See also setReturnCode(), data(), and isNegativeConfirmation().
QKnxByteArray QKnxDeviceManagementFrame::serviceInformation() const
Returns the service information of the local device management frame as an array of bytes.
See also 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.
See also data() and 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.
See also error().
void QKnxDeviceManagementFrame::setMessageCode(QKnxDeviceManagementFrame::MessageCode code)
Sets the message code of this local device management frame to code.
See also 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.
Note: The range for the number of elements is from 0
to 15
.
See also numberOfElements().
void QKnxDeviceManagementFrame::setObjectInstance(quint8 instance)
Sets the object instance to instance if the argument is valid; does nothing otherwise.
Note: The range for the object instance is from 1
to 255
.
See also objectInstance().
void QKnxDeviceManagementFrame::setObjectType(QKnxInterfaceObjectType type)
Sets the interface object type to type if the argument is a valid; otherwise does nothing.
See also objectType().
void QKnxDeviceManagementFrame::setProperty(QKnxInterfaceObjectProperty pid)
Sets the interface object property identifier to pid if the argument is valid; otherwise does nothing.
See also 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.
See also 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.
See also serviceInformation() and 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.
Note: The range for the number of elements is from 0
to 4095
.
See also 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
.
See also setStartIndex().
void QKnxDeviceManagementFrame::swap(QKnxDeviceManagementFrame &other)
Swaps other with this object. This operation is very fast and never fails.
bool QKnxDeviceManagementFrame::operator!=(const QKnxDeviceManagementFrame &other) const
Returns true
if this object and the given other are not equal; otherwise returns false
.
bool QKnxDeviceManagementFrame::operator==(const QKnxDeviceManagementFrame &other) const
Returns true
if this object and the given other are equal; otherwise returns false
.
Related Non-Members
QDebug operator<<(QDebug debug, const QKnxDeviceManagementFrame &frame)
Writes the local device management frame frame to the debug stream.
© 2024 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.