[IM] Remove EmberAfStatus from src/app/clusters (#32055)
* Remove EmberAfStatus from src/app/clusters
* fix ci
* fix specs compliance
* remove using Status from headers
* fix comments
* Remove using Status from headers
* fix comments
* fix ci
* fix door lock
diff --git a/src/app/app-platform/ContentApp.cpp b/src/app/app-platform/ContentApp.cpp
index 5715614..3bc16e9 100644
--- a/src/app/app-platform/ContentApp.cpp
+++ b/src/app/app-platform/ContentApp.cpp
@@ -29,35 +29,37 @@
#include <lib/support/CodeUtils.h>
#include <lib/support/ZclString.h>
#include <platform/CHIPDeviceLayer.h>
+#include <protocols/interaction_model/StatusCode.h>
#if CHIP_DEVICE_CONFIG_APP_PLATFORM_ENABLED
using namespace chip;
using namespace chip::AppPlatform;
+using chip::Protocols::InteractionModel::Status;
+
namespace chip {
namespace AppPlatform {
#define ZCL_DESCRIPTOR_CLUSTER_REVISION (1u)
#define ZCL_APPLICATION_BASIC_CLUSTER_REVISION (1u)
-EmberAfStatus ContentApp::HandleReadAttribute(ClusterId clusterId, AttributeId attributeId, uint8_t * buffer,
- uint16_t maxReadLength)
+Status ContentApp::HandleReadAttribute(ClusterId clusterId, AttributeId attributeId, uint8_t * buffer, uint16_t maxReadLength)
{
ChipLogProgress(DeviceLayer,
"Read Attribute for endpoint " ChipLogFormatMEI " cluster " ChipLogFormatMEI " attribute " ChipLogFormatMEI,
ChipLogValueMEI(mEndpointId), ChipLogValueMEI(clusterId), ChipLogValueMEI(attributeId));
- return EMBER_ZCL_STATUS_FAILURE;
+ return Status::Failure;
}
-EmberAfStatus ContentApp::HandleWriteAttribute(ClusterId clusterId, AttributeId attributeId, uint8_t * buffer)
+Status ContentApp::HandleWriteAttribute(ClusterId clusterId, AttributeId attributeId, uint8_t * buffer)
{
ChipLogProgress(DeviceLayer,
"Read Attribute for endpoint " ChipLogFormatMEI " cluster " ChipLogFormatMEI " attribute " ChipLogFormatMEI,
ChipLogValueMEI(mEndpointId), ChipLogValueMEI(clusterId), ChipLogValueMEI(attributeId));
- return EMBER_ZCL_STATUS_FAILURE;
+ return Status::Failure;
}
} // namespace AppPlatform
diff --git a/src/app/app-platform/ContentApp.h b/src/app/app-platform/ContentApp.h
index 6fed23c..d3b7d1f 100644
--- a/src/app/app-platform/ContentApp.h
+++ b/src/app/app-platform/ContentApp.h
@@ -33,6 +33,7 @@
#include <app/clusters/media-playback-server/media-playback-delegate.h>
#include <app/clusters/target-navigator-server/target-navigator-delegate.h>
#include <app/util/attribute-storage.h>
+#include <protocols/interaction_model/StatusCode.h>
namespace chip {
namespace AppPlatform {
@@ -65,8 +66,9 @@
virtual MediaPlaybackDelegate * GetMediaPlaybackDelegate() = 0;
virtual TargetNavigatorDelegate * GetTargetNavigatorDelegate() = 0;
- EmberAfStatus HandleReadAttribute(ClusterId clusterId, AttributeId attributeId, uint8_t * buffer, uint16_t maxReadLength);
- EmberAfStatus HandleWriteAttribute(ClusterId clusterId, AttributeId attributeId, uint8_t * buffer);
+ Protocols::InteractionModel::Status HandleReadAttribute(ClusterId clusterId, AttributeId attributeId, uint8_t * buffer,
+ uint16_t maxReadLength);
+ Protocols::InteractionModel::Status HandleWriteAttribute(ClusterId clusterId, AttributeId attributeId, uint8_t * buffer);
protected:
EndpointId mEndpointId = 0;
diff --git a/src/app/app-platform/ContentAppPlatform.cpp b/src/app/app-platform/ContentAppPlatform.cpp
index bb4638c..abcaa98 100644
--- a/src/app/app-platform/ContentAppPlatform.cpp
+++ b/src/app/app-platform/ContentAppPlatform.cpp
@@ -32,6 +32,7 @@
#include <lib/support/CodeUtils.h>
#include <lib/support/ZclString.h>
#include <platform/CHIPDeviceLayer.h>
+#include <protocols/interaction_model/StatusCode.h>
#if CHIP_DEVICE_CONFIG_APP_PLATFORM_ENABLED
@@ -41,19 +42,20 @@
using namespace chip::Access;
using ApplicationStatusEnum = app::Clusters::ApplicationBasic::ApplicationStatusEnum;
using GetSetupPINResponseType = app::Clusters::AccountLogin::Commands::GetSetupPINResponse::Type;
+using chip::Protocols::InteractionModel::Status;
// Device Version for dynamic endpoints:
#define DEVICE_VERSION_DEFAULT 1
-EmberAfStatus emberAfExternalAttributeReadCallback(EndpointId endpoint, ClusterId clusterId,
- const EmberAfAttributeMetadata * attributeMetadata, uint8_t * buffer,
- uint16_t maxReadLength)
+Status emberAfExternalAttributeReadCallback(EndpointId endpoint, ClusterId clusterId,
+ const EmberAfAttributeMetadata * attributeMetadata, uint8_t * buffer,
+ uint16_t maxReadLength)
{
uint16_t endpointIndex = emberAfGetDynamicIndexFromEndpoint(endpoint);
ChipLogDetail(DeviceLayer, "emberAfExternalAttributeReadCallback endpoint %d ", endpointIndex);
- EmberAfStatus ret = EMBER_ZCL_STATUS_FAILURE;
+ Status ret = Status::Failure;
ContentApp * app = ContentAppPlatform::GetInstance().GetContentApp(endpoint);
if (app != nullptr)
@@ -68,14 +70,14 @@
return ret;
}
-EmberAfStatus emberAfExternalAttributeWriteCallback(EndpointId endpoint, ClusterId clusterId,
- const EmberAfAttributeMetadata * attributeMetadata, uint8_t * buffer)
+Status emberAfExternalAttributeWriteCallback(EndpointId endpoint, ClusterId clusterId,
+ const EmberAfAttributeMetadata * attributeMetadata, uint8_t * buffer)
{
uint16_t endpointIndex = emberAfGetDynamicIndexFromEndpoint(endpoint);
ChipLogDetail(DeviceLayer, "emberAfExternalAttributeWriteCallback endpoint %d ", endpointIndex);
- EmberAfStatus ret = EMBER_ZCL_STATUS_FAILURE;
+ Status ret = Status::Failure;
ContentApp * app = ContentAppPlatform::GetInstance().GetContentApp(endpoint);
if (app != nullptr)
@@ -93,18 +95,18 @@
namespace chip {
namespace AppPlatform {
-EmberAfStatus __attribute__((weak)) AppPlatformExternalAttributeReadCallback(EndpointId endpoint, ClusterId clusterId,
- const EmberAfAttributeMetadata * attributeMetadata,
- uint8_t * buffer, uint16_t maxReadLength)
+Status __attribute__((weak)) AppPlatformExternalAttributeReadCallback(EndpointId endpoint, ClusterId clusterId,
+ const EmberAfAttributeMetadata * attributeMetadata,
+ uint8_t * buffer, uint16_t maxReadLength)
{
- return (EMBER_ZCL_STATUS_FAILURE);
+ return (Status::Failure);
}
-EmberAfStatus __attribute__((weak))
+Status __attribute__((weak))
AppPlatformExternalAttributeWriteCallback(EndpointId endpoint, ClusterId clusterId,
const EmberAfAttributeMetadata * attributeMetadata, uint8_t * buffer)
{
- return (EMBER_ZCL_STATUS_FAILURE);
+ return (Status::Failure);
}
EndpointId ContentAppPlatform::AddContentApp(ContentApp * app, EmberAfEndpointType * ep,
diff --git a/src/app/app-platform/ContentAppPlatform.h b/src/app/app-platform/ContentAppPlatform.h
index 3dd0b13..16a47c2 100644
--- a/src/app/app-platform/ContentAppPlatform.h
+++ b/src/app/app-platform/ContentAppPlatform.h
@@ -27,6 +27,7 @@
#include <app/util/attribute-storage.h>
#include <controller/CHIPCluster.h>
#include <platform/CHIPDeviceLayer.h>
+#include <protocols/interaction_model/StatusCode.h>
#include <protocols/user_directed_commissioning/UserDirectedCommissioning.h>
using chip::app::Clusters::ApplicationBasic::CatalogVendorApp;
@@ -40,14 +41,15 @@
// The AppPlatform overrides emberAfExternalAttributeReadCallback to handle external attribute reads for ContentApps.
// This callback can be used to handle external attribute reads for attributes belonging to static endpoints.
-EmberAfStatus AppPlatformExternalAttributeReadCallback(EndpointId endpoint, ClusterId clusterId,
- const EmberAfAttributeMetadata * attributeMetadata, uint8_t * buffer,
- uint16_t maxReadLength);
+Protocols::InteractionModel::Status AppPlatformExternalAttributeReadCallback(EndpointId endpoint, ClusterId clusterId,
+ const EmberAfAttributeMetadata * attributeMetadata,
+ uint8_t * buffer, uint16_t maxReadLength);
// The AppPlatform overrides emberAfExternalAttributeWriteCallback to handle external attribute writes for ContentApps.
// This callback can be used to handle external attribute writes for attributes belonging to static endpoints.
-EmberAfStatus AppPlatformExternalAttributeWriteCallback(EndpointId endpoint, ClusterId clusterId,
- const EmberAfAttributeMetadata * attributeMetadata, uint8_t * buffer);
+Protocols::InteractionModel::Status AppPlatformExternalAttributeWriteCallback(EndpointId endpoint, ClusterId clusterId,
+ const EmberAfAttributeMetadata * attributeMetadata,
+ uint8_t * buffer);
inline constexpr EndpointId kTargetBindingClusterEndpointId = 0;
inline constexpr EndpointId kLocalVideoPlayerEndpointId = 1;
@@ -157,7 +159,7 @@
// loads given app and calls HandleGetSetupPasscode. Sets passcode to 0 if it cannot be obtained.
// return true if a matching app was found (and it granted this client access), even if a passcode was not obtained
bool HasTargetContentApp(uint16_t vendorId, uint16_t productId, CharSpan rotatingId,
- chip::Protocols::UserDirectedCommissioning::TargetAppInfo & info, uint32_t & passcode);
+ Protocols::UserDirectedCommissioning::TargetAppInfo & info, uint32_t & passcode);
/**
* @brief
diff --git a/src/app/clusters/account-login-server/account-login-server.cpp b/src/app/clusters/account-login-server/account-login-server.cpp
index aa939ae..684558e 100644
--- a/src/app/clusters/account-login-server/account-login-server.cpp
+++ b/src/app/clusters/account-login-server/account-login-server.cpp
@@ -34,6 +34,7 @@
#include <app/util/attribute-storage.h>
#include <app/util/config.h>
#include <platform/CHIPDeviceConfig.h>
+#include <protocols/interaction_model/StatusCode.h>
#if CHIP_DEVICE_CONFIG_APP_PLATFORM_ENABLED
#include <app/app-platform/ContentAppPlatform.h>
diff --git a/src/app/clusters/application-launcher-server/application-launcher-server.cpp b/src/app/clusters/application-launcher-server/application-launcher-server.cpp
index aa72d8a..18a30bb 100644
--- a/src/app/clusters/application-launcher-server/application-launcher-server.cpp
+++ b/src/app/clusters/application-launcher-server/application-launcher-server.cpp
@@ -116,8 +116,8 @@
bool hasFeature = false;
uint32_t featureMap = 0;
- EmberAfStatus status = Attributes::FeatureMap::Get(endpoint, &featureMap);
- if (EMBER_ZCL_STATUS_SUCCESS == status)
+ Status status = Attributes::FeatureMap::Get(endpoint, &featureMap);
+ if (Status::Success == status)
{
hasFeature = (featureMap & chip::to_underlying(feature));
}
diff --git a/src/app/clusters/audio-output-server/audio-output-server.cpp b/src/app/clusters/audio-output-server/audio-output-server.cpp
index f47fc52..297d1ea 100644
--- a/src/app/clusters/audio-output-server/audio-output-server.cpp
+++ b/src/app/clusters/audio-output-server/audio-output-server.cpp
@@ -92,8 +92,8 @@
bool hasFeature = false;
uint32_t featureMap = 0;
- EmberAfStatus status = Attributes::FeatureMap::Get(endpoint, &featureMap);
- if (EMBER_ZCL_STATUS_SUCCESS == status)
+ Status status = Attributes::FeatureMap::Get(endpoint, &featureMap);
+ if (Status::Success == status)
{
hasFeature = (featureMap & chip::to_underlying(feature));
}
diff --git a/src/app/clusters/barrier-control-server/barrier-control-server.cpp b/src/app/clusters/barrier-control-server/barrier-control-server.cpp
index e4e72ee..99bd062 100644
--- a/src/app/clusters/barrier-control-server/barrier-control-server.cpp
+++ b/src/app/clusters/barrier-control-server/barrier-control-server.cpp
@@ -102,29 +102,29 @@
uint8_t emAfPluginBarrierControlServerGetBarrierPosition(EndpointId endpoint)
{
uint8_t position;
- EmberAfStatus status = Attributes::BarrierPosition::Get(endpoint, &position);
- assert(status == EMBER_ZCL_STATUS_SUCCESS);
+ Status status = Attributes::BarrierPosition::Get(endpoint, &position);
+ assert(status == Status::Success);
return position;
}
void emAfPluginBarrierControlServerSetBarrierPosition(EndpointId endpoint, uint8_t position)
{
- EmberAfStatus status = Attributes::BarrierPosition::Set(endpoint, position);
- assert(status == EMBER_ZCL_STATUS_SUCCESS);
+ Status status = Attributes::BarrierPosition::Set(endpoint, position);
+ assert(status == Status::Success);
}
bool emAfPluginBarrierControlServerIsPartialBarrierSupported(EndpointId endpoint)
{
uint8_t bitmap;
- EmberAfStatus status = Attributes::BarrierCapabilities::Get(endpoint, &bitmap);
- assert(status == EMBER_ZCL_STATUS_SUCCESS);
+ Status status = Attributes::BarrierCapabilities::Get(endpoint, &bitmap);
+ assert(status == Status::Success);
return (bitmap & to_underlying(BarrierControlCapabilities::kPartialBarrier)) != 0;
}
static uint16_t getOpenOrClosePeriod(EndpointId endpoint, bool open)
{
- uint16_t period = 0;
- EmberAfStatus status = EMBER_ZCL_STATUS_SUCCESS;
+ uint16_t period = 0;
+ Status status = Status::Success;
#if defined(ZCL_USING_BARRIER_CONTROL_CLUSTER_BARRIER_OPEN_PERIOD_ATTRIBUTE)
if (open)
{
@@ -137,21 +137,21 @@
status = Attributes::BarrierClosePeriod::Get(endpoint, &period);
}
#endif
- assert(status == EMBER_ZCL_STATUS_SUCCESS);
+ assert(status == Status::Success);
return period;
}
static void setMovingState(EndpointId endpoint, uint8_t newState)
{
- EmberAfStatus status = Attributes::BarrierMovingState::Set(endpoint, newState);
- assert(status == EMBER_ZCL_STATUS_SUCCESS);
+ Status status = Attributes::BarrierMovingState::Set(endpoint, newState);
+ assert(status == Status::Success);
}
uint16_t emAfPluginBarrierControlServerGetSafetyStatus(EndpointId endpoint)
{
uint16_t safetyStatus;
- EmberAfStatus status = Attributes::BarrierSafetyStatus::Get(endpoint, &safetyStatus);
- assert(status == EMBER_ZCL_STATUS_SUCCESS);
+ Status status = Attributes::BarrierSafetyStatus::Get(endpoint, &safetyStatus);
+ assert(status == Status::Success);
return safetyStatus;
}
@@ -163,8 +163,8 @@
void emAfPluginBarrierControlServerIncrementEvents(EndpointId endpoint, bool open, bool command)
{
- EmberAfStatus status = EMBER_ZCL_STATUS_SUCCESS;
- uint16_t events = 0;
+ Status status = Status::Success;
+ uint16_t events = 0;
#if defined(ZCL_USING_BARRIER_CONTROL_CLUSTER_BARRIER_OPEN_EVENTS_ATTRIBUTE)
if (open && !command)
@@ -190,7 +190,7 @@
status = Attributes::BarrierCommandCloseEvents::Get(endpoint, &events);
}
#endif
- assert(status == EMBER_ZCL_STATUS_SUCCESS);
+ assert(status == Status::Success);
// Section 7.1.2.1.5-8 says that this events counter SHALL NOT roll over.
// The maximum 16-bit unsigned integer in Zigbee is 0xFFFE, so we have this
@@ -225,7 +225,7 @@
status = Attributes::BarrierCommandCloseEvents::Set(endpoint, events);
}
#endif
- assert(status == EMBER_ZCL_STATUS_SUCCESS);
+ assert(status == Status::Success);
}
// -----------------------------------------------------------------------------
diff --git a/src/app/clusters/basic-information/basic-information.cpp b/src/app/clusters/basic-information/basic-information.cpp
index f241bb2..641dc59 100644
--- a/src/app/clusters/basic-information/basic-information.cpp
+++ b/src/app/clusters/basic-information/basic-information.cpp
@@ -30,6 +30,7 @@
#include <platform/ConfigurationManager.h>
#include <platform/DeviceInstanceInfoProvider.h>
#include <platform/PlatformManager.h>
+#include <protocols/interaction_model/StatusCode.h>
#include <cstddef>
#include <cstring>
@@ -41,6 +42,7 @@
using namespace chip::app::Clusters::BasicInformation;
using namespace chip::app::Clusters::BasicInformation::Attributes;
using namespace chip::DeviceLayer;
+using chip::Protocols::InteractionModel::Status;
namespace {
@@ -463,9 +465,9 @@
namespace BasicInformation {
bool IsLocalConfigDisabled()
{
- bool disabled = false;
- EmberAfStatus status = LocalConfigDisabled::Get(0, &disabled);
- return status == EMBER_ZCL_STATUS_SUCCESS && disabled;
+ bool disabled = false;
+ Status status = LocalConfigDisabled::Get(0, &disabled);
+ return status == Status::Success && disabled;
}
} // namespace BasicInformation
} // namespace Clusters
diff --git a/src/app/clusters/color-control-server/color-control-server.cpp b/src/app/clusters/color-control-server/color-control-server.cpp
index 941f9d5..3e883cf 100644
--- a/src/app/clusters/color-control-server/color-control-server.cpp
+++ b/src/app/clusters/color-control-server/color-control-server.cpp
@@ -109,14 +109,14 @@
if (ColorControlServer::Instance().HasFeature(endpoint, ColorControlServer::Feature::kXy))
{
uint16_t xValue;
- if (EMBER_ZCL_STATUS_SUCCESS != Attributes::CurrentX::Get(endpoint, &xValue))
+ if (Status::Success != Attributes::CurrentX::Get(endpoint, &xValue))
{
xValue = 0x616B; // Default X value according to spec
}
AddAttributeValuePair(pairs, Attributes::CurrentX::Id, xValue, attributeCount);
uint16_t yValue;
- if (EMBER_ZCL_STATUS_SUCCESS != Attributes::CurrentY::Get(endpoint, &yValue))
+ if (Status::Success != Attributes::CurrentY::Get(endpoint, &yValue))
{
yValue = 0x607D; // Default Y value according to spec
}
@@ -133,7 +133,7 @@
if (ColorControlServer::Instance().HasFeature(endpoint, ColorControlServer::Feature::kHueAndSaturation))
{
uint8_t saturationValue;
- if (EMBER_ZCL_STATUS_SUCCESS != Attributes::CurrentSaturation::Get(endpoint, &saturationValue))
+ if (Status::Success != Attributes::CurrentSaturation::Get(endpoint, &saturationValue))
{
saturationValue = 0x00;
}
@@ -143,21 +143,21 @@
if (ColorControlServer::Instance().HasFeature(endpoint, ColorControlServer::Feature::kColorLoop))
{
uint8_t loopActiveValue;
- if (EMBER_ZCL_STATUS_SUCCESS != Attributes::ColorLoopActive::Get(endpoint, &loopActiveValue))
+ if (Status::Success != Attributes::ColorLoopActive::Get(endpoint, &loopActiveValue))
{
loopActiveValue = 0x00;
}
AddAttributeValuePair(pairs, Attributes::ColorLoopActive::Id, loopActiveValue, attributeCount);
uint8_t loopDirectionValue;
- if (EMBER_ZCL_STATUS_SUCCESS != Attributes::ColorLoopDirection::Get(endpoint, &loopDirectionValue))
+ if (Status::Success != Attributes::ColorLoopDirection::Get(endpoint, &loopDirectionValue))
{
loopDirectionValue = 0x00;
}
AddAttributeValuePair(pairs, Attributes::ColorLoopDirection::Id, loopDirectionValue, attributeCount);
uint16_t loopTimeValue;
- if (EMBER_ZCL_STATUS_SUCCESS != Attributes::ColorLoopTime::Get(endpoint, &loopTimeValue))
+ if (Status::Success != Attributes::ColorLoopTime::Get(endpoint, &loopTimeValue))
{
loopTimeValue = 0x0019; // Default loop time value according to spec
}
@@ -167,7 +167,7 @@
if (ColorControlServer::Instance().HasFeature(endpoint, ColorControlServer::Feature::kColorTemperature))
{
uint16_t temperatureValue;
- if (EMBER_ZCL_STATUS_SUCCESS != Attributes::ColorTemperatureMireds::Get(endpoint, &temperatureValue))
+ if (Status::Success != Attributes::ColorTemperatureMireds::Get(endpoint, &temperatureValue))
{
temperatureValue = 0x00FA; // Default temperature value according to spec
}
@@ -175,7 +175,7 @@
}
uint8_t modeValue;
- if (EMBER_ZCL_STATUS_SUCCESS != Attributes::EnhancedColorMode::Get(endpoint, &modeValue))
+ if (Status::Success != Attributes::EnhancedColorMode::Get(endpoint, &modeValue))
{
modeValue = ColorControl::EnhancedColorMode::kCurrentXAndCurrentY; // Default mode value according to spec
}
@@ -446,7 +446,7 @@
{
bool success;
uint32_t featureMap;
- success = (Attributes::FeatureMap::Get(endpoint, &featureMap) == EMBER_ZCL_STATUS_SUCCESS);
+ success = (Attributes::FeatureMap::Get(endpoint, &featureMap) == Status::Success);
return success ? ((featureMap & to_underlying(feature)) != 0) : false;
}
@@ -2509,11 +2509,11 @@
uint16_t ColorControlServer::getTemperatureCoupleToLevelMin(EndpointId endpoint)
{
uint16_t colorTemperatureCoupleToLevelMin;
- EmberAfStatus status;
+ Status status;
status = Attributes::CoupleColorTempToLevelMinMireds::Get(endpoint, &colorTemperatureCoupleToLevelMin);
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ if (status != Status::Success)
{
// Not less than the physical min.
Attributes::ColorTempPhysicalMinMireds::Get(endpoint, &colorTemperatureCoupleToLevelMin);
@@ -2552,14 +2552,14 @@
// Initialize startUpColorTempMireds to "maintain previous value" value null
app::DataModel::Nullable<uint16_t> startUpColorTemp;
- EmberAfStatus status = Attributes::StartUpColorTemperatureMireds::Get(endpoint, startUpColorTemp);
+ Status status = Attributes::StartUpColorTemperatureMireds::Get(endpoint, startUpColorTemp);
- if (status == EMBER_ZCL_STATUS_SUCCESS && !startUpColorTemp.IsNull())
+ if (status == Status::Success && !startUpColorTemp.IsNull())
{
uint16_t updatedColorTemp = MAX_TEMPERATURE_VALUE;
status = Attributes::ColorTemperatureMireds::Get(endpoint, &updatedColorTemp);
- if (status == EMBER_ZCL_STATUS_SUCCESS)
+ if (status == Status::Success)
{
uint16_t tempPhysicalMin = MIN_TEMPERATURE_VALUE;
Attributes::ColorTempPhysicalMinMireds::Get(endpoint, &tempPhysicalMin);
@@ -2576,7 +2576,7 @@
updatedColorTemp = startUpColorTemp.Value();
status = Attributes::ColorTemperatureMireds::Set(endpoint, updatedColorTemp);
- if (status == EMBER_ZCL_STATUS_SUCCESS)
+ if (status == Status::Success)
{
// Set ColorMode attributes to reflect ColorTemperature.
uint8_t updateColorMode = ColorControl::EnhancedColorMode::kColorTemperature;
@@ -2607,7 +2607,7 @@
// Check whether our color temperature has actually changed. If not, do
// nothing, and wait for it to change.
uint16_t currentColorTemp;
- if (Attributes::ColorTemperatureMireds::Get(endpoint, ¤tColorTemp) != EMBER_ZCL_STATUS_SUCCESS)
+ if (Attributes::ColorTemperatureMireds::Get(endpoint, ¤tColorTemp) != Status::Success)
{
// Why can't we read our attribute?
return;
@@ -2906,9 +2906,9 @@
if (colorMode == ColorControl::EnhancedColorMode::kColorTemperature)
{
app::DataModel::Nullable<uint8_t> currentLevel;
- EmberAfStatus status = LevelControl::Attributes::CurrentLevel::Get(endpoint, currentLevel);
+ Status status = LevelControl::Attributes::CurrentLevel::Get(endpoint, currentLevel);
- if (status != EMBER_ZCL_STATUS_SUCCESS || currentLevel.IsNull())
+ if (status != Status::Success || currentLevel.IsNull())
{
currentLevel.SetNonNull((uint8_t) 0x7F);
}
diff --git a/src/app/clusters/device-energy-management-server/device-energy-management-server.h b/src/app/clusters/device-energy-management-server/device-energy-management-server.h
index 3620379..7aeb06d 100644
--- a/src/app/clusters/device-energy-management-server/device-energy-management-server.h
+++ b/src/app/clusters/device-energy-management-server/device-energy-management-server.h
@@ -27,6 +27,7 @@
#include <app/reporting/reporting.h>
#include <app/util/attribute-storage.h>
#include <lib/core/CHIPError.h>
+#include <protocols/interaction_model/StatusCode.h>
namespace chip {
namespace app {
@@ -35,8 +36,6 @@
using namespace chip::app::Clusters::DeviceEnergyManagement::Attributes;
-using chip::Protocols::InteractionModel::Status;
-
class Delegate
{
public:
@@ -52,7 +51,8 @@
* @param duration The duration that the ESA SHALL maintain the requested power for.
* @return Success if the adjustment is accepted; otherwise the command SHALL be rejected with appropriate error.
*/
- virtual Status PowerAdjustRequest(const int64_t power, const uint32_t duration, AdjustmentCauseEnum cause) = 0;
+ virtual Protocols::InteractionModel::Status PowerAdjustRequest(const int64_t power, const uint32_t duration,
+ AdjustmentCauseEnum cause) = 0;
/**
* @brief Delegate SHALL make the ESA end the active power adjustment session & return to normal (or idle) power levels.
@@ -60,7 +60,7 @@
*
* @return It should report SUCCESS if successful and FAILURE otherwise.
*/
- virtual Status CancelPowerAdjustRequest() = 0;
+ virtual Protocols::InteractionModel::Status CancelPowerAdjustRequest() = 0;
/**
* @brief Delegate for the ESA SHALL update its Forecast attribute with the RequestedStartTime including a new ForecastId.
@@ -76,7 +76,8 @@
* @return Success if the StartTime in the Forecast is updated, otherwise the command SHALL be rejected with appropriate
* IM_Status.
*/
- virtual Status StartTimeAdjustRequest(const uint32_t requestedStartTime, AdjustmentCauseEnum cause) = 0;
+ virtual Protocols::InteractionModel::Status StartTimeAdjustRequest(const uint32_t requestedStartTime,
+ AdjustmentCauseEnum cause) = 0;
/**
* @brief Delegate handler for PauseRequest command
@@ -91,7 +92,7 @@
* @param duration Duration that the ESA SHALL be paused for.
* @return Success if the ESA is paused, otherwise returns other IM_Status.
*/
- virtual Status PauseRequest(const uint32_t duration, AdjustmentCauseEnum cause) = 0;
+ virtual Protocols::InteractionModel::Status PauseRequest(const uint32_t duration, AdjustmentCauseEnum cause) = 0;
/**
* @brief Delegate handler for ResumeRequest command
@@ -102,7 +103,7 @@
*
* @return Success if the ESA is resumed, otherwise returns other IM_Status.
*/
- virtual Status ResumeRequest() = 0;
+ virtual Protocols::InteractionModel::Status ResumeRequest() = 0;
/**
* @brief Delegate handler for ModifyForecastRequest
@@ -118,9 +119,10 @@
* @return Success if the entire list of SlotAdjustmentStruct are accepted, otherwise the command
* SHALL be rejected returning other IM_Status.
*/
- virtual Status ModifyForecastRequest(const uint32_t forecastId,
- const DataModel::DecodableList<Structs::SlotAdjustmentStruct::Type> & slotAdjustments,
- AdjustmentCauseEnum cause) = 0;
+ virtual Protocols::InteractionModel::Status
+ ModifyForecastRequest(const uint32_t forecastId,
+ const DataModel::DecodableList<Structs::SlotAdjustmentStruct::Type> & slotAdjustments,
+ AdjustmentCauseEnum cause) = 0;
/**
* @brief Delegate handler for RequestConstraintBasedForecast
@@ -133,8 +135,9 @@
* @param constraints Sequence of turn up/down power requests that the ESA is being asked to constrain its operation within.
* @return Success if successful, otherwise the command SHALL be rejected returning other IM_Status.
*/
- virtual Status RequestConstraintBasedForecast(const DataModel::DecodableList<Structs::ConstraintsStruct::Type> & constraints,
- AdjustmentCauseEnum cause) = 0;
+ virtual Protocols::InteractionModel::Status
+ RequestConstraintBasedForecast(const DataModel::DecodableList<Structs::ConstraintsStruct::Type> & constraints,
+ AdjustmentCauseEnum cause) = 0;
/**
* @brief Delegate handler for CancelRequest
@@ -153,7 +156,7 @@
*
* @return Success if successful, otherwise the command SHALL be rejected returning other IM_Status.
*/
- virtual Status CancelRequest() = 0;
+ virtual Protocols::InteractionModel::Status CancelRequest() = 0;
// ------------------------------------------------------------------
// Get attribute methods
@@ -210,7 +213,7 @@
void InvokeCommand(HandlerContext & handlerContext) override;
CHIP_ERROR EnumerateAcceptedCommands(const ConcreteClusterPath & cluster, CommandIdCallback callback, void * context) override;
- Status CheckOptOutAllowsRequest(AdjustmentCauseEnum adjustmentCause);
+ Protocols::InteractionModel::Status CheckOptOutAllowsRequest(AdjustmentCauseEnum adjustmentCause);
void HandlePowerAdjustRequest(HandlerContext & ctx, const Commands::PowerAdjustRequest::DecodableType & commandData);
void HandleCancelPowerAdjustRequest(HandlerContext & ctx,
const Commands::CancelPowerAdjustRequest::DecodableType & commandData);
diff --git a/src/app/clusters/dishwasher-alarm-server/dishwasher-alarm-server.cpp b/src/app/clusters/dishwasher-alarm-server/dishwasher-alarm-server.cpp
index 73a626e..dbf3ee3 100644
--- a/src/app/clusters/dishwasher-alarm-server/dishwasher-alarm-server.cpp
+++ b/src/app/clusters/dishwasher-alarm-server/dishwasher-alarm-server.cpp
@@ -76,18 +76,18 @@
return instance;
}
-EmberAfStatus DishwasherAlarmServer::GetMaskValue(EndpointId endpoint, BitMask<AlarmMap> * mask)
+Status DishwasherAlarmServer::GetMaskValue(EndpointId endpoint, BitMask<AlarmMap> * mask)
{
- EmberAfStatus status = Attributes::Mask::Get(endpoint, mask);
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ Status status = Attributes::Mask::Get(endpoint, mask);
+ if (status != Status::Success)
{
- ChipLogProgress(Zcl, "Dishwasher Alarm: ERR: reading mask, err:0x%x", status);
+ ChipLogProgress(Zcl, "Dishwasher Alarm: ERR: reading mask, err:0x%x", to_underlying(status));
return status;
}
return status;
}
-EmberAfStatus DishwasherAlarmServer::GetLatchValue(EndpointId endpoint, BitMask<AlarmMap> * latch)
+Status DishwasherAlarmServer::GetLatchValue(EndpointId endpoint, BitMask<AlarmMap> * latch)
{
if (!HasResetFeature(endpoint))
{
@@ -95,48 +95,48 @@
return EMBER_ZCL_STATUS_UNSUPPORTED_ATTRIBUTE;
}
- EmberAfStatus status = Attributes::Latch::Get(endpoint, latch);
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ Status status = Attributes::Latch::Get(endpoint, latch);
+ if (status != Status::Success)
{
- ChipLogProgress(Zcl, "Dishwasher Alarm: ERR: reading latch, err:0x%x", status);
+ ChipLogProgress(Zcl, "Dishwasher Alarm: ERR: reading latch, err:0x%x", to_underlying(status));
return status;
}
return status;
}
-EmberAfStatus DishwasherAlarmServer::GetStateValue(EndpointId endpoint, BitMask<AlarmMap> * state)
+Status DishwasherAlarmServer::GetStateValue(EndpointId endpoint, BitMask<AlarmMap> * state)
{
- EmberAfStatus status = Attributes::State::Get(endpoint, state);
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ Status status = Attributes::State::Get(endpoint, state);
+ if (status != Status::Success)
{
- ChipLogProgress(Zcl, "Dishwasher Alarm: ERR: get state, err:0x%x", status);
+ ChipLogProgress(Zcl, "Dishwasher Alarm: ERR: get state, err:0x%x", to_underlying(status));
return status;
}
return status;
}
-EmberAfStatus DishwasherAlarmServer::GetSupportedValue(EndpointId endpoint, BitMask<AlarmMap> * supported)
+Status DishwasherAlarmServer::GetSupportedValue(EndpointId endpoint, BitMask<AlarmMap> * supported)
{
- EmberAfStatus status = Attributes::Supported::Get(endpoint, supported);
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ Status status = Attributes::Supported::Get(endpoint, supported);
+ if (status != Status::Success)
{
- ChipLogProgress(Zcl, "Dishwasher Alarm: ERR: reading supported, err:0x%x", status);
+ ChipLogProgress(Zcl, "Dishwasher Alarm: ERR: reading supported, err:0x%x", to_underlying(status));
}
return status;
}
-EmberAfStatus DishwasherAlarmServer::SetSupportedValue(EndpointId endpoint, const BitMask<AlarmMap> supported)
+Status DishwasherAlarmServer::SetSupportedValue(EndpointId endpoint, const BitMask<AlarmMap> supported)
{
- EmberAfStatus status = EMBER_ZCL_STATUS_SUCCESS;
+ Status status = Status::Success;
;
- if ((status = Attributes::Supported::Set(endpoint, supported)) != EMBER_ZCL_STATUS_SUCCESS)
+ if ((status = Attributes::Supported::Set(endpoint, supported)) != Status::Success)
{
- ChipLogProgress(Zcl, "Dishwasher Alarm: ERR: writing supported, err:0x%x", status);
+ ChipLogProgress(Zcl, "Dishwasher Alarm: ERR: writing supported, err:0x%x", to_underlying(status));
return status;
}
// Whenever there is change in Supported attribute, Latch should change accordingly (if possible).
BitMask<AlarmMap> latch;
- if (GetLatchValue(endpoint, &latch) == EMBER_ZCL_STATUS_SUCCESS && !supported.HasAll(latch))
+ if (GetLatchValue(endpoint, &latch) == Status::Success && !supported.HasAll(latch))
{
latch = latch & supported;
status = SetLatchValue(endpoint, latch);
@@ -144,7 +144,7 @@
// Whenever there is change in Supported attribute, Mask, State should change accordingly.
BitMask<AlarmMap> mask;
- if ((status = GetMaskValue(endpoint, &mask)) != EMBER_ZCL_STATUS_SUCCESS)
+ if ((status = GetMaskValue(endpoint, &mask)) != Status::Success)
{
return status;
}
@@ -157,7 +157,7 @@
return status;
}
-EmberAfStatus DishwasherAlarmServer::SetMaskValue(EndpointId endpoint, const BitMask<AlarmMap> mask)
+Status DishwasherAlarmServer::SetMaskValue(EndpointId endpoint, const BitMask<AlarmMap> mask)
{
BitMask<AlarmMap> supported;
if (GetSupportedValue(endpoint, &supported) || !supported.HasAll(mask))
@@ -166,17 +166,17 @@
return EMBER_ZCL_STATUS_FAILURE;
}
- EmberAfStatus status = EMBER_ZCL_STATUS_SUCCESS;
- if ((status = Attributes::Mask::Set(endpoint, mask)) != EMBER_ZCL_STATUS_SUCCESS)
+ Status status = Status::Success;
+ if ((status = Attributes::Mask::Set(endpoint, mask)) != Status::Success)
{
- ChipLogProgress(Zcl, "Dishwasher Alarm: ERR: writing mask, err:0x%x", status);
+ ChipLogProgress(Zcl, "Dishwasher Alarm: ERR: writing mask, err:0x%x", to_underlying(status));
return status;
}
// Whenever there is change in Mask, State should change accordingly.
BitMask<AlarmMap> state;
status = GetStateValue(endpoint, &state);
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ if (status != Status::Success)
{
return status;
}
@@ -189,7 +189,7 @@
return status;
}
-EmberAfStatus DishwasherAlarmServer::SetLatchValue(EndpointId endpoint, const BitMask<AlarmMap> latch)
+Status DishwasherAlarmServer::SetLatchValue(EndpointId endpoint, const BitMask<AlarmMap> latch)
{
if (!HasResetFeature(endpoint))
{
@@ -204,17 +204,17 @@
return EMBER_ZCL_STATUS_FAILURE;
}
- EmberAfStatus status = Attributes::Latch::Set(endpoint, latch);
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ Status status = Attributes::Latch::Set(endpoint, latch);
+ if (status != Status::Success)
{
- ChipLogProgress(Zcl, "Dishwasher Alarm: ERR: writing latch, err:0x%x", status);
+ ChipLogProgress(Zcl, "Dishwasher Alarm: ERR: writing latch, err:0x%x", to_underlying(status));
return status;
}
return status;
}
-EmberAfStatus DishwasherAlarmServer::SetStateValue(EndpointId endpoint, const BitMask<AlarmMap> newState, bool ignoreLatchState)
+Status DishwasherAlarmServer::SetStateValue(EndpointId endpoint, const BitMask<AlarmMap> newState, bool ignoreLatchState)
{
BitMask<AlarmMap> supported;
BitMask<AlarmMap> finalNewState;
@@ -233,17 +233,17 @@
return EMBER_ZCL_STATUS_FAILURE;
}
- EmberAfStatus status = EMBER_ZCL_STATUS_SUCCESS;
+ Status status = Status::Success;
BitMask<AlarmMap> currentState;
status = Attributes::State::Get(endpoint, ¤tState);
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ if (status != Status::Success)
{
- ChipLogProgress(Zcl, "Dishwasher Alarm: ERR: reading state, err:0x%x", status);
+ ChipLogProgress(Zcl, "Dishwasher Alarm: ERR: reading state, err:0x%x", to_underlying(status));
return status;
}
BitMask<AlarmMap> latch;
- if (!ignoreLatchState && (GetLatchValue(endpoint, &latch) == EMBER_ZCL_STATUS_SUCCESS))
+ if (!ignoreLatchState && (GetLatchValue(endpoint, &latch) == Status::Success))
{
// Restore bits that have their Latch bit set.
auto bitsToKeep = latch & currentState;
@@ -252,9 +252,9 @@
// Store the new value of the State attribute.
status = Attributes::State::Set(endpoint, finalNewState);
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ if (status != Status::Success)
{
- ChipLogProgress(Zcl, "Dishwasher Alarm: ERR: writing state, err:0x%x", status);
+ ChipLogProgress(Zcl, "Dishwasher Alarm: ERR: writing state, err:0x%x", to_underlying(status));
return status;
}
@@ -268,7 +268,7 @@
return status;
}
-EmberAfStatus DishwasherAlarmServer::ResetLatchedAlarms(EndpointId endpoint, const BitMask<AlarmMap> alarms)
+Status DishwasherAlarmServer::ResetLatchedAlarms(EndpointId endpoint, const BitMask<AlarmMap> alarms)
{
BitMask<AlarmMap> supported;
if (GetSupportedValue(endpoint, &supported) || !supported.HasAll(alarms))
@@ -278,7 +278,7 @@
}
BitMask<AlarmMap> state;
- if (GetStateValue(endpoint, &state) != EMBER_ZCL_STATUS_SUCCESS)
+ if (GetStateValue(endpoint, &state) != Status::Success)
{
return EMBER_ZCL_STATUS_FAILURE;
}
@@ -290,7 +290,7 @@
bool DishwasherAlarmServer::HasResetFeature(EndpointId endpoint)
{
uint32_t featureMap = 0;
- if (Attributes::FeatureMap::Get(endpoint, &featureMap) != EMBER_ZCL_STATUS_SUCCESS)
+ if (Attributes::FeatureMap::Get(endpoint, &featureMap) != Status::Success)
{
return false;
}
@@ -319,7 +319,7 @@
EndpointId endpoint = commandPath.mEndpointId;
BitMask<AlarmMap> supported;
- if (DishwasherAlarmServer::Instance().GetSupportedValue(endpoint, &supported) != EMBER_ZCL_STATUS_SUCCESS)
+ if (DishwasherAlarmServer::Instance().GetSupportedValue(endpoint, &supported) != Status::Success)
{
return Status::Failure;
}
@@ -340,7 +340,7 @@
return Status::Failure;
}
// The cluster will do this update if delegate.ModifyEnabledAlarmsCallback() returns true.
- if (DishwasherAlarmServer::Instance().SetMaskValue(endpoint, mask) != EMBER_ZCL_STATUS_SUCCESS)
+ if (DishwasherAlarmServer::Instance().SetMaskValue(endpoint, mask) != Status::Success)
{
return Status::Failure;
}
@@ -366,7 +366,7 @@
}
// The cluster will do this update if delegate.ResetAlarmsCallback() returns true.
- if (DishwasherAlarmServer::Instance().ResetLatchedAlarms(endpoint, alarms) != EMBER_ZCL_STATUS_SUCCESS)
+ if (DishwasherAlarmServer::Instance().ResetLatchedAlarms(endpoint, alarms) != Status::Success)
{
ChipLogProgress(Zcl, "reset alarms fail");
return Status::Failure;
diff --git a/src/app/clusters/dishwasher-alarm-server/dishwasher-alarm-server.h b/src/app/clusters/dishwasher-alarm-server/dishwasher-alarm-server.h
index d03662f..5aff983 100644
--- a/src/app/clusters/dishwasher-alarm-server/dishwasher-alarm-server.h
+++ b/src/app/clusters/dishwasher-alarm-server/dishwasher-alarm-server.h
@@ -24,6 +24,7 @@
#include <app/util/af-types.h>
#include <app/util/basic-types.h>
#include <platform/CHIPDeviceConfig.h>
+#include <protocols/interaction_model/StatusCode.h>
namespace chip {
namespace app {
@@ -35,16 +36,16 @@
public:
static DishwasherAlarmServer & Instance();
- EmberAfStatus GetMaskValue(EndpointId endpoint, BitMask<AlarmMap> * mask);
- EmberAfStatus GetStateValue(EndpointId endpoint, BitMask<AlarmMap> * state);
- EmberAfStatus GetLatchValue(EndpointId endpoint, BitMask<AlarmMap> * latch);
- EmberAfStatus GetSupportedValue(EndpointId endpoint, BitMask<AlarmMap> * suppported);
+ Protocols::InteractionModel::Status GetMaskValue(EndpointId endpoint, BitMask<AlarmMap> * mask);
+ Protocols::InteractionModel::Status GetStateValue(EndpointId endpoint, BitMask<AlarmMap> * state);
+ Protocols::InteractionModel::Status GetLatchValue(EndpointId endpoint, BitMask<AlarmMap> * latch);
+ Protocols::InteractionModel::Status GetSupportedValue(EndpointId endpoint, BitMask<AlarmMap> * suppported);
// Whenever there is change on Mask we should change State accordingly.
- EmberAfStatus SetMaskValue(EndpointId endpoint, const BitMask<AlarmMap> mask);
- EmberAfStatus SetLatchValue(EndpointId endpoint, const BitMask<AlarmMap> latch);
+ Protocols::InteractionModel::Status SetMaskValue(EndpointId endpoint, const BitMask<AlarmMap> mask);
+ Protocols::InteractionModel::Status SetLatchValue(EndpointId endpoint, const BitMask<AlarmMap> latch);
// A change in supported value will result in a corresponding change in mask and state.
- EmberAfStatus SetSupportedValue(EndpointId endpoint, const BitMask<AlarmMap> supported);
+ Protocols::InteractionModel::Status SetSupportedValue(EndpointId endpoint, const BitMask<AlarmMap> supported);
/**
* @brief Set the value of the State attribute
@@ -60,7 +61,8 @@
* honoring the Mask and Supported attributes.
* The default value for the ignoreLatchState parameter is false.
*/
- EmberAfStatus SetStateValue(EndpointId endpoint, const BitMask<AlarmMap> newState, bool ignoreLatchState = false);
+ Protocols::InteractionModel::Status SetStateValue(EndpointId endpoint, const BitMask<AlarmMap> newState,
+ bool ignoreLatchState = false);
/**
* @brief Reset the value of latched alarms in the State attribute.
@@ -69,7 +71,7 @@
* @param[in] alarms Each bit set to a 1 in this parameter corresponds to a bit in the
* State attribute will SHALL be reset to false.
*/
- EmberAfStatus ResetLatchedAlarms(EndpointId endpoint, const BitMask<AlarmMap> alarms);
+ Protocols::InteractionModel::Status ResetLatchedAlarms(EndpointId endpoint, const BitMask<AlarmMap> alarms);
// check whether the Alarm featureMap has enabled Reset feature.
bool HasResetFeature(EndpointId endpoint);
diff --git a/src/app/clusters/door-lock-server/door-lock-server.cpp b/src/app/clusters/door-lock-server/door-lock-server.cpp
index 8f1037a..7f1a991 100644
--- a/src/app/clusters/door-lock-server/door-lock-server.cpp
+++ b/src/app/clusters/door-lock-server/door-lock-server.cpp
@@ -466,7 +466,7 @@
return;
}
- EmberAfStatus status = EMBER_ZCL_STATUS_SUCCESS;
+ Status status = Status::Success;
switch (operationType)
{
case DataOperationTypeEnum::kAdd:
@@ -481,7 +481,7 @@
default:
// appclusters, 5.2.4.34: SetUser command allow only kAdd/kModify, we should respond with INVALID_COMMAND if we got kClear
// or anything else
- status = EMBER_ZCL_STATUS_INVALID_COMMAND;
+ status = Status::InvalidCommand;
ChipLogProgress(Zcl, "[SetUser] Invalid operation type [endpointId=%d,operationType=%u]", commandPath.mEndpointId,
to_underlying(operationType));
break;
@@ -1873,25 +1873,26 @@
return false;
}
-EmberAfStatus DoorLockServer::createUser(chip::EndpointId endpointId, chip::FabricIndex creatorFabricIdx, chip::NodeId sourceNodeId,
- uint16_t userIndex, const Nullable<chip::CharSpan> & userName,
- const Nullable<uint32_t> & userUniqueId, const Nullable<UserStatusEnum> & userStatus,
- const Nullable<UserTypeEnum> & userType,
- const Nullable<CredentialRuleEnum> & credentialRule,
- const Nullable<CredentialStruct> & credential)
+Status DoorLockServer::createUser(chip::EndpointId endpointId, chip::FabricIndex creatorFabricIdx, chip::NodeId sourceNodeId,
+ uint16_t userIndex, const Nullable<chip::CharSpan> & userName,
+ const Nullable<uint32_t> & userUniqueId, const Nullable<UserStatusEnum> & userStatus,
+ const Nullable<UserTypeEnum> & userType, const Nullable<CredentialRuleEnum> & credentialRule,
+ const Nullable<CredentialStruct> & credential)
{
EmberAfPluginDoorLockUserInfo user;
if (!emberAfPluginDoorLockGetUser(endpointId, userIndex, user))
{
ChipLogError(Zcl, "[createUser] Unable to get the user from app [endpointId=%d,userIndex=%d]", endpointId, userIndex);
- return EMBER_ZCL_STATUS_FAILURE;
+ return Status::Failure;
}
// appclusters, 5.2.4.34: to modify user its status should be set to Available. If it is we should return OCCUPIED.
if (UserStatusEnum::kAvailable != user.userStatus)
{
ChipLogProgress(Zcl, "[createUser] Unable to overwrite existing user [endpointId=%d,userIndex=%d]", endpointId, userIndex);
- return static_cast<EmberAfStatus>(DlStatus::kOccupied);
+ // TODO FixMe https://github.com/project-chip/connectedhomeip/issues/32100
+ return static_cast<Status>(DlStatus::kOccupied);
+ ;
}
const auto & newUserName = !userName.IsNull() ? userName.Value() : ""_span;
@@ -1917,7 +1918,7 @@
endpointId, creatorFabricIdx, userIndex, static_cast<int>(newUserName.size()), newUserName.data(),
newUserUniqueId, to_underlying(newUserStatus), to_underlying(newUserType), to_underlying(newCredentialRule),
static_cast<unsigned int>(newTotalCredentials));
- return EMBER_ZCL_STATUS_FAILURE;
+ return Status::Failure;
}
ChipLogProgress(Zcl,
@@ -1934,25 +1935,24 @@
return EMBER_ZCL_STATUS_SUCCESS;
}
-EmberAfStatus DoorLockServer::modifyUser(chip::EndpointId endpointId, chip::FabricIndex modifierFabricIndex,
- chip::NodeId sourceNodeId, uint16_t userIndex, const Nullable<chip::CharSpan> & userName,
- const Nullable<uint32_t> & userUniqueId, const Nullable<UserStatusEnum> & userStatus,
- const Nullable<UserTypeEnum> & userType,
- const Nullable<CredentialRuleEnum> & credentialRule)
+Status DoorLockServer::modifyUser(chip::EndpointId endpointId, chip::FabricIndex modifierFabricIndex, chip::NodeId sourceNodeId,
+ uint16_t userIndex, const Nullable<chip::CharSpan> & userName,
+ const Nullable<uint32_t> & userUniqueId, const Nullable<UserStatusEnum> & userStatus,
+ const Nullable<UserTypeEnum> & userType, const Nullable<CredentialRuleEnum> & credentialRule)
{
// We should get the user by that index first
EmberAfPluginDoorLockUserInfo user;
if (!emberAfPluginDoorLockGetUser(endpointId, userIndex, user))
{
ChipLogError(Zcl, "[modifyUser] Unable to get the user from app [endpointId=%d,userIndex=%d]", endpointId, userIndex);
- return EMBER_ZCL_STATUS_FAILURE;
+ return Status::Failure;
}
// appclusters, 5.2.4.34: to modify user its status should NOT be set to Available. If it is we should return INVALID_COMMAND.
if (UserStatusEnum::kAvailable == user.userStatus)
{
ChipLogProgress(Zcl, "[modifyUser] Unable to modify non-existing user [endpointId=%d,userIndex=%d]", endpointId, userIndex);
- return EMBER_ZCL_STATUS_INVALID_COMMAND;
+ return Status::InvalidCommand;
}
// appclusters, 5.2.4.34: UserName SHALL be null if modifying a user record that was not created by the accessing fabric
@@ -1962,7 +1962,7 @@
"[modifyUser] Unable to modify name of user created by different fabric "
"[endpointId=%d,userIndex=%d,creatorIdx=%d,modifierIdx=%d]",
endpointId, userIndex, user.createdBy, modifierFabricIndex);
- return EMBER_ZCL_STATUS_INVALID_COMMAND;
+ return Status::InvalidCommand;
}
// appclusters, 5.2.4.34: UserUniqueID SHALL be null if modifying the user record that was not created by the accessing fabric.
@@ -1972,7 +1972,7 @@
"[modifyUser] Unable to modify UUID of user created by different fabric "
"[endpointId=%d,userIndex=%d,creatorIdx=%d,modifierIdx=%d]",
endpointId, userIndex, user.createdBy, modifierFabricIndex);
- return EMBER_ZCL_STATUS_INVALID_COMMAND;
+ return Status::InvalidCommand;
}
const auto & newUserName = !userName.IsNull() ? userName.Value() : user.userName;
@@ -1991,7 +1991,7 @@
",userType=%u,credentialRule=%u]",
endpointId, modifierFabricIndex, userIndex, static_cast<int>(newUserName.size()), newUserName.data(),
newUserUniqueId, to_underlying(newUserStatus), to_underlying(newUserType), to_underlying(newCredentialRule));
- return EMBER_ZCL_STATUS_FAILURE;
+ return Status::Failure;
}
ChipLogProgress(Zcl,
@@ -2004,7 +2004,7 @@
sendRemoteLockUserChange(endpointId, LockDataTypeEnum::kUserIndex, DataOperationTypeEnum::kModify, sourceNodeId,
modifierFabricIndex, userIndex, userIndex);
- return EMBER_ZCL_STATUS_SUCCESS;
+ return Status::Success;
}
Status DoorLockServer::clearUser(chip::EndpointId endpointId, chip::FabricIndex modifierFabricId, chip::NodeId sourceNodeId,
@@ -3406,7 +3406,7 @@
}
void DoorLockServer::sendClusterResponse(chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath,
- EmberAfStatus status)
+ Status status)
{
VerifyOrDie(nullptr != commandObj);
@@ -3627,10 +3627,10 @@
template <typename T>
bool DoorLockServer::GetAttribute(chip::EndpointId endpointId, chip::AttributeId attributeId,
- EmberAfStatus (*getFn)(chip::EndpointId endpointId, T * value), T & value) const
+ Status (*getFn)(chip::EndpointId endpointId, T * value), T & value) const
{
- EmberAfStatus status = getFn(endpointId, &value);
- bool success = (EMBER_ZCL_STATUS_SUCCESS == status);
+ Status status = getFn(endpointId, &value);
+ bool success = (Status::Success == status);
if (!success)
{
@@ -3642,10 +3642,10 @@
template <typename T>
bool DoorLockServer::SetAttribute(chip::EndpointId endpointId, chip::AttributeId attributeId,
- EmberAfStatus (*setFn)(chip::EndpointId endpointId, T value), T value)
+ Status (*setFn)(chip::EndpointId endpointId, T value), T value)
{
- EmberAfStatus status = setFn(endpointId, value);
- bool success = (EMBER_ZCL_STATUS_SUCCESS == status);
+ Status status = setFn(endpointId, value);
+ bool success = (Status::Success == status);
if (!success)
{
@@ -3951,11 +3951,11 @@
return;
}
- EmberAfStatus status = EMBER_ZCL_STATUS_SUCCESS;
+ Status status = Status::Success;
if (!emberAfPluginDoorLockSetAliroReaderConfig(endpointID, signingKey, verificationKey, groupIdentifier, groupResolvingKey))
{
ChipLogProgress(Zcl, "[SetAliroReaderConfig] Unable to set aliro reader config [endpointId=%d]", endpointID);
- status = EMBER_ZCL_STATUS_FAILURE;
+ status = Status::Failure;
}
sendClusterResponse(commandObj, commandPath, status);
}
@@ -3973,11 +3973,11 @@
return;
}
- EmberAfStatus status = EMBER_ZCL_STATUS_SUCCESS;
+ Status status = Status::Success;
if (!emberAfPluginDoorLockClearAliroReaderConfig(endpointID))
{
ChipLogProgress(Zcl, "[SetAliroReaderConfig] Unable to set aliro reader config [endpointId=%d]", endpointID);
- status = EMBER_ZCL_STATUS_FAILURE;
+ status = Status::Failure;
}
sendClusterResponse(commandObj, commandPath, status);
}
diff --git a/src/app/clusters/door-lock-server/door-lock-server.h b/src/app/clusters/door-lock-server/door-lock-server.h
index 9b1a7f6..dd11ebd 100644
--- a/src/app/clusters/door-lock-server/door-lock-server.h
+++ b/src/app/clusters/door-lock-server/door-lock-server.h
@@ -307,15 +307,17 @@
bool findUserIndexByCredential(chip::EndpointId endpointId, CredentialTypeEnum credentialType, chip::ByteSpan credentialData,
uint16_t & userIndex, uint16_t & credentialIndex, EmberAfPluginDoorLockUserInfo & userInfo);
- EmberAfStatus createUser(chip::EndpointId endpointId, chip::FabricIndex creatorFabricIdx, chip::NodeId sourceNodeId,
- uint16_t userIndex, const Nullable<chip::CharSpan> & userName, const Nullable<uint32_t> & userUniqueId,
- const Nullable<UserStatusEnum> & userStatus, const Nullable<UserTypeEnum> & userType,
- const Nullable<CredentialRuleEnum> & credentialRule,
- const Nullable<CredentialStruct> & credential = Nullable<CredentialStruct>());
- EmberAfStatus modifyUser(chip::EndpointId endpointId, chip::FabricIndex modifierFabricIndex, chip::NodeId sourceNodeId,
- uint16_t userIndex, const Nullable<chip::CharSpan> & userName, const Nullable<uint32_t> & userUniqueId,
- const Nullable<UserStatusEnum> & userStatus, const Nullable<UserTypeEnum> & userType,
- const Nullable<CredentialRuleEnum> & credentialRule);
+ chip::Protocols::InteractionModel::Status
+ createUser(chip::EndpointId endpointId, chip::FabricIndex creatorFabricIdx, chip::NodeId sourceNodeId, uint16_t userIndex,
+ const Nullable<chip::CharSpan> & userName, const Nullable<uint32_t> & userUniqueId,
+ const Nullable<UserStatusEnum> & userStatus, const Nullable<UserTypeEnum> & userType,
+ const Nullable<CredentialRuleEnum> & credentialRule,
+ const Nullable<CredentialStruct> & credential = Nullable<CredentialStruct>());
+ chip::Protocols::InteractionModel::Status
+ modifyUser(chip::EndpointId endpointId, chip::FabricIndex modifierFabricIndex, chip::NodeId sourceNodeId, uint16_t userIndex,
+ const Nullable<chip::CharSpan> & userName, const Nullable<uint32_t> & userUniqueId,
+ const Nullable<UserStatusEnum> & userStatus, const Nullable<UserTypeEnum> & userType,
+ const Nullable<CredentialRuleEnum> & credentialRule);
chip::Protocols::InteractionModel::Status clearUser(chip::EndpointId endpointId, chip::FabricIndex modifierFabricId,
chip::NodeId sourceNodeId, uint16_t userIndex, bool sendUserChangeEvent);
chip::Protocols::InteractionModel::Status clearUser(chip::EndpointId endpointId, chip::FabricIndex modifierFabricId,
@@ -477,7 +479,7 @@
bool engageLockout(chip::EndpointId endpointId);
static void sendClusterResponse(chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath,
- EmberAfStatus status);
+ chip::Protocols::InteractionModel::Status status);
/**
* @brief Common handler for LockDoor, UnlockDoor, UnlockWithTimeout commands
@@ -544,7 +546,7 @@
*/
template <typename T>
bool GetAttribute(chip::EndpointId endpointId, chip::AttributeId attributeId,
- EmberAfStatus (*getFn)(chip::EndpointId endpointId, T * value), T & value) const;
+ chip::Protocols::InteractionModel::Status (*getFn)(chip::EndpointId endpointId, T * value), T & value) const;
/**
* @brief Set generic attribute value
@@ -559,7 +561,7 @@
*/
template <typename T>
bool SetAttribute(chip::EndpointId endpointId, chip::AttributeId attributeId,
- EmberAfStatus (*setFn)(chip::EndpointId endpointId, T value), T value);
+ chip::Protocols::InteractionModel::Status (*setFn)(chip::EndpointId endpointId, T value), T value);
// AttributeAccessInterface's Read API
CHIP_ERROR Read(const chip::app::ConcreteReadAttributePath & aPath, chip::app::AttributeValueEncoder & aEncoder) override;
diff --git a/src/app/clusters/electrical-power-measurement-server/electrical-power-measurement-server.h b/src/app/clusters/electrical-power-measurement-server/electrical-power-measurement-server.h
index 0b5d45f..28af3fa 100644
--- a/src/app/clusters/electrical-power-measurement-server/electrical-power-measurement-server.h
+++ b/src/app/clusters/electrical-power-measurement-server/electrical-power-measurement-server.h
@@ -22,6 +22,7 @@
#include <app-common/zap-generated/cluster-objects.h>
#include <app/AttributeAccessInterface.h>
#include <lib/support/CommonIterator.h>
+#include <protocols/interaction_model/StatusCode.h>
namespace chip {
namespace app {
@@ -31,8 +32,6 @@
using namespace chip::app::Clusters::ElectricalPowerMeasurement::Attributes;
using namespace chip::app::Clusters::ElectricalPowerMeasurement::Structs;
-using chip::Protocols::InteractionModel::Status;
-
class Delegate
{
public:
diff --git a/src/app/clusters/energy-evse-server/energy-evse-server.h b/src/app/clusters/energy-evse-server/energy-evse-server.h
index dfead37..2ff46f3 100644
--- a/src/app/clusters/energy-evse-server/energy-evse-server.h
+++ b/src/app/clusters/energy-evse-server/energy-evse-server.h
@@ -27,6 +27,7 @@
#include <app/reporting/reporting.h>
#include <app/util/attribute-storage.h>
#include <lib/core/CHIPError.h>
+#include <protocols/interaction_model/StatusCode.h>
namespace chip {
namespace app {
@@ -38,7 +39,6 @@
constexpr int64_t kMaximumChargeCurrent = 80000;
constexpr uint32_t kMaxRandomizationDelayWindow = 86400;
-using chip::Protocols::InteractionModel::Status;
/** @brief
* Defines methods for implementing application-specific logic for the EVSE Management Cluster.
*/
@@ -55,30 +55,31 @@
* It should report Status::Success if successful and may
* return other Status codes if it fails
*/
- virtual Status Disable() = 0;
+ virtual Protocols::InteractionModel::Status Disable() = 0;
/**
* @brief Delegate should implement a handler to enable EVSE Charging.
* It should report Status::Success if successful and may
* return other Status codes if it fails
*/
- virtual Status EnableCharging(const DataModel::Nullable<uint32_t> & enableChargeTime, const int64_t & minimumChargeCurrent,
- const int64_t & maximumChargeCurrent) = 0;
+ virtual Protocols::InteractionModel::Status EnableCharging(const DataModel::Nullable<uint32_t> & enableChargeTime,
+ const int64_t & minimumChargeCurrent,
+ const int64_t & maximumChargeCurrent) = 0;
/**
* @brief Delegate should implement a handler to enable EVSE Discharging.
* It should report Status::Success if successful and may
* return other Status codes if it fails
*/
- virtual Status EnableDischarging(const DataModel::Nullable<uint32_t> & enableDischargeTime,
- const int64_t & maximumDischargeCurrent) = 0;
+ virtual Protocols::InteractionModel::Status EnableDischarging(const DataModel::Nullable<uint32_t> & enableDischargeTime,
+ const int64_t & maximumDischargeCurrent) = 0;
/**
* @brief Delegate should implement a handler to enable EVSE Diagnostics.
* It should report Status::Success if successful and may
* return other Status codes if it fails
*/
- virtual Status StartDiagnostics() = 0;
+ virtual Protocols::InteractionModel::Status StartDiagnostics() = 0;
// ------------------------------------------------------------------
// Get attribute methods
diff --git a/src/app/clusters/fan-control-server/fan-control-server.cpp b/src/app/clusters/fan-control-server/fan-control-server.cpp
index 8bca0d1..b297acd 100644
--- a/src/app/clusters/fan-control-server/fan-control-server.cpp
+++ b/src/app/clusters/fan-control-server/fan-control-server.cpp
@@ -34,6 +34,7 @@
#include <app/util/attribute-storage.h>
#include <lib/support/CodeUtils.h>
#include <lib/support/logging/CHIPLogging.h>
+#include <protocols/interaction_model/StatusCode.h>
using namespace chip;
using namespace chip::app;
@@ -41,6 +42,8 @@
using namespace chip::app::Clusters::FanControl;
using namespace chip::app::Clusters::FanControl::Attributes;
+using Protocols::InteractionModel::Status;
+
namespace {
constexpr size_t kFanControlDelegateTableSize =
@@ -85,11 +88,11 @@
// Indicates if the write operation is from the cluster server itself
bool gWriteFromClusterLogic = false;
-EmberAfStatus SetFanModeToOff(EndpointId endpointId)
+Status SetFanModeToOff(EndpointId endpointId)
{
FanModeEnum currentFanMode;
- EmberAfStatus status = FanMode::Get(endpointId, ¤tFanMode);
- VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status);
+ Status status = FanMode::Get(endpointId, ¤tFanMode);
+ VerifyOrReturnError(Status::Success == status, status);
if (currentFanMode != FanModeEnum::kOff)
{
@@ -103,7 +106,7 @@
{
bool success;
uint32_t featureMap;
- success = (Attributes::FeatureMap::Get(endpoint, &featureMap) == EMBER_ZCL_STATUS_SUCCESS);
+ success = (Attributes::FeatureMap::Get(endpoint, &featureMap) == Status::Success);
return success ? ((featureMap & to_underlying(feature)) != 0) : false;
}
@@ -163,8 +166,8 @@
else if (*value == to_underlying(FanModeEnum::kSmart))
{
FanModeSequenceEnum fanModeSequence;
- EmberAfStatus status = FanModeSequence::Get(attributePath.mEndpointId, &fanModeSequence);
- VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, Status::Failure);
+ Status status = FanModeSequence::Get(attributePath.mEndpointId, &fanModeSequence);
+ VerifyOrReturnError(Status::Success == status, Status::Failure);
if (SupportsAuto(attributePath.mEndpointId) &&
((fanModeSequence == FanModeSequenceEnum::kOffLowHighAuto) ||
@@ -204,8 +207,8 @@
else
{
uint8_t speedMax;
- EmberAfStatus status = SpeedMax::Get(attributePath.mEndpointId, &speedMax);
- VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, Status::ConstraintError);
+ Status status = SpeedMax::Get(attributePath.mEndpointId, &speedMax);
+ VerifyOrReturnError(Status::Success == status, Status::ConstraintError);
if (*value <= speedMax)
{
@@ -247,8 +250,8 @@
if (SupportsRocking(attributePath.mEndpointId))
{
BitMask<RockBitmap> rockSupport;
- EmberAfStatus status = RockSupport::Get(attributePath.mEndpointId, &rockSupport);
- VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, Status::ConstraintError);
+ Status status = RockSupport::Get(attributePath.mEndpointId, &rockSupport);
+ VerifyOrReturnError(Status::Success == status, Status::ConstraintError);
auto rawRockSupport = rockSupport.Raw();
if ((*value & rawRockSupport) == *value)
{
@@ -269,8 +272,8 @@
if (SupportsWind(attributePath.mEndpointId))
{
BitMask<WindBitmap> windSupport;
- EmberAfStatus status = WindSupport::Get(attributePath.mEndpointId, &windSupport);
- VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, Status::ConstraintError);
+ Status status = WindSupport::Get(attributePath.mEndpointId, &windSupport);
+ VerifyOrReturnError(Status::Success == status, Status::ConstraintError);
auto rawWindSupport = windSupport.Raw();
if ((*value & rawWindSupport) == *value)
{
@@ -312,30 +315,30 @@
{
case FanMode::Id: {
FanModeEnum mode;
- EmberAfStatus status = FanMode::Get(attributePath.mEndpointId, &mode);
- VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status);
+ Status status = FanMode::Get(attributePath.mEndpointId, &mode);
+ VerifyOrReturn(Status::Success == status);
// Setting the FanMode value to Off SHALL set the values of PercentSetting, PercentCurrent,
// SpeedSetting, SpeedCurrent attributes to 0 (zero).
if (mode == FanModeEnum::kOff)
{
status = PercentSetting::Set(attributePath.mEndpointId, 0);
- VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status,
- ChipLogError(Zcl, "Failed to write PercentSetting with error: 0x%02x", status));
+ VerifyOrReturn(Status::Success == status,
+ ChipLogError(Zcl, "Failed to write PercentSetting with error: 0x%02x", to_underlying(status)));
status = PercentCurrent::Set(attributePath.mEndpointId, 0);
- VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status,
- ChipLogError(Zcl, "Failed to write PercentCurrent with error: 0x%02x", status));
+ VerifyOrReturn(Status::Success == status,
+ ChipLogError(Zcl, "Failed to write PercentCurrent with error: 0x%02x", to_underlying(status)));
if (SupportsMultiSpeed(attributePath.mEndpointId))
{
status = SpeedSetting::Set(attributePath.mEndpointId, 0);
- VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status,
- ChipLogError(Zcl, "Failed to write SpeedSetting with error: 0x%02x", status));
+ VerifyOrReturn(Status::Success == status,
+ ChipLogError(Zcl, "Failed to write SpeedSetting with error: 0x%02x", to_underlying(status)));
status = SpeedCurrent::Set(attributePath.mEndpointId, 0);
- VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status,
- ChipLogError(Zcl, "Failed to write SpeedCurrent with error: 0x%02x", status));
+ VerifyOrReturn(Status::Success == status,
+ ChipLogError(Zcl, "Failed to write SpeedCurrent with error: 0x%02x", to_underlying(status)));
}
}
@@ -345,30 +348,30 @@
{
gWriteFromClusterLogic = true;
status = PercentSetting::SetNull(attributePath.mEndpointId);
- VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status,
- ChipLogError(Zcl, "Failed to write PercentSetting with error: 0x%02x", status));
+ VerifyOrReturn(Status::Success == status,
+ ChipLogError(Zcl, "Failed to write PercentSetting with error: 0x%02x", to_underlying(status)));
if (SupportsMultiSpeed(attributePath.mEndpointId))
{
gWriteFromClusterLogic = true;
status = SpeedSetting::SetNull(attributePath.mEndpointId);
- VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status,
- ChipLogError(Zcl, "Failed to write SpeedSetting with error: 0x%02x", status));
+ VerifyOrReturn(Status::Success == status,
+ ChipLogError(Zcl, "Failed to write SpeedSetting with error: 0x%02x", to_underlying(status)));
}
}
break;
}
case PercentSetting::Id: {
DataModel::Nullable<Percent> percentSetting;
- EmberAfStatus status = PercentSetting::Get(attributePath.mEndpointId, percentSetting);
- VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status && !percentSetting.IsNull());
+ Status status = PercentSetting::Get(attributePath.mEndpointId, percentSetting);
+ VerifyOrReturn(Status::Success == status && !percentSetting.IsNull());
// If PercentSetting is set to 0, the server SHALL set the FanMode attribute value to Off.
if (percentSetting.Value() == 0)
{
status = SetFanModeToOff(attributePath.mEndpointId);
- VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status,
- ChipLogError(Zcl, "Failed to set FanMode to off with error: 0x%02x", status));
+ VerifyOrReturn(Status::Success == status,
+ ChipLogError(Zcl, "Failed to set FanMode to off with error: 0x%02x", to_underlying(status)));
}
if (SupportsMultiSpeed(attributePath.mEndpointId))
@@ -377,13 +380,13 @@
// speed = ceil( SpeedMax * (percent * 0.01) )
uint8_t speedMax;
status = SpeedMax::Get(attributePath.mEndpointId, &speedMax);
- VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status,
- ChipLogError(Zcl, "Failed to get SpeedMax with error: 0x%02x", status));
+ VerifyOrReturn(Status::Success == status,
+ ChipLogError(Zcl, "Failed to get SpeedMax with error: 0x%02x", to_underlying(status)));
DataModel::Nullable<uint8_t> currentSpeedSetting;
status = SpeedSetting::Get(attributePath.mEndpointId, currentSpeedSetting);
- VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status,
- ChipLogError(Zcl, "Failed to get SpeedSetting with error: 0x%02x", status));
+ VerifyOrReturn(Status::Success == status,
+ ChipLogError(Zcl, "Failed to get SpeedSetting with error: 0x%02x", to_underlying(status)));
uint16_t percent = percentSetting.Value();
// Plus 99 then integer divide by 100 instead of multiplying 0.01 to avoid floating point precision error
@@ -392,8 +395,8 @@
if (currentSpeedSetting.IsNull() || speedSetting != currentSpeedSetting.Value())
{
status = SpeedSetting::Set(attributePath.mEndpointId, speedSetting);
- VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status,
- ChipLogError(Zcl, "Failed to set SpeedSetting with error: 0x%02x", status));
+ VerifyOrReturn(Status::Success == status,
+ ChipLogError(Zcl, "Failed to set SpeedSetting with error: 0x%02x", to_underlying(status)));
}
}
break;
@@ -402,28 +405,28 @@
if (SupportsMultiSpeed(attributePath.mEndpointId))
{
DataModel::Nullable<uint8_t> speedSetting;
- EmberAfStatus status = SpeedSetting::Get(attributePath.mEndpointId, speedSetting);
- VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status && !speedSetting.IsNull());
+ Status status = SpeedSetting::Get(attributePath.mEndpointId, speedSetting);
+ VerifyOrReturn(Status::Success == status && !speedSetting.IsNull());
// If SpeedSetting is set to 0, the server SHALL set the FanMode attribute value to Off.
if (speedSetting.Value() == 0)
{
status = SetFanModeToOff(attributePath.mEndpointId);
- VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status,
- ChipLogError(Zcl, "Failed to set FanMode to off with error: 0x%02x", status));
+ VerifyOrReturn(Status::Success == status,
+ ChipLogError(Zcl, "Failed to set FanMode to off with error: 0x%02x", to_underlying(status)));
}
// Adjust PercentSetting from a speed value change for SpeedSetting
// percent = floor( speed/SpeedMax * 100 )
uint8_t speedMax;
status = SpeedMax::Get(attributePath.mEndpointId, &speedMax);
- VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status,
- ChipLogError(Zcl, "Failed to get SpeedMax with error: 0x%02x", status));
+ VerifyOrReturn(Status::Success == status,
+ ChipLogError(Zcl, "Failed to get SpeedMax with error: 0x%02x", to_underlying(status)));
DataModel::Nullable<Percent> currentPercentSetting;
status = PercentSetting::Get(attributePath.mEndpointId, currentPercentSetting);
- VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status,
- ChipLogError(Zcl, "Failed to get PercentSetting with error: 0x%02x", status));
+ VerifyOrReturn(Status::Success == status,
+ ChipLogError(Zcl, "Failed to get PercentSetting with error: 0x%02x", to_underlying(status)));
float speed = speedSetting.Value();
Percent percentSetting = static_cast<Percent>(speed / speedMax * 100);
@@ -431,8 +434,8 @@
if (currentPercentSetting.IsNull() || percentSetting != currentPercentSetting.Value())
{
status = PercentSetting::Set(attributePath.mEndpointId, percentSetting);
- VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status,
- ChipLogError(Zcl, "Failed to set PercentSetting with error: 0x%02x", status));
+ VerifyOrReturn(Status::Success == status,
+ ChipLogError(Zcl, "Failed to set PercentSetting with error: 0x%02x", to_underlying(status)));
}
}
break;
diff --git a/src/app/clusters/groups-server/groups-server.cpp b/src/app/clusters/groups-server/groups-server.cpp
index d591c3f..04e26a0 100644
--- a/src/app/clusters/groups-server/groups-server.cpp
+++ b/src/app/clusters/groups-server/groups-server.cpp
@@ -102,40 +102,40 @@
return Status::ResourceExhausted;
}
-static EmberAfStatus GroupRemove(FabricIndex fabricIndex, EndpointId endpointId, GroupId groupId)
+static Status GroupRemove(FabricIndex fabricIndex, EndpointId endpointId, GroupId groupId)
{
- VerifyOrReturnError(IsValidGroupId(groupId), EMBER_ZCL_STATUS_CONSTRAINT_ERROR);
- VerifyOrReturnError(GroupExists(fabricIndex, endpointId, groupId), EMBER_ZCL_STATUS_NOT_FOUND);
+ VerifyOrReturnError(IsValidGroupId(groupId), Status::ConstraintError);
+ VerifyOrReturnError(GroupExists(fabricIndex, endpointId, groupId), Status::NotFound);
GroupDataProvider * provider = GetGroupDataProvider();
- VerifyOrReturnError(nullptr != provider, EMBER_ZCL_STATUS_NOT_FOUND);
+ VerifyOrReturnError(nullptr != provider, Status::NotFound);
CHIP_ERROR err = provider->RemoveEndpoint(fabricIndex, groupId, endpointId);
if (CHIP_NO_ERROR == err)
{
MatterReportingAttributeChangeCallback(kRootEndpointId, GroupKeyManagement::Id,
GroupKeyManagement::Attributes::GroupTable::Id);
- return EMBER_ZCL_STATUS_SUCCESS;
+ return Status::Success;
}
ChipLogDetail(Zcl, "ERR: Failed to remove mapping (end:%d, group:0x%x), err:%" CHIP_ERROR_FORMAT, endpointId, groupId,
err.Format());
- return EMBER_ZCL_STATUS_NOT_FOUND;
+ return Status::NotFound;
}
void emberAfGroupsClusterServerInitCallback(EndpointId endpointId)
{
// According to spec, highest bit (Group Names) MUST match feature bit 0 (Group Names)
- EmberAfStatus status = Attributes::NameSupport::Set(endpointId, NameSupportBitmap::kGroupNames);
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ Status status = Attributes::NameSupport::Set(endpointId, NameSupportBitmap::kGroupNames);
+ if (status != Status::Success)
{
- ChipLogDetail(Zcl, "ERR: writing NameSupport %x", status);
+ ChipLogDetail(Zcl, "ERR: writing NameSupport %x", to_underlying(status));
}
status = Attributes::FeatureMap::Set(endpointId, static_cast<uint32_t>(Feature::kGroupNames));
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ if (status != Status::Success)
{
- ChipLogDetail(Zcl, "ERR: writing group feature map %x", status);
+ ChipLogDetail(Zcl, "ERR: writing group feature map %x", to_underlying(status));
}
}
@@ -161,21 +161,21 @@
GroupDataProvider * provider = GetGroupDataProvider();
GroupDataProvider::GroupInfo info;
Groups::Commands::ViewGroupResponse::Type response;
- CHIP_ERROR err = CHIP_NO_ERROR;
- EmberAfStatus status = EMBER_ZCL_STATUS_NOT_FOUND;
+ CHIP_ERROR err = CHIP_NO_ERROR;
+ Status status = Status::NotFound;
- VerifyOrExit(IsValidGroupId(groupId), status = EMBER_ZCL_STATUS_CONSTRAINT_ERROR);
- VerifyOrExit(nullptr != provider, status = EMBER_ZCL_STATUS_FAILURE);
- VerifyOrExit(provider->HasEndpoint(fabricIndex, groupId, commandPath.mEndpointId), status = EMBER_ZCL_STATUS_NOT_FOUND);
+ VerifyOrExit(IsValidGroupId(groupId), status = Status::ConstraintError);
+ VerifyOrExit(nullptr != provider, status = Status::Failure);
+ VerifyOrExit(provider->HasEndpoint(fabricIndex, groupId, commandPath.mEndpointId), status = Status::NotFound);
err = provider->GetGroupInfo(fabricIndex, groupId, info);
- VerifyOrExit(CHIP_NO_ERROR == err, status = EMBER_ZCL_STATUS_NOT_FOUND);
+ VerifyOrExit(CHIP_NO_ERROR == err, status = Status::NotFound);
response.groupName = CharSpan(info.name, strnlen(info.name, GroupDataProvider::GroupInfo::kGroupNameMax));
- status = EMBER_ZCL_STATUS_SUCCESS;
+ status = Status::Success;
exit:
response.groupID = groupId;
- response.status = status;
+ response.status = to_underlying(status);
commandObj->AddResponse(commandPath, response);
return true;
}
diff --git a/src/app/clusters/icd-management-server/icd-management-server.cpp b/src/app/clusters/icd-management-server/icd-management-server.cpp
index 90953e3..cac9e2d 100644
--- a/src/app/clusters/icd-management-server/icd-management-server.cpp
+++ b/src/app/clusters/icd-management-server/icd-management-server.cpp
@@ -36,6 +36,8 @@
using namespace Protocols;
using namespace chip::Access;
+using chip::Protocols::InteractionModel::Status;
+
namespace {
/**
diff --git a/src/app/clusters/icd-management-server/icd-management-server.h b/src/app/clusters/icd-management-server/icd-management-server.h
index 308d508..0763f48 100644
--- a/src/app/clusters/icd-management-server/icd-management-server.h
+++ b/src/app/clusters/icd-management-server/icd-management-server.h
@@ -29,8 +29,6 @@
#include <lib/support/Span.h>
#include <protocols/interaction_model/StatusCode.h>
-using chip::Protocols::InteractionModel::Status;
-
class ICDManagementServer
{
public:
@@ -46,14 +44,16 @@
* ICDConfigurationData If function fails, icdCounter will be unchanged
* @return Status
*/
- Status RegisterClient(chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath,
- const chip::app::Clusters::IcdManagement::Commands::RegisterClient::DecodableType & commandData,
- uint32_t & icdCounter);
+ chip::Protocols::InteractionModel::Status
+ RegisterClient(chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath,
+ const chip::app::Clusters::IcdManagement::Commands::RegisterClient::DecodableType & commandData,
+ uint32_t & icdCounter);
- Status UnregisterClient(chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath,
- const chip::app::Clusters::IcdManagement::Commands::UnregisterClient::DecodableType & commandData);
+ chip::Protocols::InteractionModel::Status
+ UnregisterClient(chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath,
+ const chip::app::Clusters::IcdManagement::Commands::UnregisterClient::DecodableType & commandData);
- Status StayActiveRequest(chip::FabricIndex fabricIndex);
+ chip::Protocols::InteractionModel::Status StayActiveRequest(chip::FabricIndex fabricIndex);
private:
/**
diff --git a/src/app/clusters/laundry-dryer-controls-server/laundry-dryer-controls-server.cpp b/src/app/clusters/laundry-dryer-controls-server/laundry-dryer-controls-server.cpp
index c310701..7a3d47f 100644
--- a/src/app/clusters/laundry-dryer-controls-server/laundry-dryer-controls-server.cpp
+++ b/src/app/clusters/laundry-dryer-controls-server/laundry-dryer-controls-server.cpp
@@ -82,12 +82,12 @@
return sInstance;
}
-EmberAfStatus LaundryDryerControlsServer::SetSelectedDrynessLevel(EndpointId endpointId, DrynessLevelEnum newSelectedDrynessLevel)
+Status LaundryDryerControlsServer::SetSelectedDrynessLevel(EndpointId endpointId, DrynessLevelEnum newSelectedDrynessLevel)
{
DataModel::Nullable<DrynessLevelEnum> selectedDrynessLevel;
- EmberAfStatus res = SelectedDrynessLevel::Get(endpointId, selectedDrynessLevel);
+ Status res = SelectedDrynessLevel::Get(endpointId, selectedDrynessLevel);
- if ((res == EMBER_ZCL_STATUS_SUCCESS) && (selectedDrynessLevel != newSelectedDrynessLevel))
+ if ((res == Status::Success) && (selectedDrynessLevel != newSelectedDrynessLevel))
{
res = SelectedDrynessLevel::Set(endpointId, newSelectedDrynessLevel);
}
@@ -95,8 +95,8 @@
return res;
}
-EmberAfStatus LaundryDryerControlsServer::GetSelectedDrynessLevel(EndpointId endpointId,
- DataModel::Nullable<DrynessLevelEnum> & selectedDrynessLevel)
+Status LaundryDryerControlsServer::GetSelectedDrynessLevel(EndpointId endpointId,
+ DataModel::Nullable<DrynessLevelEnum> & selectedDrynessLevel)
{
return SelectedDrynessLevel::Get(endpointId, selectedDrynessLevel);
}
diff --git a/src/app/clusters/laundry-dryer-controls-server/laundry-dryer-controls-server.h b/src/app/clusters/laundry-dryer-controls-server/laundry-dryer-controls-server.h
index 454c029..5a7123c 100644
--- a/src/app/clusters/laundry-dryer-controls-server/laundry-dryer-controls-server.h
+++ b/src/app/clusters/laundry-dryer-controls-server/laundry-dryer-controls-server.h
@@ -21,6 +21,7 @@
#include <app-common/zap-generated/cluster-objects.h>
#include <app/AttributeAccessInterface.h>
#include <app/util/af.h>
+#include <protocols/interaction_model/StatusCode.h>
namespace chip {
namespace app {
@@ -46,8 +47,9 @@
/**
* API to set/get the SelectedDrynessLevel attribute
*/
- EmberAfStatus SetSelectedDrynessLevel(EndpointId endpointId, DrynessLevelEnum newSelectedDrynessLevel);
- EmberAfStatus GetSelectedDrynessLevel(EndpointId endpointId, DataModel::Nullable<DrynessLevelEnum> & selectedDrynessLevel);
+ Protocols::InteractionModel::Status SetSelectedDrynessLevel(EndpointId endpointId, DrynessLevelEnum newSelectedDrynessLevel);
+ Protocols::InteractionModel::Status GetSelectedDrynessLevel(EndpointId endpointId,
+ DataModel::Nullable<DrynessLevelEnum> & selectedDrynessLevel);
private:
CHIP_ERROR Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override;
diff --git a/src/app/clusters/laundry-washer-controls-server/laundry-washer-controls-server.cpp b/src/app/clusters/laundry-washer-controls-server/laundry-washer-controls-server.cpp
index cc8d710..4e58236 100644
--- a/src/app/clusters/laundry-washer-controls-server/laundry-washer-controls-server.cpp
+++ b/src/app/clusters/laundry-washer-controls-server/laundry-washer-controls-server.cpp
@@ -81,11 +81,11 @@
return sInstance;
}
-EmberAfStatus LaundryWasherControlsServer::SetSpinSpeedCurrent(EndpointId endpointId, DataModel::Nullable<uint8_t> spinSpeedCurrent)
+Status LaundryWasherControlsServer::SetSpinSpeedCurrent(EndpointId endpointId, DataModel::Nullable<uint8_t> spinSpeedCurrent)
{
DataModel::Nullable<uint8_t> spinSpeedCurrentNow;
- EmberAfStatus res = SpinSpeedCurrent::Get(endpointId, spinSpeedCurrentNow);
- if ((res == EMBER_ZCL_STATUS_SUCCESS) && (spinSpeedCurrentNow != spinSpeedCurrent))
+ Status res = SpinSpeedCurrent::Get(endpointId, spinSpeedCurrentNow);
+ if ((res == Status::Success) && (spinSpeedCurrentNow != spinSpeedCurrent))
{
res = SpinSpeedCurrent::Set(endpointId, spinSpeedCurrent);
}
@@ -93,18 +93,17 @@
return res;
}
-EmberAfStatus LaundryWasherControlsServer::GetSpinSpeedCurrent(EndpointId endpointId,
- DataModel::Nullable<uint8_t> & spinSpeedCurrent)
+Status LaundryWasherControlsServer::GetSpinSpeedCurrent(EndpointId endpointId, DataModel::Nullable<uint8_t> & spinSpeedCurrent)
{
return SpinSpeedCurrent::Get(endpointId, spinSpeedCurrent);
}
-EmberAfStatus LaundryWasherControlsServer::SetNumberOfRinses(EndpointId endpointId, NumberOfRinsesEnum newNumberOfRinses)
+Status LaundryWasherControlsServer::SetNumberOfRinses(EndpointId endpointId, NumberOfRinsesEnum newNumberOfRinses)
{
NumberOfRinsesEnum numberOfRinses;
- EmberAfStatus res = NumberOfRinses::Get(endpointId, &numberOfRinses);
+ Status res = NumberOfRinses::Get(endpointId, &numberOfRinses);
- if ((res == EMBER_ZCL_STATUS_SUCCESS) && (numberOfRinses != newNumberOfRinses))
+ if ((res == Status::Success) && (numberOfRinses != newNumberOfRinses))
{
res = NumberOfRinses::Set(endpointId, newNumberOfRinses);
}
@@ -112,7 +111,7 @@
return res;
}
-EmberAfStatus LaundryWasherControlsServer::GetNumberOfRinses(EndpointId endpointId, NumberOfRinsesEnum & numberOfRinses)
+Status LaundryWasherControlsServer::GetNumberOfRinses(EndpointId endpointId, NumberOfRinsesEnum & numberOfRinses)
{
return NumberOfRinses::Get(endpointId, &numberOfRinses);
}
diff --git a/src/app/clusters/laundry-washer-controls-server/laundry-washer-controls-server.h b/src/app/clusters/laundry-washer-controls-server/laundry-washer-controls-server.h
index f010691..c19b6f8 100644
--- a/src/app/clusters/laundry-washer-controls-server/laundry-washer-controls-server.h
+++ b/src/app/clusters/laundry-washer-controls-server/laundry-washer-controls-server.h
@@ -22,6 +22,8 @@
#include <app/AttributeAccessInterface.h>
#include <app/util/af.h>
+#include <protocols/interaction_model/StatusCode.h>
+
namespace chip {
namespace app {
namespace Clusters {
@@ -48,14 +50,14 @@
/**
* API to set/get the SpinSpeedCurrent attribute
*/
- EmberAfStatus SetSpinSpeedCurrent(EndpointId endpointId, DataModel::Nullable<uint8_t> spinSpeedCurrent);
- EmberAfStatus GetSpinSpeedCurrent(EndpointId endpointId, DataModel::Nullable<uint8_t> & spinSpeedCurrent);
+ Protocols::InteractionModel::Status SetSpinSpeedCurrent(EndpointId endpointId, DataModel::Nullable<uint8_t> spinSpeedCurrent);
+ Protocols::InteractionModel::Status GetSpinSpeedCurrent(EndpointId endpointId, DataModel::Nullable<uint8_t> & spinSpeedCurrent);
/**
* API to set/get the NumberOfRinses attribute
*/
- EmberAfStatus SetNumberOfRinses(EndpointId endpointId, NumberOfRinsesEnum newNumberOfRinses);
- EmberAfStatus GetNumberOfRinses(EndpointId endpointId, NumberOfRinsesEnum & numberOfRinses);
+ Protocols::InteractionModel::Status SetNumberOfRinses(EndpointId endpointId, NumberOfRinsesEnum newNumberOfRinses);
+ Protocols::InteractionModel::Status GetNumberOfRinses(EndpointId endpointId, NumberOfRinsesEnum & numberOfRinses);
private:
CHIP_ERROR Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override;
diff --git a/src/app/clusters/level-control/level-control.cpp b/src/app/clusters/level-control/level-control.cpp
index b1edc34..b04d32f 100644
--- a/src/app/clusters/level-control/level-control.cpp
+++ b/src/app/clusters/level-control/level-control.cpp
@@ -161,12 +161,12 @@
using AttributeValuePair = ScenesManagement::Structs::AttributeValuePair::Type;
app::DataModel::Nullable<uint8_t> level;
- VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == Attributes::CurrentLevel::Get(endpoint, level), CHIP_ERROR_READ_FAILED);
+ VerifyOrReturnError(Status::Success == Attributes::CurrentLevel::Get(endpoint, level), CHIP_ERROR_READ_FAILED);
AttributeValuePair pairs[kLevelMaxScenableAttributes];
uint8_t maxLevel;
- VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == Attributes::MaxLevel::Get(endpoint, &maxLevel), CHIP_ERROR_READ_FAILED);
+ VerifyOrReturnError(Status::Success == Attributes::MaxLevel::Get(endpoint, &maxLevel), CHIP_ERROR_READ_FAILED);
pairs[0].attributeID = Attributes::CurrentLevel::Id;
if (!level.IsNull())
@@ -181,8 +181,7 @@
if (LevelControlHasFeature(endpoint, LevelControl::Feature::kFrequency))
{
uint16_t frequency;
- VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == Attributes::CurrentFrequency::Get(endpoint, &frequency),
- CHIP_ERROR_READ_FAILED);
+ VerifyOrReturnError(Status::Success == Attributes::CurrentFrequency::Get(endpoint, &frequency), CHIP_ERROR_READ_FAILED);
pairs[attributeCount].attributeID = Attributes::CurrentFrequency::Id;
pairs[attributeCount].attributeValue = frequency;
attributeCount++;
@@ -337,10 +336,10 @@
static void reallyUpdateCoupledColorTemp(EndpointId endpoint)
{
LevelControl::Attributes::Options::TypeInfo::Type options;
- EmberAfStatus status = Attributes::Options::Get(endpoint, &options);
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ Status status = Attributes::Options::Get(endpoint, &options);
+ if (status != Status::Success)
{
- ChipLogProgress(Zcl, "Unable to read Options attribute: 0x%X", status);
+ ChipLogProgress(Zcl, "Unable to read Options attribute: 0x%X", to_underlying(status));
return;
}
@@ -357,7 +356,7 @@
void emberAfLevelControlClusterServerTickCallback(EndpointId endpoint)
{
EmberAfLevelControlState * state = getState(endpoint);
- EmberAfStatus status;
+ Status status;
app::DataModel::Nullable<uint8_t> currentLevel;
const auto callbackStartTimestamp = System::SystemClock().GetMonotonicTimestamp();
@@ -371,9 +370,9 @@
// Read the attribute; print error message and return if it can't be read
status = LevelControl::Attributes::CurrentLevel::Get(endpoint, currentLevel);
- if (status != EMBER_ZCL_STATUS_SUCCESS || currentLevel.IsNull())
+ if (status != Status::Success || currentLevel.IsNull())
{
- ChipLogProgress(Zcl, "ERR: reading current level %x", status);
+ ChipLogProgress(Zcl, "ERR: reading current level %x", to_underlying(status));
state->callbackSchedule.runTime = System::Clock::Milliseconds32(0);
writeRemainingTime(endpoint, 0);
return;
@@ -404,9 +403,9 @@
ChipLogDetail(Zcl, "(diff %c1)", state->increasing ? '+' : '-');
status = Attributes::CurrentLevel::Set(endpoint, currentLevel);
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ if (status != Status::Success)
{
- ChipLogProgress(Zcl, "ERR: writing current level %x", status);
+ ChipLogProgress(Zcl, "ERR: writing current level %x", to_underlying(status));
state->callbackSchedule.runTime = System::Clock::Milliseconds32(0);
writeRemainingTime(endpoint, 0);
return;
@@ -427,9 +426,9 @@
{
uint8_t storedLevel8u = (uint8_t) state->storedLevel;
status = Attributes::CurrentLevel::Set(endpoint, storedLevel8u);
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ if (status != Status::Success)
{
- ChipLogProgress(Zcl, "ERR: writing current level %x", status);
+ ChipLogProgress(Zcl, "ERR: writing current level %x", to_underlying(status));
}
else
{
@@ -469,10 +468,10 @@
// This is done to ensure that the attribute, in tenths of a second, only
// goes to zero when the remaining time in milliseconds is actually zero.
uint16_t remainingTimeDs = static_cast<uint16_t>((remainingTimeMs + 99) / 100);
- EmberAfStatus status = LevelControl::Attributes::RemainingTime::Set(endpoint, remainingTimeDs);
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ Status status = LevelControl::Attributes::RemainingTime::Set(endpoint, remainingTimeDs);
+ if (status != Status::Success)
{
- ChipLogProgress(Zcl, "ERR: writing remaining time %x", status);
+ ChipLogProgress(Zcl, "ERR: writing remaining time %x", to_underlying(status));
}
}
#endif // IGNORE_LEVEL_CONTROL_CLUSTER_LEVEL_CONTROL_REMAINING_TIME
@@ -515,19 +514,19 @@
}
LevelControl::Attributes::Options::TypeInfo::Type options;
- EmberAfStatus status = Attributes::Options::Get(endpoint, &options);
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ Status status = Attributes::Options::Get(endpoint, &options);
+ if (status != Status::Success)
{
- ChipLogProgress(Zcl, "Unable to read Options attribute: 0x%X", status);
+ ChipLogProgress(Zcl, "Unable to read Options attribute: 0x%X", to_underlying(status));
// If we can't read the attribute, then we should just assume that it has its
// default value.
}
bool on;
status = OnOff::Attributes::OnOff::Get(endpoint, &on);
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ if (status != Status::Success)
{
- ChipLogProgress(Zcl, "Unable to read OnOff attribute: 0x%X", status);
+ ChipLogProgress(Zcl, "Unable to read OnOff attribute: 0x%X", to_underlying(status));
return true;
}
// The device is on - hence ExecuteIfOff does not matter
@@ -803,10 +802,10 @@
// Cancel any currently active command before fiddling with the state.
cancelEndpointTimerCallback(endpoint);
- EmberAfStatus status = Attributes::CurrentLevel::Get(endpoint, currentLevel);
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ Status status = Attributes::CurrentLevel::Get(endpoint, currentLevel);
+ if (status != Status::Success)
{
- ChipLogProgress(Zcl, "ERR: reading current level %x", status);
+ ChipLogProgress(Zcl, "ERR: reading current level %x", to_underlying(status));
return status;
}
@@ -869,9 +868,9 @@
{
uint16_t onOffTransitionTime = 0;
status = Attributes::OnOffTransitionTime::Get(endpoint, &onOffTransitionTime);
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ if (status != Status::Success)
{
- ChipLogProgress(Zcl, "ERR: reading on/off transition time %x", status);
+ ChipLogProgress(Zcl, "ERR: reading on/off transition time %x", to_underlying(status));
return status;
}
@@ -1243,7 +1242,7 @@
app::DataModel::Nullable<uint16_t> transitionTime;
uint16_t currentOnOffTransitionTime;
- EmberAfStatus status;
+ Status status;
bool useOnLevel = false;
EmberAfLevelControlState * state = getState(endpoint);
@@ -1257,9 +1256,9 @@
// "Temporarily store CurrentLevel."
status = Attributes::CurrentLevel::Get(endpoint, temporaryCurrentLevelCache);
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ if (status != Status::Success)
{
- ChipLogProgress(Zcl, "ERR: reading current level %x", status);
+ ChipLogProgress(Zcl, "ERR: reading current level %x", to_underlying(status));
return;
}
@@ -1273,9 +1272,9 @@
if (emberAfContainsAttribute(endpoint, LevelControl::Id, Attributes::OnLevel::Id))
{
status = Attributes::OnLevel::Get(endpoint, resolvedLevel);
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ if (status != Status::Success)
{
- ChipLogProgress(Zcl, "ERR: reading on level %x", status);
+ ChipLogProgress(Zcl, "ERR: reading on level %x", to_underlying(status));
return;
}
@@ -1302,9 +1301,9 @@
if (emberAfContainsAttribute(endpoint, LevelControl::Id, Attributes::OnOffTransitionTime::Id))
{
status = Attributes::OnOffTransitionTime::Get(endpoint, ¤tOnOffTransitionTime);
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ if (status != Status::Success)
{
- ChipLogProgress(Zcl, "ERR: reading current level %x", status);
+ ChipLogProgress(Zcl, "ERR: reading current level %x", to_underlying(status));
return;
}
transitionTime.SetNonNull(currentOnOffTransitionTime);
@@ -1322,9 +1321,9 @@
// If newValue is OnOff::Commands::On::Id...
// "Set CurrentLevel to minimum level allowed for the device."
status = Attributes::CurrentLevel::Set(endpoint, minimumLevelAllowedForTheDevice);
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ if (status != Status::Success)
{
- ChipLogProgress(Zcl, "ERR: reading current level %x", status);
+ ChipLogProgress(Zcl, "ERR: reading current level %x", to_underlying(status));
return;
}
@@ -1386,8 +1385,8 @@
}
app::DataModel::Nullable<uint8_t> currentLevel;
- EmberAfStatus status = Attributes::CurrentLevel::Get(endpoint, currentLevel);
- if (status == EMBER_ZCL_STATUS_SUCCESS)
+ Status status = Attributes::CurrentLevel::Get(endpoint, currentLevel);
+ if (status == Status::Success)
{
#ifndef IGNORE_LEVEL_CONTROL_CLUSTER_START_UP_CURRENT_LEVEL
// StartUp behavior relies StartUpCurrentLevel attributes being Non Volatile.
@@ -1408,7 +1407,7 @@
app::DataModel::Nullable<uint8_t> startUpCurrentLevel;
status = Attributes::StartUpCurrentLevel::Get(endpoint, startUpCurrentLevel);
- if (status == EMBER_ZCL_STATUS_SUCCESS)
+ if (status == Status::Success)
{
if (!startUpCurrentLevel.IsNull())
{
@@ -1480,7 +1479,7 @@
{
bool success;
uint32_t featureMap;
- success = (Attributes::FeatureMap::Get(endpoint, &featureMap) == EMBER_ZCL_STATUS_SUCCESS);
+ success = (Attributes::FeatureMap::Get(endpoint, &featureMap) == Status::Success);
return success ? ((featureMap & to_underlying(feature)) != 0) : false;
}
diff --git a/src/app/clusters/localization-configuration-server/localization-configuration-server.cpp b/src/app/clusters/localization-configuration-server/localization-configuration-server.cpp
index 144665b..8828332 100644
--- a/src/app/clusters/localization-configuration-server/localization-configuration-server.cpp
+++ b/src/app/clusters/localization-configuration-server/localization-configuration-server.cpp
@@ -30,6 +30,7 @@
#include <lib/support/logging/CHIPLogging.h>
#include <platform/DeviceInfoProvider.h>
#include <platform/PlatformManager.h>
+#include <protocols/interaction_model/StatusCode.h>
using namespace chip;
using namespace chip::app;
@@ -37,6 +38,8 @@
using namespace chip::app::Clusters::LocalizationConfiguration;
using namespace chip::app::Clusters::LocalizationConfiguration::Attributes;
+using chip::Protocols::InteractionModel::Status;
+
namespace {
class LocalizationConfigurationAttrAccess : public AttributeAccessInterface
@@ -163,9 +166,10 @@
{
char outBuf[Attributes::ActiveLocale::TypeInfo::MaxLength()];
MutableCharSpan activeLocale(outBuf);
- EmberAfStatus status = ActiveLocale::Get(endpoint, activeLocale);
+ Status status = ActiveLocale::Get(endpoint, activeLocale);
- VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status, ChipLogError(Zcl, "Failed to read ActiveLocale with error: 0x%02x", status));
+ VerifyOrReturn(Status::Success == status,
+ ChipLogError(Zcl, "Failed to read ActiveLocale with error: 0x%02x", to_underlying(status)));
DeviceLayer::DeviceInfoProvider * provider = DeviceLayer::GetDeviceInfoProvider();
@@ -208,8 +212,8 @@
{
// If initial value is not one of the allowed values, write the valid value it.
status = ActiveLocale::Set(endpoint, validLocale);
- VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status,
- ChipLogError(Zcl, "Failed to write active locale with error: 0x%02x", status));
+ VerifyOrReturn(Status::Success == status,
+ ChipLogError(Zcl, "Failed to write active locale with error: 0x%02x", to_underlying(status)));
}
}
}
diff --git a/src/app/clusters/media-input-server/media-input-server.cpp b/src/app/clusters/media-input-server/media-input-server.cpp
index 02b114c..3fe1398 100644
--- a/src/app/clusters/media-input-server/media-input-server.cpp
+++ b/src/app/clusters/media-input-server/media-input-server.cpp
@@ -92,8 +92,8 @@
bool hasFeature = false;
uint32_t featureMap = 0;
- EmberAfStatus status = Attributes::FeatureMap::Get(endpoint, &featureMap);
- if (EMBER_ZCL_STATUS_SUCCESS == status)
+ Status status = Attributes::FeatureMap::Get(endpoint, &featureMap);
+ if (Status::Success == status)
{
hasFeature = (featureMap & chip::to_underlying(feature));
}
diff --git a/src/app/clusters/mode-select-server/mode-select-server.cpp b/src/app/clusters/mode-select-server/mode-select-server.cpp
index e2a2590..f8d9947 100644
--- a/src/app/clusters/mode-select-server/mode-select-server.cpp
+++ b/src/app/clusters/mode-select-server/mode-select-server.cpp
@@ -136,8 +136,8 @@
// attribute are listed below.
DataModel::Nullable<uint8_t> startUpMode;
- EmberAfStatus status = Attributes::StartUpMode::Get(endpointId, startUpMode);
- if (status == EMBER_ZCL_STATUS_SUCCESS && !startUpMode.IsNull())
+ Status status = Attributes::StartUpMode::Get(endpointId, startUpMode);
+ if (status == Status::Success && !startUpMode.IsNull())
{
#ifdef MATTER_DM_PLUGIN_ON_OFF
// OnMode with Power Up
@@ -150,9 +150,9 @@
{
Attributes::OnMode::TypeInfo::Type onMode;
bool onOffValueForStartUp = false;
- if (Attributes::OnMode::Get(endpointId, onMode) == EMBER_ZCL_STATUS_SUCCESS &&
+ if (Attributes::OnMode::Get(endpointId, onMode) == Status::Success &&
!emberAfIsKnownVolatileAttribute(endpointId, OnOff::Id, OnOff::Attributes::StartUpOnOff::Id) &&
- OnOffServer::Instance().getOnOffValueForStartUp(endpointId, onOffValueForStartUp) == EMBER_ZCL_STATUS_SUCCESS)
+ OnOffServer::Instance().getOnOffValueForStartUp(endpointId, onOffValueForStartUp) == Status::Success)
{
if (onOffValueForStartUp && !onMode.IsNull())
{
@@ -182,12 +182,12 @@
uint8_t currentMode = 0;
status = Attributes::CurrentMode::Get(endpointId, ¤tMode);
- if ((status == EMBER_ZCL_STATUS_SUCCESS) && (startUpMode.Value() != currentMode))
+ if ((status == Status::Success) && (startUpMode.Value() != currentMode))
{
status = Attributes::CurrentMode::Set(endpointId, startUpMode.Value());
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ if (status != Status::Success)
{
- ChipLogError(Zcl, "ModeSelect: Error initializing CurrentMode, EmberAfStatus code 0x%02x", status);
+ ChipLogError(Zcl, "ModeSelect: Error initializing CurrentMode, Status code 0x%02x", to_underlying(status));
}
else
{
diff --git a/src/app/clusters/on-off-server/on-off-server.cpp b/src/app/clusters/on-off-server/on-off-server.cpp
index e5c7ae4..ac1c4a0 100644
--- a/src/app/clusters/on-off-server/on-off-server.cpp
+++ b/src/app/clusters/on-off-server/on-off-server.cpp
@@ -23,6 +23,7 @@
#include <app/util/af.h>
#include <app/util/config.h>
#include <app/util/util.h>
+#include <protocols/interaction_model/StatusCode.h>
#include <tracing/macros.h>
#ifdef MATTER_DM_PLUGIN_SCENES_MANAGEMENT
@@ -151,10 +152,10 @@
bool currentValue;
// read current on/off value
- EmberAfStatus status = Attributes::OnOff::Get(endpoint, ¤tValue);
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ Status status = Attributes::OnOff::Get(endpoint, ¤tValue);
+ if (status != Status::Success)
{
- ChipLogError(Zcl, "ERR: reading on/off %x", status);
+ ChipLogError(Zcl, "ERR: reading on/off %x", to_underlying(status));
return CHIP_ERROR_READ_FAILED;
}
@@ -311,18 +312,18 @@
{
bool success;
uint32_t featureMap;
- success = (Attributes::FeatureMap::Get(endpoint, &featureMap) == EMBER_ZCL_STATUS_SUCCESS);
+ success = (Attributes::FeatureMap::Get(endpoint, &featureMap) == Status::Success);
return success ? ((featureMap & to_underlying(feature)) != 0) : false;
}
-EmberAfStatus OnOffServer::getOnOffValue(chip::EndpointId endpoint, bool * currentOnOffValue)
+Status OnOffServer::getOnOffValue(chip::EndpointId endpoint, bool * currentOnOffValue)
{
// read current on/off value
- EmberAfStatus status = Attributes::OnOff::Get(endpoint, currentOnOffValue);
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ Status status = Attributes::OnOff::Get(endpoint, currentOnOffValue);
+ if (status != Status::Success)
{
- ChipLogProgress(Zcl, "ERR: reading on/off %x", status);
+ ChipLogProgress(Zcl, "ERR: reading on/off %x", to_underlying(status));
}
ChipLogProgress(Zcl, "On/Off ep%d value: %d", endpoint, *currentOnOffValue);
@@ -339,17 +340,17 @@
* @param command Ver.: always
* @param initiatedByLevelChange Ver.: always
*/
-EmberAfStatus OnOffServer::setOnOffValue(chip::EndpointId endpoint, chip::CommandId command, bool initiatedByLevelChange)
+Status OnOffServer::setOnOffValue(chip::EndpointId endpoint, chip::CommandId command, bool initiatedByLevelChange)
{
MATTER_TRACE_SCOPE("setOnOffValue", "OnOff");
- EmberAfStatus status;
+ Status status;
bool currentValue, newValue;
// read current on/off value
status = Attributes::OnOff::Get(endpoint, ¤tValue);
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ if (status != Status::Success)
{
- ChipLogProgress(Zcl, "ERR: reading on/off %x", status);
+ ChipLogProgress(Zcl, "ERR: reading on/off %x", to_underlying(status));
return status;
}
@@ -357,7 +358,7 @@
if ((!currentValue && command == Commands::Off::Id) || (currentValue && command == Commands::On::Id))
{
ChipLogProgress(Zcl, "Endpoint %x On/off already set to new value", endpoint);
- return EMBER_ZCL_STATUS_SUCCESS;
+ return Status::Success;
}
// we either got a toggle, or an on when off, or an off when on,
@@ -396,9 +397,9 @@
// write the new on/off value
status = Attributes::OnOff::Set(endpoint, newValue);
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ if (status != Status::Success)
{
- ChipLogProgress(Zcl, "ERR: writing on/off %x", status);
+ ChipLogProgress(Zcl, "ERR: writing on/off %x", to_underlying(status));
return status;
}
@@ -416,7 +417,7 @@
emberAfContainsAttribute(endpoint, ModeSelect::Id, ModeSelect::Attributes::OnMode::Id))
{
ModeSelect::Attributes::OnMode::TypeInfo::Type onMode;
- if (ModeSelect::Attributes::OnMode::Get(endpoint, onMode) == EMBER_ZCL_STATUS_SUCCESS && !onMode.IsNull())
+ if (ModeSelect::Attributes::OnMode::Get(endpoint, onMode) == Status::Success && !onMode.IsNull())
{
ChipLogProgress(Zcl, "Changing Current Mode to %x", onMode.Value());
status = ModeSelect::Attributes::CurrentMode::Set(endpoint, onMode.Value());
@@ -442,9 +443,9 @@
{
// write the new on/off value
status = Attributes::OnOff::Set(endpoint, newValue);
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ if (status != Status::Success)
{
- ChipLogProgress(Zcl, "ERR: writing on/off %x", status);
+ ChipLogProgress(Zcl, "ERR: writing on/off %x", to_underlying(status));
return status;
}
@@ -466,7 +467,7 @@
// The returned status is based solely on the On/Off cluster. Errors in the
// Level Control and/or Scenes cluster are ignored.
- return EMBER_ZCL_STATUS_SUCCESS;
+ return Status::Success;
}
void OnOffServer::initOnOffServer(chip::EndpointId endpoint)
@@ -494,8 +495,8 @@
// null Set the OnOff attribute to its previous value.
bool onOffValueForStartUp = false;
- EmberAfStatus status = getOnOffValueForStartUp(endpoint, onOffValueForStartUp);
- if (status == EMBER_ZCL_STATUS_SUCCESS)
+ Status status = getOnOffValueForStartUp(endpoint, onOffValueForStartUp);
+ if (status == Status::Success)
{
status = setOnOffValue(endpoint, onOffValueForStartUp, true);
}
@@ -512,7 +513,7 @@
emberAfContainsAttribute(endpoint, ModeSelect::Id, ModeSelect::Attributes::OnMode::Id))
{
ModeSelect::Attributes::OnMode::TypeInfo::Type onMode;
- if (ModeSelect::Attributes::OnMode::Get(endpoint, onMode) == EMBER_ZCL_STATUS_SUCCESS && !onMode.IsNull())
+ if (ModeSelect::Attributes::OnMode::Get(endpoint, onMode) == Status::Success && !onMode.IsNull())
{
ChipLogProgress(Zcl, "Changing Current Mode to %x", onMode.Value());
status = ModeSelect::Attributes::CurrentMode::Set(endpoint, onMode.Value());
@@ -532,16 +533,16 @@
* @param endpoint Ver.: always
* @param onOffValueForStartUp Ver.: always
*/
-EmberAfStatus OnOffServer::getOnOffValueForStartUp(chip::EndpointId endpoint, bool & onOffValueForStartUp)
+Status OnOffServer::getOnOffValueForStartUp(chip::EndpointId endpoint, bool & onOffValueForStartUp)
{
app::DataModel::Nullable<OnOff::StartUpOnOffEnum> startUpOnOff;
- EmberAfStatus status = Attributes::StartUpOnOff::Get(endpoint, startUpOnOff);
- if (status == EMBER_ZCL_STATUS_SUCCESS)
+ Status status = Attributes::StartUpOnOff::Get(endpoint, startUpOnOff);
+ if (status == Status::Success)
{
// Initialise updated value to 0
bool updatedOnOff = false;
status = Attributes::OnOff::Get(endpoint, &updatedOnOff);
- if (status == EMBER_ZCL_STATUS_SUCCESS)
+ if (status == Status::Success)
{
if (!startUpOnOff.IsNull())
{
@@ -570,7 +571,7 @@
bool OnOffServer::offCommand(app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath)
{
MATTER_TRACE_SCOPE("OffCommand", "OnOff");
- EmberAfStatus status = setOnOffValue(commandPath.mEndpointId, Commands::Off::Id, false);
+ Status status = setOnOffValue(commandPath.mEndpointId, Commands::Off::Id, false);
commandObj->AddStatus(commandPath, status);
return true;
@@ -579,7 +580,7 @@
bool OnOffServer::onCommand(app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath)
{
MATTER_TRACE_SCOPE("OnCommand", "OnOff");
- EmberAfStatus status = setOnOffValue(commandPath.mEndpointId, Commands::On::Id, false);
+ Status status = setOnOffValue(commandPath.mEndpointId, Commands::On::Id, false);
commandObj->AddStatus(commandPath, status);
return true;
@@ -588,7 +589,7 @@
bool OnOffServer::toggleCommand(app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath)
{
MATTER_TRACE_SCOPE("ToggleCommand", "OnOff");
- EmberAfStatus status = setOnOffValue(commandPath.mEndpointId, Commands::Toggle::Id, false);
+ Status status = setOnOffValue(commandPath.mEndpointId, Commands::Toggle::Id, false);
commandObj->AddStatus(commandPath, status);
return true;
diff --git a/src/app/clusters/on-off-server/on-off-server.h b/src/app/clusters/on-off-server/on-off-server.h
index 26e62fb..2cb5b62 100644
--- a/src/app/clusters/on-off-server/on-off-server.h
+++ b/src/app/clusters/on-off-server/on-off-server.h
@@ -24,6 +24,7 @@
#include <app/util/af-types.h>
#include <app/util/basic-types.h>
#include <platform/CHIPDeviceConfig.h>
+#include <protocols/interaction_model/StatusCode.h>
/**********************************************************
* Defines and Macros
@@ -61,9 +62,10 @@
bool OnWithTimedOffCommand(chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath,
const chip::app::Clusters::OnOff::Commands::OnWithTimedOff::DecodableType & commandData);
void updateOnOffTimeCommand(chip::EndpointId endpoint);
- EmberAfStatus getOnOffValue(chip::EndpointId endpoint, bool * currentOnOffValue);
- EmberAfStatus setOnOffValue(chip::EndpointId endpoint, chip::CommandId command, bool initiatedByLevelChange);
- EmberAfStatus getOnOffValueForStartUp(chip::EndpointId endpoint, bool & onOffValueForStartUp);
+ chip::Protocols::InteractionModel::Status getOnOffValue(chip::EndpointId endpoint, bool * currentOnOffValue);
+ chip::Protocols::InteractionModel::Status setOnOffValue(chip::EndpointId endpoint, chip::CommandId command,
+ bool initiatedByLevelChange);
+ chip::Protocols::InteractionModel::Status getOnOffValueForStartUp(chip::EndpointId endpoint, bool & onOffValueForStartUp);
bool HasFeature(chip::EndpointId endpoint, Feature feature);
inline bool SupportsLightingApplications(chip::EndpointId endpointId) { return HasFeature(endpointId, Feature::kLighting); }
diff --git a/src/app/clusters/ota-requestor/DefaultOTARequestor.h b/src/app/clusters/ota-requestor/DefaultOTARequestor.h
index e0e45c2..025dc66 100644
--- a/src/app/clusters/ota-requestor/DefaultOTARequestor.h
+++ b/src/app/clusters/ota-requestor/DefaultOTARequestor.h
@@ -136,7 +136,7 @@
chip::Messaging::SendFlags sendFlags;
if (!event.msgTypeData.HasMessageType(chip::bdx::MessageType::BlockAckEOF) &&
- !event.msgTypeData.HasMessageType(chip::Protocols::SecureChannel::MsgType::StatusReport))
+ !event.msgTypeData.HasMessageType(Protocols::SecureChannel::MsgType::StatusReport))
{
sendFlags.Set(chip::Messaging::SendMessageFlags::kExpectResponse);
}
@@ -162,7 +162,7 @@
mDownloader->OnMessageReceived(payloadHeader, std::move(payload));
// For a receiver using BDX Protocol, all received messages will require a response except for a StatusReport
- if (!payloadHeader.HasMessageType(chip::Protocols::SecureChannel::MsgType::StatusReport))
+ if (!payloadHeader.HasMessageType(Protocols::SecureChannel::MsgType::StatusReport))
{
ec->WillSendMessage();
}
diff --git a/src/app/clusters/ota-requestor/ota-requestor-server.cpp b/src/app/clusters/ota-requestor/ota-requestor-server.cpp
index b5611b7..8f5d132 100644
--- a/src/app/clusters/ota-requestor/ota-requestor-server.cpp
+++ b/src/app/clusters/ota-requestor/ota-requestor-server.cpp
@@ -26,6 +26,7 @@
#include <app/clusters/ota-requestor/OTARequestorInterface.h>
#include <app/clusters/ota-requestor/ota-requestor-server.h>
#include <app/util/attribute-storage.h>
+#include <protocols/interaction_model/StatusCode.h>
using namespace chip;
using namespace chip::app;
@@ -147,54 +148,54 @@
// -----------------------------------------------------------------------------
// Global functions
-EmberAfStatus OtaRequestorServerSetUpdateState(OTAUpdateStateEnum value)
+Status OtaRequestorServerSetUpdateState(OTAUpdateStateEnum value)
{
- EmberAfStatus status = EMBER_ZCL_STATUS_SUCCESS;
+ Status status = Status::Success;
// Find all endpoints that have OtaSoftwareUpdateRequestor implemented
for (auto endpoint : EnabledEndpointsWithServerCluster(OtaSoftwareUpdateRequestor::Id))
{
OTAUpdateStateEnum currentValue;
status = Attributes::UpdateState::Get(endpoint, ¤tValue);
- VerifyOrDie(EMBER_ZCL_STATUS_SUCCESS == status);
+ VerifyOrDie(Status::Success == status);
if (currentValue != value)
{
status = Attributes::UpdateState::Set(endpoint, value);
- VerifyOrDie(EMBER_ZCL_STATUS_SUCCESS == status);
+ VerifyOrDie(Status::Success == status);
}
}
return status;
}
-EmberAfStatus OtaRequestorServerGetUpdateState(chip::EndpointId endpointId, OTAUpdateStateEnum & value)
+Status OtaRequestorServerGetUpdateState(chip::EndpointId endpointId, OTAUpdateStateEnum & value)
{
return Attributes::UpdateState::Get(endpointId, &value);
}
-EmberAfStatus OtaRequestorServerSetUpdateStateProgress(app::DataModel::Nullable<uint8_t> value)
+Status OtaRequestorServerSetUpdateStateProgress(app::DataModel::Nullable<uint8_t> value)
{
- EmberAfStatus status = EMBER_ZCL_STATUS_SUCCESS;
+ Status status = Status::Success;
// Find all endpoints that have OtaSoftwareUpdateRequestor implemented
for (auto endpoint : EnabledEndpointsWithServerCluster(OtaSoftwareUpdateRequestor::Id))
{
app::DataModel::Nullable<uint8_t> currentValue;
status = Attributes::UpdateStateProgress::Get(endpoint, currentValue);
- VerifyOrDie(EMBER_ZCL_STATUS_SUCCESS == status);
+ VerifyOrDie(Status::Success == status);
if (currentValue != value)
{
status = Attributes::UpdateStateProgress::Set(endpoint, value);
- VerifyOrDie(EMBER_ZCL_STATUS_SUCCESS == status);
+ VerifyOrDie(Status::Success == status);
}
}
return status;
}
-EmberAfStatus OtaRequestorServerGetUpdateStateProgress(chip::EndpointId endpointId, DataModel::Nullable<uint8_t> & value)
+Status OtaRequestorServerGetUpdateStateProgress(chip::EndpointId endpointId, DataModel::Nullable<uint8_t> & value)
{
return Attributes::UpdateStateProgress::Get(endpointId, value);
}
diff --git a/src/app/clusters/ota-requestor/ota-requestor-server.h b/src/app/clusters/ota-requestor/ota-requestor-server.h
index 323cb7b..b8874aa 100644
--- a/src/app/clusters/ota-requestor/ota-requestor-server.h
+++ b/src/app/clusters/ota-requestor/ota-requestor-server.h
@@ -19,13 +19,16 @@
#pragma once
#include <app-common/zap-generated/attributes/Accessors.h>
+#include <protocols/interaction_model/StatusCode.h>
-EmberAfStatus OtaRequestorServerSetUpdateState(chip::app::Clusters::OtaSoftwareUpdateRequestor::OTAUpdateStateEnum value);
-EmberAfStatus OtaRequestorServerGetUpdateState(chip::EndpointId endpointId,
- chip::app::Clusters::OtaSoftwareUpdateRequestor::OTAUpdateStateEnum & value);
-EmberAfStatus OtaRequestorServerSetUpdateStateProgress(chip::app::DataModel::Nullable<uint8_t> value);
-EmberAfStatus OtaRequestorServerGetUpdateStateProgress(chip::EndpointId endpointId,
- chip::app::DataModel::Nullable<uint8_t> & value);
+chip::Protocols::InteractionModel::Status
+OtaRequestorServerSetUpdateState(chip::app::Clusters::OtaSoftwareUpdateRequestor::OTAUpdateStateEnum value);
+chip::Protocols::InteractionModel::Status
+OtaRequestorServerGetUpdateState(chip::EndpointId endpointId,
+ chip::app::Clusters::OtaSoftwareUpdateRequestor::OTAUpdateStateEnum & value);
+chip::Protocols::InteractionModel::Status OtaRequestorServerSetUpdateStateProgress(chip::app::DataModel::Nullable<uint8_t> value);
+chip::Protocols::InteractionModel::Status OtaRequestorServerGetUpdateStateProgress(chip::EndpointId endpointId,
+ chip::app::DataModel::Nullable<uint8_t> & value);
void OtaRequestorServerOnStateTransition(chip::app::Clusters::OtaSoftwareUpdateRequestor::OTAUpdateStateEnum previousState,
chip::app::Clusters::OtaSoftwareUpdateRequestor::OTAUpdateStateEnum newState,
diff --git a/src/app/clusters/refrigerator-alarm-server/refrigerator-alarm-server.cpp b/src/app/clusters/refrigerator-alarm-server/refrigerator-alarm-server.cpp
index a7fd3ed..620e113 100644
--- a/src/app/clusters/refrigerator-alarm-server/refrigerator-alarm-server.cpp
+++ b/src/app/clusters/refrigerator-alarm-server/refrigerator-alarm-server.cpp
@@ -40,12 +40,12 @@
return instance;
}
-EmberAfStatus RefrigeratorAlarmServer::GetMaskValue(EndpointId endpoint, BitMask<AlarmMap> * mask)
+Status RefrigeratorAlarmServer::GetMaskValue(EndpointId endpoint, BitMask<AlarmMap> * mask)
{
- EmberAfStatus status = Attributes::Mask::Get(endpoint, mask);
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ Status status = Attributes::Mask::Get(endpoint, mask);
+ if (status != Status::Success)
{
- ChipLogProgress(Zcl, "Refrigerator Alarm: ERR: reading mask, err:0x%x", status);
+ ChipLogProgress(Zcl, "Refrigerator Alarm: ERR: reading mask, err:0x%x", to_underlying(status));
}
else
{
@@ -55,12 +55,12 @@
return status;
}
-EmberAfStatus RefrigeratorAlarmServer::GetStateValue(EndpointId endpoint, BitMask<AlarmMap> * state)
+Status RefrigeratorAlarmServer::GetStateValue(EndpointId endpoint, BitMask<AlarmMap> * state)
{
- EmberAfStatus status = Attributes::State::Get(endpoint, state);
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ Status status = Attributes::State::Get(endpoint, state);
+ if (status != Status::Success)
{
- ChipLogProgress(Zcl, "Refrigerator Alarm: ERR: reading state, err:0x%x", status);
+ ChipLogProgress(Zcl, "Refrigerator Alarm: ERR: reading state, err:0x%x", to_underlying(status));
}
else
{
@@ -70,12 +70,12 @@
return status;
}
-EmberAfStatus RefrigeratorAlarmServer::GetSupportedValue(EndpointId endpoint, BitMask<AlarmMap> * supported)
+Status RefrigeratorAlarmServer::GetSupportedValue(EndpointId endpoint, BitMask<AlarmMap> * supported)
{
- EmberAfStatus status = Attributes::Supported::Get(endpoint, supported);
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ Status status = Attributes::Supported::Get(endpoint, supported);
+ if (status != Status::Success)
{
- ChipLogProgress(Zcl, "Refrigerator Alarm: ERR: reading supported, err:0x%x", status);
+ ChipLogProgress(Zcl, "Refrigerator Alarm: ERR: reading supported, err:0x%x", to_underlying(status));
}
else
{
@@ -85,13 +85,13 @@
return status;
}
-EmberAfStatus RefrigeratorAlarmServer::SetMaskValue(EndpointId endpoint, const BitMask<AlarmMap> mask)
+Status RefrigeratorAlarmServer::SetMaskValue(EndpointId endpoint, const BitMask<AlarmMap> mask)
{
- EmberAfStatus status = EMBER_ZCL_STATUS_SUCCESS;
- status = Attributes::Mask::Set(endpoint, mask);
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ Status status = Status::Success;
+ status = Attributes::Mask::Set(endpoint, mask);
+ if (status != Status::Success)
{
- ChipLogProgress(Zcl, "Refrigerator Alarm: ERR: writing mask, err:0x%x", status);
+ ChipLogProgress(Zcl, "Refrigerator Alarm: ERR: writing mask, err:0x%x", to_underlying(status));
return status;
}
@@ -100,7 +100,7 @@
// Whenever there is change in Mask, State should change accordingly.
BitMask<AlarmMap> state;
status = GetStateValue(endpoint, &state);
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ if (status != Status::Success)
{
return status;
}
@@ -113,22 +113,22 @@
return status;
}
-EmberAfStatus RefrigeratorAlarmServer::SetStateValue(EndpointId endpoint, BitMask<AlarmMap> newState)
+Status RefrigeratorAlarmServer::SetStateValue(EndpointId endpoint, BitMask<AlarmMap> newState)
{
- EmberAfStatus status = EMBER_ZCL_STATUS_SUCCESS;
+ Status status = Status::Success;
BitMask<AlarmMap> currentState;
status = Attributes::State::Get(endpoint, ¤tState);
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ if (status != Status::Success)
{
- ChipLogProgress(Zcl, "Refrigerator Alarm: ERR: reading state, err:0x%x", status);
+ ChipLogProgress(Zcl, "Refrigerator Alarm: ERR: reading state, err:0x%x", to_underlying(status));
return status;
}
status = Attributes::State::Set(endpoint, newState);
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ if (status != Status::Success)
{
- ChipLogProgress(Zcl, "Refrigerator Alarm: ERR: writing state, err:0x%x", status);
+ ChipLogProgress(Zcl, "Refrigerator Alarm: ERR: writing state, err:0x%x", to_underlying(status));
return status;
}
@@ -143,7 +143,7 @@
BitMask<AlarmMap> mask;
status = GetMaskValue(endpoint, &mask);
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ if (status != Status::Success)
{
return status;
}
@@ -152,13 +152,13 @@
return status;
}
-EmberAfStatus RefrigeratorAlarmServer::SetSupportedValue(EndpointId endpoint, const BitMask<AlarmMap> supported)
+Status RefrigeratorAlarmServer::SetSupportedValue(EndpointId endpoint, const BitMask<AlarmMap> supported)
{
- EmberAfStatus status = EMBER_ZCL_STATUS_SUCCESS;
- status = Attributes::Supported::Set(endpoint, supported);
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ Status status = Status::Success;
+ status = Attributes::Supported::Set(endpoint, supported);
+ if (status != Status::Success)
{
- ChipLogProgress(Zcl, "Refrigerator Alarm: ERR: writing supported, err:0x%x", status);
+ ChipLogProgress(Zcl, "Refrigerator Alarm: ERR: writing supported, err:0x%x", to_underlying(status));
return status;
}
@@ -167,7 +167,7 @@
// Whenever there is change in Supported attribute, Mask, State should change accordingly.
BitMask<AlarmMap> mask;
status = GetMaskValue(endpoint, &mask);
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ if (status != Status::Success)
{
return status;
}
diff --git a/src/app/clusters/refrigerator-alarm-server/refrigerator-alarm-server.h b/src/app/clusters/refrigerator-alarm-server/refrigerator-alarm-server.h
index 1ed6023..65df99d 100644
--- a/src/app/clusters/refrigerator-alarm-server/refrigerator-alarm-server.h
+++ b/src/app/clusters/refrigerator-alarm-server/refrigerator-alarm-server.h
@@ -23,28 +23,31 @@
#include <app/util/af-types.h>
#include <app/util/basic-types.h>
#include <platform/CHIPDeviceConfig.h>
+#include <protocols/interaction_model/StatusCode.h>
class RefrigeratorAlarmServer
{
public:
static RefrigeratorAlarmServer & Instance();
- EmberAfStatus GetMaskValue(chip::EndpointId endpoint, chip::BitMask<chip::app::Clusters::RefrigeratorAlarm::AlarmMap> * mask);
- EmberAfStatus GetStateValue(chip::EndpointId endpoint, chip::BitMask<chip::app::Clusters::RefrigeratorAlarm::AlarmMap> * state);
- EmberAfStatus GetSupportedValue(chip::EndpointId endpoint,
- chip::BitMask<chip::app::Clusters::RefrigeratorAlarm::AlarmMap> * suppported);
+ chip::Protocols::InteractionModel::Status GetMaskValue(chip::EndpointId endpoint,
+ chip::BitMask<chip::app::Clusters::RefrigeratorAlarm::AlarmMap> * mask);
+ chip::Protocols::InteractionModel::Status
+ GetStateValue(chip::EndpointId endpoint, chip::BitMask<chip::app::Clusters::RefrigeratorAlarm::AlarmMap> * state);
+ chip::Protocols::InteractionModel::Status
+ GetSupportedValue(chip::EndpointId endpoint, chip::BitMask<chip::app::Clusters::RefrigeratorAlarm::AlarmMap> * suppported);
// A change in mask value will result in a corresponding change in state.
- EmberAfStatus SetMaskValue(chip::EndpointId endpoint,
- const chip::BitMask<chip::app::Clusters::RefrigeratorAlarm::AlarmMap> mask);
+ chip::Protocols::InteractionModel::Status
+ SetMaskValue(chip::EndpointId endpoint, const chip::BitMask<chip::app::Clusters::RefrigeratorAlarm::AlarmMap> mask);
// When State changes we are generating Notify event.
- EmberAfStatus SetStateValue(chip::EndpointId endpoint,
- chip::BitMask<chip::app::Clusters::RefrigeratorAlarm::AlarmMap> newState);
+ chip::Protocols::InteractionModel::Status
+ SetStateValue(chip::EndpointId endpoint, chip::BitMask<chip::app::Clusters::RefrigeratorAlarm::AlarmMap> newState);
// A change in supported value will result in a corresponding change in mask and state.
- EmberAfStatus SetSupportedValue(chip::EndpointId endpoint,
- const chip::BitMask<chip::app::Clusters::RefrigeratorAlarm::AlarmMap> supported);
+ chip::Protocols::InteractionModel::Status
+ SetSupportedValue(chip::EndpointId endpoint, const chip::BitMask<chip::app::Clusters::RefrigeratorAlarm::AlarmMap> supported);
private:
static RefrigeratorAlarmServer instance;
diff --git a/src/app/clusters/resource-monitoring-server/resource-monitoring-server.h b/src/app/clusters/resource-monitoring-server/resource-monitoring-server.h
index da17d36..8cdc74f 100644
--- a/src/app/clusters/resource-monitoring-server/resource-monitoring-server.h
+++ b/src/app/clusters/resource-monitoring-server/resource-monitoring-server.h
@@ -91,10 +91,10 @@
bool HasFeature(ResourceMonitoring::Feature aFeature) const;
// Attribute setters
- chip::Protocols::InteractionModel::Status UpdateCondition(uint8_t aNewCondition);
- chip::Protocols::InteractionModel::Status UpdateChangeIndication(ChangeIndicationEnum aNewChangeIndication);
- chip::Protocols::InteractionModel::Status UpdateInPlaceIndicator(bool aNewInPlaceIndicator);
- chip::Protocols::InteractionModel::Status UpdateLastChangedTime(DataModel::Nullable<uint32_t> aNewLastChangedTime);
+ Protocols::InteractionModel::Status UpdateCondition(uint8_t aNewCondition);
+ Protocols::InteractionModel::Status UpdateChangeIndication(ChangeIndicationEnum aNewChangeIndication);
+ Protocols::InteractionModel::Status UpdateInPlaceIndicator(bool aNewInPlaceIndicator);
+ Protocols::InteractionModel::Status UpdateLastChangedTime(DataModel::Nullable<uint32_t> aNewLastChangedTime);
void SetReplacementProductListManagerInstance(ReplacementProductListManager * instance);
@@ -196,7 +196,7 @@
* @return Status::Success If the command was handled successfully.
* @return All Other PreResetCondition() or PostResetCondition() failed, these are application specific.
*/
- virtual chip::Protocols::InteractionModel::Status OnResetCondition();
+ virtual Protocols::InteractionModel::Status OnResetCondition();
/**
* This method may be overwritten by the SDK User, if the SDK User wants to do something before the reset.
@@ -206,7 +206,7 @@
* @return Status::Success All good, the reset may proceed.
* @return All Other The reset should not proceed. The reset command will fail.
*/
- virtual chip::Protocols::InteractionModel::Status PreResetCondition();
+ virtual Protocols::InteractionModel::Status PreResetCondition();
/**
* This method may be overwritten by the SDK User, if the SDK User wants to do something after the reset.
@@ -217,7 +217,7 @@
* @return All Other Something went wrong. The attributes will already be updated. But the reset command will report
* the failure.
*/
- virtual chip::Protocols::InteractionModel::Status PostResetCondition();
+ virtual Protocols::InteractionModel::Status PostResetCondition();
};
} // namespace ResourceMonitoring
diff --git a/src/app/clusters/scenes-server/scenes-server.cpp b/src/app/clusters/scenes-server/scenes-server.cpp
index 330d7eb..a62427d 100644
--- a/src/app/clusters/scenes-server/scenes-server.cpp
+++ b/src/app/clusters/scenes-server/scenes-server.cpp
@@ -41,6 +41,7 @@
using SceneTable = chip::scenes::SceneTable<chip::scenes::ExtensionFieldSetsImpl>;
using AuthMode = chip::Access::AuthMode;
using ScenesServer = chip::app::Clusters::ScenesManagement::ScenesServer;
+using chip::Protocols::InteractionModel::Status;
namespace chip {
namespace app {
@@ -74,14 +75,14 @@
return err;
}
-/// @brief Generate and add a response to a command handler context depending on an EmberAfStatus
+/// @brief Generate and add a response to a command handler context depending on an InteractionModel::Status
/// @tparam ResponseType Type of response, depends on the command
/// @param ctx Command Handler context where to add reponse
/// @param resp Response to add in ctx
/// @param status Status to verify
-/// @return EmberAfStatus -> CHIP_ERROR
+/// @return InteractionModel::Status -> CHIP_ERROR
template <typename ResponseType>
-CHIP_ERROR AddResponseOnError(CommandHandlerInterface::HandlerContext & ctx, ResponseType & resp, EmberAfStatus status)
+CHIP_ERROR AddResponseOnError(CommandHandlerInterface::HandlerContext & ctx, ResponseType & resp, Status status)
{
return AddResponseOnError(ctx, resp, StatusIB(status).ToChipError());
}
@@ -90,7 +91,7 @@
CHIP_ERROR UpdateLastConfiguredBy(HandlerContext & ctx, ResponseType resp)
{
Access::SubjectDescriptor descriptor = ctx.mCommandHandler.GetSubjectDescriptor();
- EmberAfStatus status = EMBER_ZCL_STATUS_SUCCESS;
+ Status status = Status::Success;
if (AuthMode::kCase == descriptor.authMode)
{
@@ -102,7 +103,7 @@
}
// LastConfiguredBy is optional, so we don't want to fail the command if it fails to update
- VerifyOrReturnValue(!(EMBER_ZCL_STATUS_SUCCESS == status || EMBER_ZCL_STATUS_UNSUPPORTED_ATTRIBUTE == status), CHIP_NO_ERROR);
+ VerifyOrReturnValue(!(Status::Success == status || Status::UnsupportedAttribute == status), CHIP_NO_ERROR);
return AddResponseOnError(ctx, resp, status);
}
@@ -1108,8 +1109,8 @@
void emberAfScenesManagementClusterServerInitCallback(EndpointId endpoint)
{
- EmberAfStatus status = Attributes::LastConfiguredBy::SetNull(endpoint);
- if (EMBER_ZCL_STATUS_SUCCESS != status)
+ Status status = Attributes::LastConfiguredBy::SetNull(endpoint);
+ if (Status::Success != status)
{
ChipLogDetail(Zcl, "ERR: setting LastConfiguredBy on Endpoint %hu Status: %x", endpoint, status);
}
diff --git a/src/app/clusters/smoke-co-alarm-server/smoke-co-alarm-server.cpp b/src/app/clusters/smoke-co-alarm-server/smoke-co-alarm-server.cpp
index 2d5ae5f..5b3da15 100644
--- a/src/app/clusters/smoke-co-alarm-server/smoke-co-alarm-server.cpp
+++ b/src/app/clusters/smoke-co-alarm-server/smoke-co-alarm-server.cpp
@@ -467,11 +467,11 @@
template <typename T>
bool SmokeCoAlarmServer::GetAttribute(EndpointId endpointId, AttributeId attributeId,
- EmberAfStatus (*getFn)(EndpointId endpointId, T * value), T & value) const
+ Status (*getFn)(EndpointId endpointId, T * value), T & value) const
{
- EmberAfStatus status = getFn(endpointId, &value);
- bool success = (EMBER_ZCL_STATUS_SUCCESS == status);
- bool unsupportedStatus = (EMBER_ZCL_STATUS_UNSUPPORTED_ATTRIBUTE == status);
+ Status status = getFn(endpointId, &value);
+ bool success = (Status::Success == status);
+ bool unsupportedStatus = (Status::UnsupportedAttribute == status);
if (unsupportedStatus)
{
@@ -487,10 +487,10 @@
template <typename T>
bool SmokeCoAlarmServer::SetAttribute(EndpointId endpointId, AttributeId attributeId,
- EmberAfStatus (*setFn)(EndpointId endpointId, T value), T value)
+ Status (*setFn)(EndpointId endpointId, T value), T value)
{
- EmberAfStatus status = setFn(endpointId, value);
- bool success = (EMBER_ZCL_STATUS_SUCCESS == status);
+ Status status = setFn(endpointId, value);
+ bool success = (Status::Success == status);
if (!success)
{
diff --git a/src/app/clusters/smoke-co-alarm-server/smoke-co-alarm-server.h b/src/app/clusters/smoke-co-alarm-server/smoke-co-alarm-server.h
index 37bd1f6..42efc49 100644
--- a/src/app/clusters/smoke-co-alarm-server/smoke-co-alarm-server.h
+++ b/src/app/clusters/smoke-co-alarm-server/smoke-co-alarm-server.h
@@ -26,6 +26,7 @@
#include <app-common/zap-generated/cluster-objects.h>
#include <app/CommandHandler.h>
#include <app/util/af.h>
+#include <protocols/interaction_model/StatusCode.h>
/**
* @brief Smoke CO Alarm Server Plugin class
@@ -139,7 +140,7 @@
*/
template <typename T>
bool GetAttribute(chip::EndpointId endpointId, chip::AttributeId attributeId,
- EmberAfStatus (*getFn)(chip::EndpointId endpointId, T * value), T & value) const;
+ chip::Protocols::InteractionModel::Status (*getFn)(chip::EndpointId endpointId, T * value), T & value) const;
/**
* @brief Set generic attribute value
@@ -154,7 +155,7 @@
*/
template <typename T>
bool SetAttribute(chip::EndpointId endpointId, chip::AttributeId attributeId,
- EmberAfStatus (*setFn)(chip::EndpointId endpointId, T value), T value);
+ chip::Protocols::InteractionModel::Status (*setFn)(chip::EndpointId endpointId, T value), T value);
friend bool emberAfSmokeCoAlarmClusterSelfTestRequestCallback(
chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath,
diff --git a/src/app/clusters/temperature-control-server/temperature-control-server.cpp b/src/app/clusters/temperature-control-server/temperature-control-server.cpp
index 6217288..9194c16 100644
--- a/src/app/clusters/temperature-control-server/temperature-control-server.cpp
+++ b/src/app/clusters/temperature-control-server/temperature-control-server.cpp
@@ -99,7 +99,7 @@
{
bool success;
uint32_t featureMap;
- success = (Attributes::FeatureMap::Get(endpoint, &featureMap) == EMBER_ZCL_STATUS_SUCCESS);
+ success = (Attributes::FeatureMap::Get(endpoint, &featureMap) == Status::Success);
return success ? ((featureMap & to_underlying(feature)) != 0) : false;
}
@@ -116,7 +116,6 @@
auto & targetTemperatureLevel = commandData.targetTemperatureLevel;
EndpointId endpoint = commandPath.mEndpointId;
Status status = Status::Success;
- EmberAfStatus emberAfStatus = EMBER_ZCL_STATUS_SUCCESS;
if (TemperatureControlHasFeature(endpoint, Feature::kTemperatureNumber) &&
TemperatureControlHasFeature(endpoint, Feature::kTemperatureLevel))
@@ -130,17 +129,15 @@
{
int16_t minTemperature = 0;
int16_t maxTemperature = 0;
- emberAfStatus = MinTemperature::Get(endpoint, &minTemperature);
- if (emberAfStatus != EMBER_ZCL_STATUS_SUCCESS)
+ status = MinTemperature::Get(endpoint, &minTemperature);
+ if (status != Status::Success)
{
- status = emberAfStatus;
goto exit;
}
- emberAfStatus = MaxTemperature::Get(endpoint, &maxTemperature);
- if (emberAfStatus != EMBER_ZCL_STATUS_SUCCESS)
+ status = MaxTemperature::Get(endpoint, &maxTemperature);
+ if (status != Status::Success)
{
- status = emberAfStatus;
goto exit;
}
@@ -151,11 +148,10 @@
}
if (TemperatureControlHasFeature(endpoint, TemperatureControl::Feature::kTemperatureStep))
{
- int16_t step = 0;
- emberAfStatus = Step::Get(endpoint, &step);
- if (emberAfStatus != EMBER_ZCL_STATUS_SUCCESS)
+ int16_t step = 0;
+ status = Step::Get(endpoint, &step);
+ if (status != Status::Success)
{
- status = emberAfStatus;
goto exit;
}
@@ -165,8 +161,8 @@
goto exit;
}
}
- emberAfStatus = TemperatureSetpoint::Set(endpoint, targetTemperature.Value());
- if (emberAfStatus != EMBER_ZCL_STATUS_SUCCESS)
+ status = TemperatureSetpoint::Set(endpoint, targetTemperature.Value());
+ if (status != Status::Success)
{
/**
* If the server is unable to execute the command at the time the command is received
@@ -199,8 +195,8 @@
if (targetTemperatureLevel.Value() < size)
{
- emberAfStatus = SelectedTemperatureLevel::Set(endpoint, targetTemperatureLevel.Value());
- if (emberAfStatus != EMBER_ZCL_STATUS_SUCCESS)
+ status = SelectedTemperatureLevel::Set(endpoint, targetTemperatureLevel.Value());
+ if (status != Status::Success)
{
/**
* If the server is unable to execute the command at the time the command is received
diff --git a/src/app/clusters/thermostat-server/thermostat-server.cpp b/src/app/clusters/thermostat-server/thermostat-server.cpp
index 780d244..c0e4359 100644
--- a/src/app/clusters/thermostat-server/thermostat-server.cpp
+++ b/src/app/clusters/thermostat-server/thermostat-server.cpp
@@ -82,7 +82,7 @@
VerifyOrDie(aPath.mClusterId == Thermostat::Id);
uint32_t ourFeatureMap;
- bool localTemperatureNotExposedSupported = (FeatureMap::Get(aPath.mEndpointId, &ourFeatureMap) == EMBER_ZCL_STATUS_SUCCESS) &&
+ bool localTemperatureNotExposedSupported = (FeatureMap::Get(aPath.mEndpointId, &ourFeatureMap) == imcode::Success) &&
((ourFeatureMap & to_underlying(Feature::kLocalTemperatureNotExposed)) != 0);
switch (aPath.mAttributeId)
@@ -97,8 +97,8 @@
if (localTemperatureNotExposedSupported)
{
BitMask<RemoteSensingBitmap> valueRemoteSensing;
- EmberAfStatus status = RemoteSensing::Get(aPath.mEndpointId, &valueRemoteSensing);
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ imcode status = RemoteSensing::Get(aPath.mEndpointId, &valueRemoteSensing);
+ if (status != imcode::Success)
{
StatusIB statusIB(status);
return statusIB.ToChipError();
@@ -139,7 +139,7 @@
VerifyOrDie(aPath.mClusterId == Thermostat::Id);
uint32_t ourFeatureMap;
- bool localTemperatureNotExposedSupported = (FeatureMap::Get(aPath.mEndpointId, &ourFeatureMap) == EMBER_ZCL_STATUS_SUCCESS) &&
+ bool localTemperatureNotExposedSupported = (FeatureMap::Get(aPath.mEndpointId, &ourFeatureMap) == imcode::Success) &&
((ourFeatureMap & to_underlying(Feature::kLocalTemperatureNotExposed)) != 0);
switch (aPath.mAttributeId)
@@ -153,8 +153,7 @@
{
return CHIP_IM_GLOBAL_STATUS(ConstraintError);
}
-
- EmberAfStatus status = RemoteSensing::Set(aPath.mEndpointId, valueRemoteSensing);
+ imcode status = RemoteSensing::Set(aPath.mEndpointId, valueRemoteSensing);
StatusIB statusIB(status);
return statusIB.ToChipError();
}
@@ -226,7 +225,7 @@
bool CoolSupported = false;
bool OccupancySupported = false;
- if (FeatureMap::Get(endpoint, &OurFeatureMap) != EMBER_ZCL_STATUS_SUCCESS)
+ if (FeatureMap::Get(endpoint, &OurFeatureMap) != imcode::Success)
OurFeatureMap = FEATURE_MAP_DEFAULT;
if (OurFeatureMap & 1 << 5) // Bit 5 is Auto Mode supported
@@ -243,60 +242,60 @@
if (AutoSupported)
{
- if (MinSetpointDeadBand::Get(endpoint, &DeadBand) != EMBER_ZCL_STATUS_SUCCESS)
+ if (MinSetpointDeadBand::Get(endpoint, &DeadBand) != imcode::Success)
{
DeadBand = kDefaultDeadBand;
}
DeadBandTemp = static_cast<int16_t>(DeadBand * 10);
}
- if (AbsMinCoolSetpointLimit::Get(endpoint, &AbsMinCoolSetpointLimit) != EMBER_ZCL_STATUS_SUCCESS)
+ if (AbsMinCoolSetpointLimit::Get(endpoint, &AbsMinCoolSetpointLimit) != imcode::Success)
AbsMinCoolSetpointLimit = kDefaultAbsMinCoolSetpointLimit;
- if (AbsMaxCoolSetpointLimit::Get(endpoint, &AbsMaxCoolSetpointLimit) != EMBER_ZCL_STATUS_SUCCESS)
+ if (AbsMaxCoolSetpointLimit::Get(endpoint, &AbsMaxCoolSetpointLimit) != imcode::Success)
AbsMaxCoolSetpointLimit = kDefaultAbsMaxCoolSetpointLimit;
- if (MinCoolSetpointLimit::Get(endpoint, &MinCoolSetpointLimit) != EMBER_ZCL_STATUS_SUCCESS)
+ if (MinCoolSetpointLimit::Get(endpoint, &MinCoolSetpointLimit) != imcode::Success)
MinCoolSetpointLimit = AbsMinCoolSetpointLimit;
- if (MaxCoolSetpointLimit::Get(endpoint, &MaxCoolSetpointLimit) != EMBER_ZCL_STATUS_SUCCESS)
+ if (MaxCoolSetpointLimit::Get(endpoint, &MaxCoolSetpointLimit) != imcode::Success)
MaxCoolSetpointLimit = AbsMaxCoolSetpointLimit;
- if (AbsMinHeatSetpointLimit::Get(endpoint, &AbsMinHeatSetpointLimit) != EMBER_ZCL_STATUS_SUCCESS)
+ if (AbsMinHeatSetpointLimit::Get(endpoint, &AbsMinHeatSetpointLimit) != imcode::Success)
AbsMinHeatSetpointLimit = kDefaultAbsMinHeatSetpointLimit;
- if (AbsMaxHeatSetpointLimit::Get(endpoint, &AbsMaxHeatSetpointLimit) != EMBER_ZCL_STATUS_SUCCESS)
+ if (AbsMaxHeatSetpointLimit::Get(endpoint, &AbsMaxHeatSetpointLimit) != imcode::Success)
AbsMaxHeatSetpointLimit = kDefaultAbsMaxHeatSetpointLimit;
- if (MinHeatSetpointLimit::Get(endpoint, &MinHeatSetpointLimit) != EMBER_ZCL_STATUS_SUCCESS)
+ if (MinHeatSetpointLimit::Get(endpoint, &MinHeatSetpointLimit) != imcode::Success)
MinHeatSetpointLimit = AbsMinHeatSetpointLimit;
- if (MaxHeatSetpointLimit::Get(endpoint, &MaxHeatSetpointLimit) != EMBER_ZCL_STATUS_SUCCESS)
+ if (MaxHeatSetpointLimit::Get(endpoint, &MaxHeatSetpointLimit) != imcode::Success)
MaxHeatSetpointLimit = AbsMaxHeatSetpointLimit;
if (CoolSupported)
- if (OccupiedCoolingSetpoint::Get(endpoint, &OccupiedCoolingSetpoint) != EMBER_ZCL_STATUS_SUCCESS)
+ if (OccupiedCoolingSetpoint::Get(endpoint, &OccupiedCoolingSetpoint) != imcode::Success)
{
ChipLogError(Zcl, "Error: Can not read Occupied Cooling Setpoint");
return imcode::Failure;
}
if (HeatSupported)
- if (OccupiedHeatingSetpoint::Get(endpoint, &OccupiedHeatingSetpoint) != EMBER_ZCL_STATUS_SUCCESS)
+ if (OccupiedHeatingSetpoint::Get(endpoint, &OccupiedHeatingSetpoint) != imcode::Success)
{
ChipLogError(Zcl, "Error: Can not read Occupied Heating Setpoint");
return imcode::Failure;
}
if (CoolSupported && OccupancySupported)
- if (UnoccupiedCoolingSetpoint::Get(endpoint, &UnoccupiedCoolingSetpoint) != EMBER_ZCL_STATUS_SUCCESS)
+ if (UnoccupiedCoolingSetpoint::Get(endpoint, &UnoccupiedCoolingSetpoint) != imcode::Success)
{
ChipLogError(Zcl, "Error: Can not read Unoccupied Cooling Setpoint");
return imcode::Failure;
}
if (HeatSupported && OccupancySupported)
- if (UnoccupiedHeatingSetpoint::Get(endpoint, &UnoccupiedHeatingSetpoint) != EMBER_ZCL_STATUS_SUCCESS)
+ if (UnoccupiedHeatingSetpoint::Get(endpoint, &UnoccupiedHeatingSetpoint) != imcode::Success)
{
ChipLogError(Zcl, "Error: Can not read Unoccupied Heating Setpoint");
return imcode::Failure;
@@ -434,8 +433,8 @@
case SystemMode::Id: {
ControlSequenceOfOperationEnum ControlSequenceOfOperation;
- EmberAfStatus status = ControlSequenceOfOperation::Get(endpoint, &ControlSequenceOfOperation);
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ imcode status = ControlSequenceOfOperation::Get(endpoint, &ControlSequenceOfOperation);
+ if (status != imcode::Success)
{
return imcode::InvalidValue;
}
@@ -566,7 +565,7 @@
// Note that the limits are initialized above per the spec limits
// if they are not present Get() will not update the value so the defaults are used
- EmberAfStatus status;
+ imcode status;
// https://github.com/CHIP-Specifications/connectedhomeip-spec/issues/3724
// behavior is not specified when Abs * values are not present and user values are present
@@ -576,24 +575,24 @@
// if a attribute is not present then it's default shall be used.
status = AbsMinHeatSetpointLimit::Get(endpoint, &AbsMinHeatSetpointLimit);
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ if (status != imcode::Success)
{
ChipLogError(Zcl, "Warning: AbsMinHeatSetpointLimit missing using default");
}
status = AbsMaxHeatSetpointLimit::Get(endpoint, &AbsMaxHeatSetpointLimit);
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ if (status != imcode::Success)
{
ChipLogError(Zcl, "Warning: AbsMaxHeatSetpointLimit missing using default");
}
status = MinHeatSetpointLimit::Get(endpoint, &MinHeatSetpointLimit);
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ if (status != imcode::Success)
{
MinHeatSetpointLimit = AbsMinHeatSetpointLimit;
}
status = MaxHeatSetpointLimit::Get(endpoint, &MaxHeatSetpointLimit);
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ if (status != imcode::Success)
{
MaxHeatSetpointLimit = AbsMaxHeatSetpointLimit;
}
@@ -637,7 +636,7 @@
// Note that the limits are initialized above per the spec limits
// if they are not present Get() will not update the value so the defaults are used
- EmberAfStatus status;
+ imcode status;
// https://github.com/CHIP-Specifications/connectedhomeip-spec/issues/3724
// behavior is not specified when Abs * values are not present and user values are present
@@ -647,25 +646,25 @@
// if a attribute is not present then it's default shall be used.
status = AbsMinCoolSetpointLimit::Get(endpoint, &AbsMinCoolSetpointLimit);
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ if (status != imcode::Success)
{
ChipLogError(Zcl, "Warning: AbsMinCoolSetpointLimit missing using default");
}
status = AbsMaxCoolSetpointLimit::Get(endpoint, &AbsMaxCoolSetpointLimit);
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ if (status != imcode::Success)
{
ChipLogError(Zcl, "Warning: AbsMaxCoolSetpointLimit missing using default");
}
status = MinCoolSetpointLimit::Get(endpoint, &MinCoolSetpointLimit);
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ if (status != imcode::Success)
{
MinCoolSetpointLimit = AbsMinCoolSetpointLimit;
}
status = MaxCoolSetpointLimit::Get(endpoint, &MaxCoolSetpointLimit);
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ if (status != imcode::Success)
{
MaxCoolSetpointLimit = AbsMaxCoolSetpointLimit;
}
@@ -702,17 +701,17 @@
EndpointId aEndpointId = commandPath.mEndpointId;
int16_t HeatingSetpoint = kDefaultHeatingSetpoint, CoolingSetpoint = kDefaultCoolingSetpoint; // Set to defaults to be safe
- EmberAfStatus status = EMBER_ZCL_STATUS_FAILURE;
- EmberAfStatus WriteCoolingSetpointStatus = EMBER_ZCL_STATUS_FAILURE;
- EmberAfStatus WriteHeatingSetpointStatus = EMBER_ZCL_STATUS_FAILURE;
- int16_t DeadBandTemp = 0;
- int8_t DeadBand = 0;
+ imcode status = imcode::Failure;
+ imcode WriteCoolingSetpointStatus = imcode::Failure;
+ imcode WriteHeatingSetpointStatus = imcode::Failure;
+ int16_t DeadBandTemp = 0;
+ int8_t DeadBand = 0;
uint32_t OurFeatureMap;
bool AutoSupported = false;
bool HeatSupported = false;
bool CoolSupported = false;
- if (FeatureMap::Get(aEndpointId, &OurFeatureMap) != EMBER_ZCL_STATUS_SUCCESS)
+ if (FeatureMap::Get(aEndpointId, &OurFeatureMap) != imcode::Success)
OurFeatureMap = FEATURE_MAP_DEFAULT;
if (OurFeatureMap & 1 << 5) // Bit 5 is Auto Mode supported
@@ -726,7 +725,7 @@
if (AutoSupported)
{
- if (MinSetpointDeadBand::Get(aEndpointId, &DeadBand) != EMBER_ZCL_STATUS_SUCCESS)
+ if (MinSetpointDeadBand::Get(aEndpointId, &DeadBand) != imcode::Success)
DeadBand = kDefaultDeadBand;
DeadBandTemp = static_cast<int16_t>(DeadBand * 10);
}
@@ -737,13 +736,13 @@
if (HeatSupported && CoolSupported)
{
int16_t DesiredCoolingSetpoint, CoolLimit, DesiredHeatingSetpoint, HeatLimit;
- if (OccupiedCoolingSetpoint::Get(aEndpointId, &CoolingSetpoint) == EMBER_ZCL_STATUS_SUCCESS)
+ if (OccupiedCoolingSetpoint::Get(aEndpointId, &CoolingSetpoint) == imcode::Success)
{
DesiredCoolingSetpoint = static_cast<int16_t>(CoolingSetpoint + amount * 10);
CoolLimit = static_cast<int16_t>(DesiredCoolingSetpoint -
EnforceCoolingSetpointLimits(DesiredCoolingSetpoint, aEndpointId));
{
- if (OccupiedHeatingSetpoint::Get(aEndpointId, &HeatingSetpoint) == EMBER_ZCL_STATUS_SUCCESS)
+ if (OccupiedHeatingSetpoint::Get(aEndpointId, &HeatingSetpoint) == imcode::Success)
{
DesiredHeatingSetpoint = static_cast<int16_t>(HeatingSetpoint + amount * 10);
HeatLimit = static_cast<int16_t>(DesiredHeatingSetpoint -
@@ -765,12 +764,12 @@
}
}
WriteCoolingSetpointStatus = OccupiedCoolingSetpoint::Set(aEndpointId, DesiredCoolingSetpoint);
- if (WriteCoolingSetpointStatus != EMBER_ZCL_STATUS_SUCCESS)
+ if (WriteCoolingSetpointStatus != imcode::Success)
{
ChipLogError(Zcl, "Error: SetOccupiedCoolingSetpoint failed!");
}
WriteHeatingSetpointStatus = OccupiedHeatingSetpoint::Set(aEndpointId, DesiredHeatingSetpoint);
- if (WriteHeatingSetpointStatus != EMBER_ZCL_STATUS_SUCCESS)
+ if (WriteHeatingSetpointStatus != imcode::Success)
{
ChipLogError(Zcl, "Error: SetOccupiedHeatingSetpoint failed!");
}
@@ -782,12 +781,12 @@
if (CoolSupported && !HeatSupported)
{
- if (OccupiedCoolingSetpoint::Get(aEndpointId, &CoolingSetpoint) == EMBER_ZCL_STATUS_SUCCESS)
+ if (OccupiedCoolingSetpoint::Get(aEndpointId, &CoolingSetpoint) == imcode::Success)
{
CoolingSetpoint = static_cast<int16_t>(CoolingSetpoint + amount * 10);
CoolingSetpoint = EnforceCoolingSetpointLimits(CoolingSetpoint, aEndpointId);
WriteCoolingSetpointStatus = OccupiedCoolingSetpoint::Set(aEndpointId, CoolingSetpoint);
- if (WriteCoolingSetpointStatus != EMBER_ZCL_STATUS_SUCCESS)
+ if (WriteCoolingSetpointStatus != imcode::Success)
{
ChipLogError(Zcl, "Error: SetOccupiedCoolingSetpoint failed!");
}
@@ -796,34 +795,34 @@
if (HeatSupported && !CoolSupported)
{
- if (OccupiedHeatingSetpoint::Get(aEndpointId, &HeatingSetpoint) == EMBER_ZCL_STATUS_SUCCESS)
+ if (OccupiedHeatingSetpoint::Get(aEndpointId, &HeatingSetpoint) == imcode::Success)
{
HeatingSetpoint = static_cast<int16_t>(HeatingSetpoint + amount * 10);
HeatingSetpoint = EnforceHeatingSetpointLimits(HeatingSetpoint, aEndpointId);
WriteHeatingSetpointStatus = OccupiedHeatingSetpoint::Set(aEndpointId, HeatingSetpoint);
- if (WriteHeatingSetpointStatus != EMBER_ZCL_STATUS_SUCCESS)
+ if (WriteHeatingSetpointStatus != imcode::Success)
{
ChipLogError(Zcl, "Error: SetOccupiedHeatingSetpoint failed!");
}
}
}
- if ((!HeatSupported || WriteHeatingSetpointStatus == EMBER_ZCL_STATUS_SUCCESS) &&
- (!CoolSupported || WriteCoolingSetpointStatus == EMBER_ZCL_STATUS_SUCCESS))
- status = EMBER_ZCL_STATUS_SUCCESS;
+ if ((!HeatSupported || WriteHeatingSetpointStatus == imcode::Success) &&
+ (!CoolSupported || WriteCoolingSetpointStatus == imcode::Success))
+ status = imcode::Success;
break;
case SetpointRaiseLowerModeEnum::kCool:
if (CoolSupported)
{
- if (OccupiedCoolingSetpoint::Get(aEndpointId, &CoolingSetpoint) == EMBER_ZCL_STATUS_SUCCESS)
+ if (OccupiedCoolingSetpoint::Get(aEndpointId, &CoolingSetpoint) == imcode::Success)
{
CoolingSetpoint = static_cast<int16_t>(CoolingSetpoint + amount * 10);
CoolingSetpoint = EnforceCoolingSetpointLimits(CoolingSetpoint, aEndpointId);
if (AutoSupported)
{
// Need to check if we can move the cooling setpoint while maintaining the dead band
- if (OccupiedHeatingSetpoint::Get(aEndpointId, &HeatingSetpoint) == EMBER_ZCL_STATUS_SUCCESS)
+ if (OccupiedHeatingSetpoint::Get(aEndpointId, &HeatingSetpoint) == imcode::Success)
{
if (CoolingSetpoint - HeatingSetpoint < DeadBandTemp)
{
@@ -834,10 +833,10 @@
{
// Desired cooling setpoint is enforcable
// Set the new cooling and heating setpoints
- if (OccupiedHeatingSetpoint::Set(aEndpointId, HeatingSetpoint) == EMBER_ZCL_STATUS_SUCCESS)
+ if (OccupiedHeatingSetpoint::Set(aEndpointId, HeatingSetpoint) == imcode::Success)
{
- if (OccupiedCoolingSetpoint::Set(aEndpointId, CoolingSetpoint) == EMBER_ZCL_STATUS_SUCCESS)
- status = EMBER_ZCL_STATUS_SUCCESS;
+ if (OccupiedCoolingSetpoint::Set(aEndpointId, CoolingSetpoint) == imcode::Success)
+ status = imcode::Success;
}
else
ChipLogError(Zcl, "Error: SetOccupiedHeatingSetpoint failed!");
@@ -845,7 +844,7 @@
else
{
ChipLogError(Zcl, "Error: Could Not adjust heating setpoint to maintain dead band!");
- status = EMBER_ZCL_STATUS_INVALID_COMMAND;
+ status = imcode::InvalidCommand;
}
}
else
@@ -863,20 +862,20 @@
ChipLogError(Zcl, "Error: GetOccupiedCoolingSetpoint failed!");
}
else
- status = EMBER_ZCL_STATUS_INVALID_COMMAND;
+ status = imcode::InvalidCommand;
break;
case SetpointRaiseLowerModeEnum::kHeat:
if (HeatSupported)
{
- if (OccupiedHeatingSetpoint::Get(aEndpointId, &HeatingSetpoint) == EMBER_ZCL_STATUS_SUCCESS)
+ if (OccupiedHeatingSetpoint::Get(aEndpointId, &HeatingSetpoint) == imcode::Success)
{
HeatingSetpoint = static_cast<int16_t>(HeatingSetpoint + amount * 10);
HeatingSetpoint = EnforceHeatingSetpointLimits(HeatingSetpoint, aEndpointId);
if (AutoSupported)
{
// Need to check if we can move the cooling setpoint while maintaining the dead band
- if (OccupiedCoolingSetpoint::Get(aEndpointId, &CoolingSetpoint) == EMBER_ZCL_STATUS_SUCCESS)
+ if (OccupiedCoolingSetpoint::Get(aEndpointId, &CoolingSetpoint) == imcode::Success)
{
if (CoolingSetpoint - HeatingSetpoint < DeadBandTemp)
{
@@ -887,10 +886,10 @@
{
// Desired cooling setpoint is enforcable
// Set the new cooling and heating setpoints
- if (OccupiedCoolingSetpoint::Set(aEndpointId, CoolingSetpoint) == EMBER_ZCL_STATUS_SUCCESS)
+ if (OccupiedCoolingSetpoint::Set(aEndpointId, CoolingSetpoint) == imcode::Success)
{
- if (OccupiedHeatingSetpoint::Set(aEndpointId, HeatingSetpoint) == EMBER_ZCL_STATUS_SUCCESS)
- status = EMBER_ZCL_STATUS_SUCCESS;
+ if (OccupiedHeatingSetpoint::Set(aEndpointId, HeatingSetpoint) == imcode::Success)
+ status = imcode::Success;
}
else
ChipLogError(Zcl, "Error: SetOccupiedCoolingSetpoint failed!");
@@ -898,7 +897,7 @@
else
{
ChipLogError(Zcl, "Error: Could Not adjust cooling setpoint to maintain dead band!");
- status = EMBER_ZCL_STATUS_INVALID_COMMAND;
+ status = imcode::InvalidCommand;
}
}
else
@@ -916,11 +915,11 @@
ChipLogError(Zcl, "Error: GetOccupiedHeatingSetpoint failed!");
}
else
- status = EMBER_ZCL_STATUS_INVALID_COMMAND;
+ status = imcode::InvalidCommand;
break;
default:
- status = EMBER_ZCL_STATUS_INVALID_COMMAND;
+ status = imcode::InvalidCommand;
break;
}
diff --git a/src/app/clusters/time-format-localization-server/time-format-localization-server.cpp b/src/app/clusters/time-format-localization-server/time-format-localization-server.cpp
index 8539566..08e9020 100644
--- a/src/app/clusters/time-format-localization-server/time-format-localization-server.cpp
+++ b/src/app/clusters/time-format-localization-server/time-format-localization-server.cpp
@@ -39,6 +39,8 @@
using namespace chip::app::Clusters::TimeFormatLocalization::Attributes;
using namespace chip::DeviceLayer;
+using chip::Protocols::InteractionModel::Status;
+
namespace {
class TimeFormatLocalizationAttrAccess : public AttributeAccessInterface
@@ -202,18 +204,18 @@
{
CalendarTypeEnum calendarType;
CalendarTypeEnum validType;
- EmberAfStatus status = ActiveCalendarType::Get(endpoint, &calendarType);
+ Status status = ActiveCalendarType::Get(endpoint, &calendarType);
- VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status,
- ChipLogError(Zcl, "Failed to read calendar type with error: 0x%02x", status));
+ VerifyOrReturn(Status::Success == status,
+ ChipLogError(Zcl, "Failed to read calendar type with error: 0x%02x", to_underlying(status)));
// We could have an invalid calendar type value if an OTA update removed support for the value we were using.
// If initial value is not one of the allowed values, pick one valid value and write it.
if (!IsSupportedCalendarType(calendarType, validType))
{
status = ActiveCalendarType::Set(endpoint, validType);
- VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status,
- ChipLogError(Zcl, "Failed to write calendar type with error: 0x%02x", status));
+ VerifyOrReturn(Status::Success == status,
+ ChipLogError(Zcl, "Failed to write calendar type with error: 0x%02x", to_underlying(status)));
}
}
diff --git a/src/app/clusters/time-synchronization-server/time-synchronization-server.cpp b/src/app/clusters/time-synchronization-server/time-synchronization-server.cpp
index 8e919ef..cc6c3f5 100644
--- a/src/app/clusters/time-synchronization-server/time-synchronization-server.cpp
+++ b/src/app/clusters/time-synchronization-server/time-synchronization-server.cpp
@@ -380,9 +380,9 @@
}
return;
}
- mGranularity = granularity;
- EmberAfStatus status = TimeSource::Set(kRootEndpointId, timeSource);
- if (!(status == EMBER_ZCL_STATUS_SUCCESS || status == EMBER_ZCL_STATUS_UNSUPPORTED_ATTRIBUTE))
+ mGranularity = granularity;
+ Status status = TimeSource::Set(kRootEndpointId, timeSource);
+ if (!(status == Status::Success || status == Status::UnsupportedAttribute))
{
ChipLogError(Zcl, "Writing TimeSource failed.");
}
@@ -394,8 +394,8 @@
{
mGranularity = GranularityEnum::kMillisecondsGranularity;
// Non-matter SNTP because we know it's external and there's only one source
- EmberAfStatus status = TimeSource::Set(kRootEndpointId, TimeSourceEnum::kNonMatterSNTP);
- if (!(status == EMBER_ZCL_STATUS_SUCCESS || status == EMBER_ZCL_STATUS_UNSUPPORTED_ATTRIBUTE))
+ Status status = TimeSource::Set(kRootEndpointId, TimeSourceEnum::kNonMatterSNTP);
+ if (!(status == Status::Success || status == Status::UnsupportedAttribute))
{
ChipLogError(Zcl, "Writing TimeSource failed.");
}
@@ -777,9 +777,9 @@
return err;
}
GetDelegate()->UTCTimeAvailabilityChanged(utcTime);
- mGranularity = granularity;
- EmberAfStatus status = TimeSource::Set(ep, source);
- if (!(status == EMBER_ZCL_STATUS_SUCCESS || status == EMBER_ZCL_STATUS_UNSUPPORTED_ATTRIBUTE))
+ mGranularity = granularity;
+ Status status = TimeSource::Set(ep, source);
+ if (!(status == Status::Success || status == Status::UnsupportedAttribute))
{
ChipLogError(Zcl, "Writing TimeSource failed.");
return CHIP_IM_GLOBAL_STATUS(Failure);
@@ -1264,7 +1264,7 @@
return true;
}
bool dnsResolve;
- if (EMBER_ZCL_STATUS_SUCCESS != SupportsDNSResolve::Get(commandPath.mEndpointId, &dnsResolve))
+ if (Status::Success != SupportsDNSResolve::Get(commandPath.mEndpointId, &dnsResolve))
{
commandObj->AddStatus(commandPath, Status::Failure);
return true;
diff --git a/src/app/clusters/window-covering-server/window-covering-server.cpp b/src/app/clusters/window-covering-server/window-covering-server.cpp
index 1b47b9c..ba7d74c 100644
--- a/src/app/clusters/window-covering-server/window-covering-server.cpp
+++ b/src/app/clusters/window-covering-server/window-covering-server.cpp
@@ -118,8 +118,8 @@
bool hasFeature = false;
uint32_t featureMap = 0;
- EmberAfStatus status = Attributes::FeatureMap::Get(endpoint, &featureMap);
- if (EMBER_ZCL_STATUS_SUCCESS == status)
+ Status status = Attributes::FeatureMap::Get(endpoint, &featureMap);
+ if (Status::Success == status)
{
hasFeature = (featureMap & chip::to_underlying(feature));
}
diff --git a/src/app/server/Server.h b/src/app/server/Server.h
index 5e51254..302471b 100644
--- a/src/app/server/Server.h
+++ b/src/app/server/Server.h
@@ -609,7 +609,7 @@
FabricTable mFabrics;
secure_channel::MessageCounterManager mMessageCounterManager;
#if CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONER_DISCOVERY_CLIENT
- chip::Protocols::UserDirectedCommissioning::UserDirectedCommissioningClient * gUDCClient = nullptr;
+ Protocols::UserDirectedCommissioning::UserDirectedCommissioningClient * gUDCClient = nullptr;
// mUdcTransportMgr is for insecure communication (ex. user directed commissioning)
// specifically, the commissioner declaration message (sent by commissioner to commissionee)
UdcTransportMgr * mUdcTransportMgr = nullptr;
diff --git a/src/app/util/af-enums.h b/src/app/util/af-enums.h
index 411f042..50bf0af 100644
--- a/src/app/util/af-enums.h
+++ b/src/app/util/af-enums.h
@@ -23,50 +23,48 @@
#include <protocols/interaction_model/StatusCode.h>
#include <stdint.h>
-typedef chip::Protocols::InteractionModel::Status EmberAfStatus;
-
-#define EMBER_ZCL_STATUS_SUCCESS chip::Protocols::InteractionModel::Status::Success
-#define EMBER_ZCL_STATUS_FAILURE chip::Protocols::InteractionModel::Status::Failure
-#define EMBER_ZCL_STATUS_INVALID_SUBSCRIPTION chip::Protocols::InteractionModel::Status::InvalidSubscription
-#define EMBER_ZCL_STATUS_UNSUPPORTED_ACCESS chip::Protocols::InteractionModel::Status::UnsupportedAccess
-#define EMBER_ZCL_STATUS_UNSUPPORTED_ENDPOINT chip::Protocols::InteractionModel::Status::UnsupportedEndpoint
-#define EMBER_ZCL_STATUS_MALFORMED_COMMAND chip::Protocols::InteractionModel::Status::InvalidAction
-#define EMBER_ZCL_STATUS_UNSUPPORTED_COMMAND chip::Protocols::InteractionModel::Status::UnsupportedCommand
-#define EMBER_ZCL_STATUS_DEPRECATED82 chip::Protocols::InteractionModel::Status::Deprecated82
-#define EMBER_ZCL_STATUS_DEPRECATED83 chip::Protocols::InteractionModel::Status::Deprecated83
-#define EMBER_ZCL_STATUS_DEPRECATED84 chip::Protocols::InteractionModel::Status::Deprecated84
-#define EMBER_ZCL_STATUS_INVALID_COMMAND chip::Protocols::InteractionModel::Status::InvalidCommand
-#define EMBER_ZCL_STATUS_UNSUPPORTED_ATTRIBUTE chip::Protocols::InteractionModel::Status::UnsupportedAttribute
-#define EMBER_ZCL_STATUS_CONSTRAINT_ERROR chip::Protocols::InteractionModel::Status::ConstraintError
-#define EMBER_ZCL_STATUS_UNSUPPORTED_WRITE chip::Protocols::InteractionModel::Status::UnsupportedWrite
-#define EMBER_ZCL_STATUS_RESOURCE_EXHAUSTED chip::Protocols::InteractionModel::Status::ResourceExhausted
-#define EMBER_ZCL_STATUS_NOT_FOUND chip::Protocols::InteractionModel::Status::NotFound
-#define EMBER_ZCL_STATUS_UNREPORTABLE_ATTRIBUTE chip::Protocols::InteractionModel::Status::UnreportableAttribute
-#define EMBER_ZCL_STATUS_INVALID_DATA_TYPE chip::Protocols::InteractionModel::Status::InvalidDataType
-#define EMBER_ZCL_STATUS_DEPRECATED8E chip::Protocols::InteractionModel::Status::Deprecated8e
-#define EMBER_ZCL_STATUS_UNSUPPORTED_READ chip::Protocols::InteractionModel::Status::UnsupportedRead
-#define EMBER_ZCL_STATUS_DEPRECATED90 chip::Protocols::InteractionModel::Status::Deprecated90
-#define EMBER_ZCL_STATUS_DEPRECATED91 chip::Protocols::InteractionModel::Status::Deprecated91
-#define EMBER_ZCL_STATUS_DATA_VERSION_MISMATCH chip::Protocols::InteractionModel::Status::DataVersionMismatch
-#define EMBER_ZCL_STATUS_DEPRECATED93 chip::Protocols::InteractionModel::Status::Deprecated93
-#define EMBER_ZCL_STATUS_TIMEOUT chip::Protocols::InteractionModel::Status::Timeout
-#define EMBER_ZCL_STATUS_RESERVED95 chip::Protocols::InteractionModel::Status::Reserved95
-#define EMBER_ZCL_STATUS_RESERVED96 chip::Protocols::InteractionModel::Status::Reserved96
-#define EMBER_ZCL_STATUS_RESERVED97 chip::Protocols::InteractionModel::Status::Reserved97
-#define EMBER_ZCL_STATUS_RESERVED98 chip::Protocols::InteractionModel::Status::Reserved98
-#define EMBER_ZCL_STATUS_RESERVED99 chip::Protocols::InteractionModel::Status::Reserved99
-#define EMBER_ZCL_STATUS_RESERVED9A chip::Protocols::InteractionModel::Status::Reserved9a
-#define EMBER_ZCL_STATUS_BUSY chip::Protocols::InteractionModel::Status::Busy
-#define EMBER_ZCL_STATUS_DEPRECATEDC0 chip::Protocols::InteractionModel::Status::Deprecatedc0
-#define EMBER_ZCL_STATUS_DEPRECATEDC1 chip::Protocols::InteractionModel::Status::Deprecatedc1
-#define EMBER_ZCL_STATUS_UNSUPPORTED_CLUSTER chip::Protocols::InteractionModel::Status::UnsupportedCluster
-#define EMBER_ZCL_STATUS_DEPRECATEDC4 chip::Protocols::InteractionModel::Status::Deprecatedc4
-#define EMBER_ZCL_STATUS_NO_UPSTREAM_SUBSCRIPTION chip::Protocols::InteractionModel::Status::NoUpstreamSubscription
-#define EMBER_ZCL_STATUS_NEEDS_TIMED_INTERACTION chip::Protocols::InteractionModel::Status::NeedsTimedInteraction
-#define EMBER_ZCL_STATUS_UNSUPPORTED_EVENT chip::Protocols::InteractionModel::Status::UnsupportedEvent
-#define EMBER_ZCL_STATUS_PATHS_EXHAUSTED chip::Protocols::InteractionModel::Status::PathsExhausted
-#define EMBER_ZCL_STATUS_TIMED_REQUEST_MISMATCH chip::Protocols::InteractionModel::Status::TimedRequestMismatch
-#define EMBER_ZCL_STATUS_FAILSAFE_REQUIRED chip::Protocols::InteractionModel::Status::FailsafeRequired
-#define EMBER_ZCL_STATUS_INVALID_IN_STATE chip::Protocols::InteractionModel::Status::InvalidInState
-#define EMBER_ZCL_STATUS_NO_COMMAND_RESPONSE chip::Protocols::InteractionModel::Status::NoCommandResponse
-#define EMBER_ZCL_STATUS_WRITE_IGNORED chip::Protocols::InteractionModel::Status::WriteIgnored // NOT SPEC COMPLIANT FOR TEST ONLY
+#define EMBER_ZCL_STATUS_SUCCESS Protocols::InteractionModel::Status::Success
+#define EMBER_ZCL_STATUS_FAILURE Protocols::InteractionModel::Status::Failure
+#define EMBER_ZCL_STATUS_INVALID_SUBSCRIPTION Protocols::InteractionModel::Status::InvalidSubscription
+#define EMBER_ZCL_STATUS_UNSUPPORTED_ACCESS Protocols::InteractionModel::Status::UnsupportedAccess
+#define EMBER_ZCL_STATUS_UNSUPPORTED_ENDPOINT Protocols::InteractionModel::Status::UnsupportedEndpoint
+#define EMBER_ZCL_STATUS_MALFORMED_COMMAND Protocols::InteractionModel::Status::InvalidAction
+#define EMBER_ZCL_STATUS_UNSUPPORTED_COMMAND Protocols::InteractionModel::Status::UnsupportedCommand
+#define EMBER_ZCL_STATUS_DEPRECATED82 Protocols::InteractionModel::Status::Deprecated82
+#define EMBER_ZCL_STATUS_DEPRECATED83 Protocols::InteractionModel::Status::Deprecated83
+#define EMBER_ZCL_STATUS_DEPRECATED84 Protocols::InteractionModel::Status::Deprecated84
+#define EMBER_ZCL_STATUS_INVALID_COMMAND Protocols::InteractionModel::Status::InvalidCommand
+#define EMBER_ZCL_STATUS_UNSUPPORTED_ATTRIBUTE Protocols::InteractionModel::Status::UnsupportedAttribute
+#define EMBER_ZCL_STATUS_CONSTRAINT_ERROR Protocols::InteractionModel::Status::ConstraintError
+#define EMBER_ZCL_STATUS_UNSUPPORTED_WRITE Protocols::InteractionModel::Status::UnsupportedWrite
+#define EMBER_ZCL_STATUS_RESOURCE_EXHAUSTED Protocols::InteractionModel::Status::ResourceExhausted
+#define EMBER_ZCL_STATUS_NOT_FOUND Protocols::InteractionModel::Status::NotFound
+#define EMBER_ZCL_STATUS_UNREPORTABLE_ATTRIBUTE Protocols::InteractionModel::Status::UnreportableAttribute
+#define EMBER_ZCL_STATUS_INVALID_DATA_TYPE Protocols::InteractionModel::Status::InvalidDataType
+#define EMBER_ZCL_STATUS_DEPRECATED8E Protocols::InteractionModel::Status::Deprecated8e
+#define EMBER_ZCL_STATUS_UNSUPPORTED_READ Protocols::InteractionModel::Status::UnsupportedRead
+#define EMBER_ZCL_STATUS_DEPRECATED90 Protocols::InteractionModel::Status::Deprecated90
+#define EMBER_ZCL_STATUS_DEPRECATED91 Protocols::InteractionModel::Status::Deprecated91
+#define EMBER_ZCL_STATUS_DATA_VERSION_MISMATCH Protocols::InteractionModel::Status::DataVersionMismatch
+#define EMBER_ZCL_STATUS_DEPRECATED93 Protocols::InteractionModel::Status::Deprecated93
+#define EMBER_ZCL_STATUS_TIMEOUT Protocols::InteractionModel::Status::Timeout
+#define EMBER_ZCL_STATUS_RESERVED95 Protocols::InteractionModel::Status::Reserved95
+#define EMBER_ZCL_STATUS_RESERVED96 Protocols::InteractionModel::Status::Reserved96
+#define EMBER_ZCL_STATUS_RESERVED97 Protocols::InteractionModel::Status::Reserved97
+#define EMBER_ZCL_STATUS_RESERVED98 Protocols::InteractionModel::Status::Reserved98
+#define EMBER_ZCL_STATUS_RESERVED99 Protocols::InteractionModel::Status::Reserved99
+#define EMBER_ZCL_STATUS_RESERVED9A Protocols::InteractionModel::Status::Reserved9a
+#define EMBER_ZCL_STATUS_BUSY Protocols::InteractionModel::Status::Busy
+#define EMBER_ZCL_STATUS_DEPRECATEDC0 Protocols::InteractionModel::Status::Deprecatedc0
+#define EMBER_ZCL_STATUS_DEPRECATEDC1 Protocols::InteractionModel::Status::Deprecatedc1
+#define EMBER_ZCL_STATUS_UNSUPPORTED_CLUSTER Protocols::InteractionModel::Status::UnsupportedCluster
+#define EMBER_ZCL_STATUS_DEPRECATEDC4 Protocols::InteractionModel::Status::Deprecatedc4
+#define EMBER_ZCL_STATUS_NO_UPSTREAM_SUBSCRIPTION Protocols::InteractionModel::Status::NoUpstreamSubscription
+#define EMBER_ZCL_STATUS_NEEDS_TIMED_INTERACTION Protocols::InteractionModel::Status::NeedsTimedInteraction
+#define EMBER_ZCL_STATUS_UNSUPPORTED_EVENT Protocols::InteractionModel::Status::UnsupportedEvent
+#define EMBER_ZCL_STATUS_PATHS_EXHAUSTED Protocols::InteractionModel::Status::PathsExhausted
+#define EMBER_ZCL_STATUS_TIMED_REQUEST_MISMATCH Protocols::InteractionModel::Status::TimedRequestMismatch
+#define EMBER_ZCL_STATUS_FAILSAFE_REQUIRED Protocols::InteractionModel::Status::FailsafeRequired
+#define EMBER_ZCL_STATUS_INVALID_IN_STATE Protocols::InteractionModel::Status::InvalidInState
+#define EMBER_ZCL_STATUS_NO_COMMAND_RESPONSE Protocols::InteractionModel::Status::NoCommandResponse
+#define EMBER_ZCL_STATUS_WRITE_IGNORED Protocols::InteractionModel::Status::WriteIgnored // NOT SPEC COMPLIANT FOR TEST ONLY
diff --git a/src/app/util/af-types.h b/src/app/util/af-types.h
index 66738e1..f252627 100644
--- a/src/app/util/af-types.h
+++ b/src/app/util/af-types.h
@@ -43,8 +43,6 @@
#include <app-common/zap-generated/cluster-objects.h>
#include <protocols/interaction_model/StatusCode.h>
-using chip::Protocols::InteractionModel::Status;
-
/**
* @brief Type for the cluster mask
*/
@@ -293,8 +291,8 @@
*
* This function is called before an attribute changes.
*/
-typedef Status (*EmberAfClusterPreAttributeChangedCallback)(const chip::app::ConcreteAttributePath & attributePath,
- EmberAfAttributeType attributeType, uint16_t size, uint8_t * value);
+typedef chip::Protocols::InteractionModel::Status (*EmberAfClusterPreAttributeChangedCallback)(
+ const chip::app::ConcreteAttributePath & attributePath, EmberAfAttributeType attributeType, uint16_t size, uint8_t * value);
#define MAX_INT32U_VALUE (0xFFFFFFFFUL)
#define MAX_INT16U_VALUE (0xFFFF)
diff --git a/src/app/util/af.h b/src/app/util/af.h
index e53b613..f7f772a 100644
--- a/src/app/util/af.h
+++ b/src/app/util/af.h
@@ -31,8 +31,6 @@
#include <lib/support/SafeInt.h>
#include <protocols/interaction_model/StatusCode.h>
-using chip::Protocols::InteractionModel::Status;
-
/** @name Attribute Storage */
// @{
@@ -98,8 +96,9 @@
* data type (as Accessors.h/cpp have this correct by default).
* TODO: this not checking seems off - what if this is run without Accessors.h ?
*/
-Status emberAfWriteAttribute(chip::EndpointId endpoint, chip::ClusterId cluster, chip::AttributeId attributeID, uint8_t * dataPtr,
- EmberAfAttributeType dataType);
+chip::Protocols::InteractionModel::Status emberAfWriteAttribute(chip::EndpointId endpoint, chip::ClusterId cluster,
+ chip::AttributeId attributeID, uint8_t * dataPtr,
+ EmberAfAttributeType dataType);
/**
* @brief Read the attribute value, performing all the checks.
@@ -110,8 +109,9 @@
* dataPtr may be NULL, signifying that we don't need the value, just the status
* (i.e. whether the attribute can be read).
*/
-Status emberAfReadAttribute(chip::EndpointId endpoint, chip::ClusterId cluster, chip::AttributeId attributeID, uint8_t * dataPtr,
- uint16_t readLength);
+chip::Protocols::InteractionModel::Status emberAfReadAttribute(chip::EndpointId endpoint, chip::ClusterId cluster,
+ chip::AttributeId attributeID, uint8_t * dataPtr,
+ uint16_t readLength);
/**
* @brief macro that returns size of attribute in bytes.
diff --git a/src/app/util/attribute-storage.h b/src/app/util/attribute-storage.h
index e68735c..83a3aea 100644
--- a/src/app/util/attribute-storage.h
+++ b/src/app/util/attribute-storage.h
@@ -30,8 +30,6 @@
#include <protocols/interaction_model/StatusCode.h>
-using chip::Protocols::InteractionModel::Status;
-
// If we have fixed number of endpoints, then max is the same.
#ifdef FIXED_ENDPOINT_COUNT
#define MAX_ENDPOINT_COUNT (FIXED_ENDPOINT_COUNT + CHIP_DEVICE_CONFIG_DYNAMIC_ENDPOINT_COUNT)
@@ -73,8 +71,9 @@
// Initial configuration
void emberAfEndpointConfigure(void);
-Status emAfReadOrWriteAttribute(const EmberAfAttributeSearchRecord * attRecord, const EmberAfAttributeMetadata ** metadata,
- uint8_t * buffer, uint16_t readLength, bool write);
+chip::Protocols::InteractionModel::Status emAfReadOrWriteAttribute(const EmberAfAttributeSearchRecord * attRecord,
+ const EmberAfAttributeMetadata ** metadata, uint8_t * buffer,
+ uint16_t readLength, bool write);
// Check if a cluster is implemented or not. If yes, the cluster is returned.
//
@@ -134,8 +133,9 @@
void emAfClusterAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath);
// Calls the attribute changed callback for a specific cluster.
-Status emAfClusterPreAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath,
- EmberAfAttributeType attributeType, uint16_t size, uint8_t * value);
+chip::Protocols::InteractionModel::Status
+emAfClusterPreAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath, EmberAfAttributeType attributeType,
+ uint16_t size, uint8_t * value);
// Note the difference in for server filtering.
// This method will return the cluster count for BOTH client and server
diff --git a/src/app/util/attribute-table.h b/src/app/util/attribute-table.h
index 0969e8c..7b86298 100644
--- a/src/app/util/attribute-table.h
+++ b/src/app/util/attribute-table.h
@@ -21,16 +21,15 @@
#include <protocols/interaction_model/StatusCode.h>
-using chip::Protocols::InteractionModel::Status;
-
/**
* Write an attribute for a request arriving from external sources.
*
* This will check attribute writeability and that
* the provided data type matches the expected data type.
*/
-Status emAfWriteAttributeExternal(chip::EndpointId endpoint, chip::ClusterId cluster, chip::AttributeId attributeID,
- uint8_t * dataPtr, EmberAfAttributeType dataType);
+chip::Protocols::InteractionModel::Status emAfWriteAttributeExternal(chip::EndpointId endpoint, chip::ClusterId cluster,
+ chip::AttributeId attributeID, uint8_t * dataPtr,
+ EmberAfAttributeType dataType);
/**
* @brief write an attribute, performing all the checks.
@@ -62,5 +61,6 @@
* the attribute
* - Status::Success: if the attribute was found and successfully written
*/
-Status emAfWriteAttribute(chip::EndpointId endpoint, chip::ClusterId cluster, chip::AttributeId attributeID, uint8_t * data,
- EmberAfAttributeType dataType, bool overrideReadOnlyAndDataType);
+chip::Protocols::InteractionModel::Status emAfWriteAttribute(chip::EndpointId endpoint, chip::ClusterId cluster,
+ chip::AttributeId attributeID, uint8_t * data,
+ EmberAfAttributeType dataType, bool overrideReadOnlyAndDataType);
diff --git a/src/app/util/generic-callback-stubs.cpp b/src/app/util/generic-callback-stubs.cpp
index 21d4085..723c9f2 100644
--- a/src/app/util/generic-callback-stubs.cpp
+++ b/src/app/util/generic-callback-stubs.cpp
@@ -19,6 +19,7 @@
#include <app/util/basic-types.h>
#include <lib/support/Span.h>
#include <protocols/interaction_model/Constants.h>
+#include <protocols/interaction_model/StatusCode.h>
using namespace chip;
@@ -34,18 +35,18 @@
return true;
}
-Status __attribute__((weak))
+chip::Protocols::InteractionModel::Status __attribute__((weak))
emberAfExternalAttributeReadCallback(EndpointId endpoint, ClusterId clusterId, const EmberAfAttributeMetadata * attributeMetadata,
uint8_t * buffer, uint16_t maxReadLength)
{
- return Status::Failure;
+ return chip::Protocols::InteractionModel::Status::Failure;
}
-Status __attribute__((weak))
+chip::Protocols::InteractionModel::Status __attribute__((weak))
emberAfExternalAttributeWriteCallback(EndpointId endpoint, ClusterId clusterId, const EmberAfAttributeMetadata * attributeMetadata,
uint8_t * buffer)
{
- return Status::Failure;
+ return chip::Protocols::InteractionModel::Status::Failure;
}
chip::Protocols::InteractionModel::Status __attribute__((weak))
diff --git a/src/app/util/generic-callbacks.h b/src/app/util/generic-callbacks.h
index 51917e6..4a20138 100644
--- a/src/app/util/generic-callbacks.h
+++ b/src/app/util/generic-callbacks.h
@@ -28,8 +28,6 @@
#include <lib/support/Span.h>
#include <protocols/interaction_model/Constants.h>
-using chip::Protocols::InteractionModel::Status;
-
/** @brief Cluster Init
*
* This function is called when a specific cluster is initialized. It gives the
@@ -84,9 +82,9 @@
* EMBER_ZCL_STATUS_RESOURCE_EXHAUSTED. Any other return value indicates the
* application was not able to read the attribute.
*/
-Status emberAfExternalAttributeReadCallback(chip::EndpointId endpoint, chip::ClusterId clusterId,
- const EmberAfAttributeMetadata * attributeMetadata, uint8_t * buffer,
- uint16_t maxReadLength);
+chip::Protocols::InteractionModel::Status emberAfExternalAttributeReadCallback(chip::EndpointId endpoint, chip::ClusterId clusterId,
+ const EmberAfAttributeMetadata * attributeMetadata,
+ uint8_t * buffer, uint16_t maxReadLength);
/** @brief External Attribute Write
*
@@ -128,15 +126,17 @@
* other return value indicates the application was not able to write the
* attribute.
*/
-Status emberAfExternalAttributeWriteCallback(chip::EndpointId endpoint, chip::ClusterId clusterId,
- const EmberAfAttributeMetadata * attributeMetadata, uint8_t * buffer);
+chip::Protocols::InteractionModel::Status emberAfExternalAttributeWriteCallback(chip::EndpointId endpoint,
+ chip::ClusterId clusterId,
+ const EmberAfAttributeMetadata * attributeMetadata,
+ uint8_t * buffer);
/** @brief Pre Attribute Change
*
* This function is called by the application framework before it changes an
* attribute value. The value passed into this callback is the value to which
* the attribute is to be set by the framework. The application should return
- * chip::Protocols::InteractionModel::Status::Success to permit the change or
+ * Protocols::InteractionModel::Status::Success to permit the change or
* any other code to reject it.
*/
chip::Protocols::InteractionModel::Status MatterPreAttributeChangeCallback(const chip::app::ConcreteAttributePath & attributePath,
diff --git a/src/darwin/Framework/CHIP/ServerEndpoint/MTRIMDispatch.mm b/src/darwin/Framework/CHIP/ServerEndpoint/MTRIMDispatch.mm
index a1f1f47..a96af0a 100644
--- a/src/darwin/Framework/CHIP/ServerEndpoint/MTRIMDispatch.mm
+++ b/src/darwin/Framework/CHIP/ServerEndpoint/MTRIMDispatch.mm
@@ -39,14 +39,14 @@
// clusters dont use it.
}
-EmberAfStatus emAfWriteAttributeExternal(EndpointId endpoint, ClusterId cluster, AttributeId attributeID, uint8_t * dataPtr,
+Protocols::InteractionModel::Status emAfWriteAttributeExternal(EndpointId endpoint, ClusterId cluster, AttributeId attributeID, uint8_t * dataPtr,
EmberAfAttributeType dataType)
{
assertChipStackLockedByCurrentThread();
// All of our attributes are handled via AttributeAccessInterface, so this
// should be unreached.
- return EMBER_ZCL_STATUS_UNSUPPORTED_ATTRIBUTE;
+ return Protocols::InteractionModel::Status::UnsupportedAttribute;
}
namespace chip {