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 645fc943078355..6cd4998d8aba4a 100644 --- a/src/app/clusters/barrier-control-server/barrier-control-server.cpp +++ b/src/app/clusters/barrier-control-server/barrier-control-server.cpp @@ -23,6 +23,7 @@ #include #include #include +#include #include @@ -99,7 +100,7 @@ bool emAfPluginBarrierControlServerIsPartialBarrierSupported(EndpointId endpoint uint8_t bitmap; EmberAfStatus status = Attributes::BarrierCapabilities::Get(endpoint, &bitmap); assert(status == EMBER_ZCL_STATUS_SUCCESS); - return READBITS(bitmap, EMBER_AF_BARRIER_CONTROL_CAPABILITIES_PARTIAL_BARRIER); + return (bitmap & to_underlying(BarrierControlCapabilities::kPartialBarrier)) != 0; } static uint16_t getOpenOrClosePeriod(EndpointId endpoint, bool open) @@ -139,7 +140,7 @@ uint16_t emAfPluginBarrierControlServerGetSafetyStatus(EndpointId endpoint) static bool isRemoteLockoutOn(EndpointId endpoint) { uint16_t safetyStatus = emAfPluginBarrierControlServerGetSafetyStatus(endpoint); - return READBITS(safetyStatus, EMBER_AF_BARRIER_CONTROL_SAFETY_STATUS_REMOTE_LOCKOUT); + return (safetyStatus & to_underlying(BarrierControlSafetyStatus::kRemoteLockout)) != 0; } void emAfPluginBarrierControlServerIncrementEvents(EndpointId endpoint, bool open, bool command) diff --git a/src/app/common/templates/config-data.yaml b/src/app/common/templates/config-data.yaml index 601d3f13f613fd..aa59f199cf1d55 100644 --- a/src/app/common/templates/config-data.yaml +++ b/src/app/common/templates/config-data.yaml @@ -12,12 +12,6 @@ WeakEnums: - RadioFaultEnum - StepMode -DefineBitmaps: - # Allow-list of bitmaps that we generates as #define as well as enum classes. - # The goal is to drive this down to 0. - - BarrierControlCapabilities - - BarrierControlSafetyStatus - CommandHandlerInterfaceOnlyClusters: # List of clusters that are implemented entirely with # CommandHandlerInterface and hence do not need generated command dispatch. diff --git a/src/app/zap-templates/templates/app/enums.zapt b/src/app/zap-templates/templates/app/enums.zapt index 71b2d32ad75066..d0e95a7df2b75f 100644 --- a/src/app/zap-templates/templates/app/enums.zapt +++ b/src/app/zap-templates/templates/app/enums.zapt @@ -18,12 +18,3 @@ enum EmberAf{{asType label}} : {{asUnderlyingZclType name}} { }; {{/if}} {{/zcl_enums}} - -{{#zcl_bitmaps}} -{{#if (isInConfigList label "DefineBitmaps")}} -{{#zcl_bitmap_items}} -#define EMBER_AF_{{asDelimitedMacro parent.label}}_{{asDelimitedMacro label}} ({{mask}}) -#define EMBER_AF_{{asDelimitedMacro parent.label}}_{{asDelimitedMacro label}}_OFFSET ({{asOffset mask}}) -{{/zcl_bitmap_items}} -{{/if}} -{{/zcl_bitmaps}} diff --git a/src/app/zap-templates/zcl/data-model/draft/barrier-control-cluster.xml b/src/app/zap-templates/zcl/data-model/draft/barrier-control-cluster.xml index 08eda3b79ded15..d807b23d1f2528 100644 --- a/src/app/zap-templates/zcl/data-model/draft/barrier-control-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/draft/barrier-control-cluster.xml @@ -18,10 +18,12 @@ limitations under the License. + + diff --git a/src/darwin/Framework/CHIP/templates/availability.yaml b/src/darwin/Framework/CHIP/templates/availability.yaml index 3e23efcf1dbc43..6406a6a666a9e7 100644 --- a/src/darwin/Framework/CHIP/templates/availability.yaml +++ b/src/darwin/Framework/CHIP/templates/availability.yaml @@ -7686,3 +7686,8 @@ - release: "Future" versions: "future" + provisional: + bitmaps: + BarrierControl: + - BarrierControlCapabilities + - BarrierControlSafetyStatus diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h index 3afa8df46adf40..8c3d082798aa46 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h @@ -27616,6 +27616,17 @@ typedef NS_OPTIONS(uint16_t, MTRWindowCoveringSafetyStatus) { MTRWindowCoveringSafetyStatusProtection API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x800, } API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); +typedef NS_OPTIONS(uint8_t, MTRBarrierControlCapabilities) { + MTRBarrierControlCapabilitiesPartialBarrier MTR_PROVISIONALLY_AVAILABLE = 0x1, +} MTR_PROVISIONALLY_AVAILABLE; + +typedef NS_OPTIONS(uint16_t, MTRBarrierControlSafetyStatus) { + MTRBarrierControlSafetyStatusRemoteLockout MTR_PROVISIONALLY_AVAILABLE = 0x1, + MTRBarrierControlSafetyStatusTemperDetected MTR_PROVISIONALLY_AVAILABLE = 0x2, + MTRBarrierControlSafetyStatusFailedCommunication MTR_PROVISIONALLY_AVAILABLE = 0x4, + MTRBarrierControlSafetyStatusPositionFailure MTR_PROVISIONALLY_AVAILABLE = 0x8, +} MTR_PROVISIONALLY_AVAILABLE; + typedef NS_ENUM(uint8_t, MTRPumpConfigurationAndControlControlMode) { MTRPumpConfigurationAndControlControlModeConstantSpeed API_AVAILABLE(ios(16.5), macos(13.4), watchos(9.5), tvos(16.5)) = 0x00, MTRPumpConfigurationAndControlControlModeConstantPressure API_AVAILABLE(ios(16.5), macos(13.4), watchos(9.5), tvos(16.5)) diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h b/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h index 60f0c614cb7118..ba288e2a87d987 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h @@ -2612,7 +2612,23 @@ enum class SafetyStatus : uint16_t }; } // namespace WindowCovering -namespace BarrierControl {} // namespace BarrierControl +namespace BarrierControl { + +// Bitmap for BarrierControlCapabilities +enum class BarrierControlCapabilities : uint8_t +{ + kPartialBarrier = 0x1, +}; + +// Bitmap for BarrierControlSafetyStatus +enum class BarrierControlSafetyStatus : uint16_t +{ + kRemoteLockout = 0x1, + kTemperDetected = 0x2, + kFailedCommunication = 0x4, + kPositionFailure = 0x8, +}; +} // namespace BarrierControl namespace PumpConfigurationAndControl { diff --git a/zzz_generated/app-common/app-common/zap-generated/enums.h b/zzz_generated/app-common/app-common/zap-generated/enums.h index 2152ee8e992212..7d30ac54349ac7 100644 --- a/zzz_generated/app-common/app-common/zap-generated/enums.h +++ b/zzz_generated/app-common/app-common/zap-generated/enums.h @@ -113,14 +113,3 @@ enum EmberAfStepMode : uint8_t EMBER_ZCL_STEP_MODE_UP = 0, EMBER_ZCL_STEP_MODE_DOWN = 1, }; - -#define EMBER_AF_BARRIER_CONTROL_CAPABILITIES_PARTIAL_BARRIER (1) -#define EMBER_AF_BARRIER_CONTROL_CAPABILITIES_PARTIAL_BARRIER_OFFSET (0) -#define EMBER_AF_BARRIER_CONTROL_SAFETY_STATUS_REMOTE_LOCKOUT (1) -#define EMBER_AF_BARRIER_CONTROL_SAFETY_STATUS_REMOTE_LOCKOUT_OFFSET (0) -#define EMBER_AF_BARRIER_CONTROL_SAFETY_STATUS_TEMPER_DETECTED (2) -#define EMBER_AF_BARRIER_CONTROL_SAFETY_STATUS_TEMPER_DETECTED_OFFSET (1) -#define EMBER_AF_BARRIER_CONTROL_SAFETY_STATUS_FAILED_COMMUNICATION (4) -#define EMBER_AF_BARRIER_CONTROL_SAFETY_STATUS_FAILED_COMMUNICATION_OFFSET (2) -#define EMBER_AF_BARRIER_CONTROL_SAFETY_STATUS_POSITION_FAILURE (8) -#define EMBER_AF_BARRIER_CONTROL_SAFETY_STATUS_POSITION_FAILURE_OFFSET (3)