diff options
author | Karsten Heimrich <karsten.heimrich@qt.io> | 2018-05-04 14:55:39 +0200 |
---|---|---|
committer | Karsten Heimrich <karsten.heimrich@qt.io> | 2018-05-07 20:49:16 +0000 |
commit | 1d0d1c97c06c4310f536bb1ed2e6c0fd90b7fc2f (patch) | |
tree | 2a4bf325fbe8571cfb50134f2396a53a0c50623c | |
parent | 603b1815b4a0d2a8aede7f49287015b0be20aa24 (diff) |
Fix wrong return code value, handling and documentation
Change-Id: I17432eb345dd3104b18f32ef8b643968c69371b8
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
-rw-r--r-- | src/knx/netip/qknxnetip.cpp | 6 | ||||
-rw-r--r-- | src/knx/netip/qknxnetip.h | 3 | ||||
-rw-r--r-- | src/knx/qknxdevicemanagementframe.cpp | 15 |
3 files changed, 14 insertions, 10 deletions
diff --git a/src/knx/netip/qknxnetip.cpp b/src/knx/netip/qknxnetip.cpp index 15d8d38..3ce85f3 100644 --- a/src/knx/netip/qknxnetip.cpp +++ b/src/knx/netip/qknxnetip.cpp @@ -512,11 +512,11 @@ bool QKnxNetIp::isCapability(Capability capability) This enum describes the possible error codes returned by the remote cEMI server after cEMI function properties service requests. + A return code larger than \c NoError indicates the negative result of the + function. + \value NoError The function was successfully executed. The return code indicates the positive result of the function. - \value Error The function was not successfully executed. The return code - indicates the negative result of the function. Can be any - number larger than \c NoError. */ /*! diff --git a/src/knx/netip/qknxnetip.h b/src/knx/netip/qknxnetip.h index b65e8a1..b806d2c 100644 --- a/src/knx/netip/qknxnetip.h +++ b/src/knx/netip/qknxnetip.h @@ -221,8 +221,7 @@ namespace QKnx enum class ReturnCode : quint8 { - NoError = 0x00, - Error = 0x01 + NoError = 0x00 }; Q_ENUM_NS(ReturnCode) diff --git a/src/knx/qknxdevicemanagementframe.cpp b/src/knx/qknxdevicemanagementframe.cpp index 4defe11..43f9df9 100644 --- a/src/knx/qknxdevicemanagementframe.cpp +++ b/src/knx/qknxdevicemanagementframe.cpp @@ -447,9 +447,13 @@ void QKnxDeviceManagementFrame::setError(QKnxNetIpCemiServer::Error error) /*! Returns the code set by the cEMI server after a cEMI function property service request if the frame is a \l FunctionPropertyCommandConfirmation - or \l FunctionPropertyStateReadConfirmation frame. + or \l FunctionPropertyStateReadConfirmation and is also not a negative + confirmation. Otherwise returns \c NoError. - In all other cases, the function returns the error code stored in the frame. + \note A return code larger than \c NoError indicates the negative result of + a function property command or function property state read execution. + + \sa data(), isNegativeConfirmation() */ QKnxNetIpCemiServer::ReturnCode QKnxDeviceManagementFrame::returnCode() const { @@ -461,12 +465,13 @@ QKnxNetIpCemiServer::ReturnCode QKnxDeviceManagementFrame::returnCode() const default: break; } - return QKnxNetIpCemiServer::ReturnCode::Error; + return QKnxNetIpCemiServer::ReturnCode::NoError; } /*! - Returns the \a code set by the cEMI server after a cEMI function property - service request. + Sets the return code stored in the frame to \a code if the frame is a + \l FunctionPropertyCommandConfirmation or + \l FunctionPropertyStateReadConfirmation frame; does nothing otherwise. */ void QKnxDeviceManagementFrame::setReturnCode(QKnxNetIpCemiServer::ReturnCode code) { |