From fbcbc80bd1fb360cd933a0f3a305f02ae3e598dc Mon Sep 17 00:00:00 2001 From: yunhanw-google Date: Tue, 16 Nov 2021 17:02:19 -0800 Subject: [PATCH] Fix bitmap in clusterObject which should directly use mask instead asOffset (#11816) --- .../templates/app/cluster-objects.zapt | 2 +- .../zap-generated/cluster-objects.h | 236 +++++++++--------- 2 files changed, 119 insertions(+), 119 deletions(-) diff --git a/src/app/zap-templates/templates/app/cluster-objects.zapt b/src/app/zap-templates/templates/app/cluster-objects.zapt index 658ea3e37235ab..3a9942ec88ceee 100644 --- a/src/app/zap-templates/templates/app/cluster-objects.zapt +++ b/src/app/zap-templates/templates/app/cluster-objects.zapt @@ -42,7 +42,7 @@ using {{asType label}} = EmberAf{{asType label}}; // Bitmap for {{label}} enum class {{asType label}} : {{asUnderlyingZclType type}} { {{#zcl_bitmap_items}} -k{{asUpperCamelCase label}} = {{asOffset mask}}, +k{{asUpperCamelCase label}} = {{asHex mask}}, {{/zcl_bitmap_items}} }; {{/zcl_bitmaps}} diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h index 9fef05046193e5..5b2b480d9eb4a8 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h @@ -1480,7 +1480,7 @@ namespace Scenes { // Bitmap for ScenesCopyMode enum class ScenesCopyMode : uint8_t { - kCopyAllScenes = 0, + kCopyAllScenes = 0x1, }; namespace Structs { @@ -2442,7 +2442,7 @@ using OnOffEffectIdentifier = EmberAfOnOffEffectIdentifier; // Bitmap for OnOffControl enum class OnOffControl : uint8_t { - kAcceptOnlyWhenOn = 0, + kAcceptOnlyWhenOn = 0x1, }; namespace Commands { @@ -5088,8 +5088,8 @@ using WarningEvent = EmberAfWarningEvent; // Bitmap for RemoteEnableFlagsAndDeviceStatus2 enum class RemoteEnableFlagsAndDeviceStatus2 : uint8_t { - kRemoteEnableFlags = 0, - kDeviceStatus2Structure = 4, + kRemoteEnableFlags = 0xF, + kDeviceStatus2Structure = 0xF0, }; namespace Commands { @@ -5881,18 +5881,18 @@ using EndpointListTypeEnum = EmberAfEndpointListTypeEnum; // Bitmap for CommandBits enum class CommandBits : uint16_t { - kInstantAction = 0, - kInstantActionWithTransition = 1, - kStartAction = 2, - kStartActionWithDuration = 3, - kStopAction = 4, - kPauseAction = 5, - kPauseActionWithDuration = 6, - kResumeAction = 7, - kEnableAction = 8, - kEnableActionWithDuration = 9, - kDisableAction = 10, - kDisableActionWithDuration = 11, + kInstantAction = 0x1, + kInstantActionWithTransition = 0x2, + kStartAction = 0x4, + kStartActionWithDuration = 0x8, + kStopAction = 0x10, + kPauseAction = 0x20, + kPauseActionWithDuration = 0x40, + kResumeAction = 0x80, + kEnableAction = 0x100, + kEnableActionWithDuration = 0x200, + kDisableAction = 0x400, + kDisableActionWithDuration = 0x800, }; namespace Structs { @@ -12785,13 +12785,13 @@ using DoorLockUserType = EmberAfDoorLockUserType; // Bitmap for DoorLockDayOfWeek enum class DoorLockDayOfWeek : uint8_t { - kSunday = 0, - kMonday = 1, - kTuesday = 2, - kWednesday = 3, - kThursday = 4, - kFriday = 5, - kSaturday = 6, + kSunday = 0x1, + kMonday = 0x2, + kTuesday = 0x4, + kWednesday = 0x8, + kThursday = 0x10, + kFriday = 0x20, + kSaturday = 0x40, }; namespace Commands { @@ -15385,47 +15385,47 @@ namespace WindowCovering { // Bitmap for WcConfigStatus enum class WcConfigStatus : uint8_t { - kOperational = 0, - kOnline = 1, - kOpenAndUpCommandsReversed = 2, - kLiftPositionAware = 3, - kTiltPositionAware = 4, - kLiftEncoderControlled = 5, - kTiltEncoderControlled = 6, + kOperational = 0x1, + kOnline = 0x2, + kOpenAndUpCommandsReversed = 0x4, + kLiftPositionAware = 0x8, + kTiltPositionAware = 0x10, + kLiftEncoderControlled = 0x20, + kTiltEncoderControlled = 0x40, }; // Bitmap for WcMode enum class WcMode : uint8_t { - kMotorDirectionReversed = 0, - kCalibrationMode = 1, - kMaintenanceMode = 2, - kLEDFeedback = 3, + kMotorDirectionReversed = 0x1, + kCalibrationMode = 0x2, + kMaintenanceMode = 0x4, + kLEDFeedback = 0x8, }; // Bitmap for WcOperationalStatus enum class WcOperationalStatus : uint8_t { - kGlobal = 0, - kLift = 2, - kTilt = 4, + kGlobal = 0x3, + kLift = 0xC, + kTilt = 0x30, }; // Bitmap for WcSafetyStatus enum class WcSafetyStatus : uint16_t { - kRemoteLockout = 0, - kTamperDetection = 1, - kFailedCommunication = 2, - kPositionFailure = 3, - kThermalProtection = 4, - kObstacleDetected = 5, - kPower = 6, - kStopInput = 7, - kMotorJammed = 8, - kHardwareFailure = 9, - kManualOperation = 10, - kProtection = 11, + kRemoteLockout = 0x1, + kTamperDetection = 0x2, + kFailedCommunication = 0x4, + kPositionFailure = 0x8, + kThermalProtection = 0x10, + kObstacleDetected = 0x20, + kPower = 0x40, + kStopInput = 0x80, + kMotorJammed = 0x100, + kHardwareFailure = 0x200, + kManualOperation = 0x400, + kProtection = 0x800, }; namespace Commands { @@ -16243,15 +16243,15 @@ using PumpOperationMode = EmberAfPumpOperationMode; // Bitmap for PumpStatus enum class PumpStatus : uint16_t { - kDeviceFault = 0, - kSupplyfault = 1, - kSpeedLow = 2, - kSpeedHigh = 3, - kLocalOverride = 4, - kRunning = 5, - kRemotePressure = 6, - kRemoteFlow = 7, - kRemoteTemperature = 8, + kDeviceFault = 0x1, + kSupplyfault = 0x2, + kSpeedLow = 0x4, + kSpeedHigh = 0x8, + kLocalOverride = 0x10, + kRunning = 0x20, + kRemotePressure = 0x40, + kRemoteFlow = 0x80, + kRemoteTemperature = 0x100, }; namespace Attributes { @@ -17039,21 +17039,21 @@ using SetpointAdjustMode = EmberAfSetpointAdjustMode; // Bitmap for DayOfWeek enum class DayOfWeek : uint8_t { - kSunday = 0, - kMonday = 1, - kTuesday = 2, - kWednesday = 3, - kThursday = 4, - kFriday = 5, - kSaturday = 6, - kAwayOrVacation = 7, + kSunday = 0x1, + kMonday = 0x2, + kTuesday = 0x4, + kWednesday = 0x8, + kThursday = 0x10, + kFriday = 0x20, + kSaturday = 0x40, + kAwayOrVacation = 0x80, }; // Bitmap for ModeForSequence enum class ModeForSequence : uint8_t { - kHeatSetpointFieldPresent = 0, - kCoolSetpointFieldPresent = 1, + kHeatSetpointFieldPresent = 0x1, + kCoolSetpointFieldPresent = 0x2, }; namespace Commands { @@ -18169,20 +18169,20 @@ using SaturationStepMode = EmberAfSaturationStepMode; // Bitmap for ColorCapabilities enum class ColorCapabilities : uint16_t { - kHueSaturationSupported = 0, - kEnhancedHueSupported = 1, - kColorLoopSupported = 2, - kXYAttributesSupported = 3, - kColorTemperatureSupported = 4, + kHueSaturationSupported = 0x1, + kEnhancedHueSupported = 0x2, + kColorLoopSupported = 0x4, + kXYAttributesSupported = 0x8, + kColorTemperatureSupported = 0x10, }; // Bitmap for ColorLoopUpdateFlags enum class ColorLoopUpdateFlags : uint8_t { - kUpdateAction = 0, - kUpdateDirection = 1, - kUpdateTime = 2, - kUpdateStartHue = 3, + kUpdateAction = 0x1, + kUpdateDirection = 0x2, + kUpdateTime = 0x4, + kUpdateStartHue = 0x8, }; namespace Commands { @@ -22641,16 +22641,16 @@ using IasZoneType = EmberAfIasZoneType; // Bitmap for IasZoneStatus enum class IasZoneStatus : uint16_t { - kAlarm1 = 0, - kAlarm2 = 1, - kTamper = 2, - kBattery = 3, - kSupervisionReports = 4, - kRestoreReports = 5, - kTrouble = 6, - kAc = 7, - kTest = 8, - kBatteryDefect = 9, + kAlarm1 = 0x1, + kAlarm2 = 0x2, + kTamper = 0x4, + kBattery = 0x8, + kSupervisionReports = 0x10, + kRestoreReports = 0x20, + kTrouble = 0x40, + kAc = 0x80, + kTest = 0x100, + kBatteryDefect = 0x200, }; namespace Commands { @@ -23142,16 +23142,16 @@ using IasZoneType = EmberAfIasZoneType; // Bitmap for IasZoneStatus enum class IasZoneStatus : uint16_t { - kAlarm1 = 0, - kAlarm2 = 1, - kTamper = 2, - kBattery = 3, - kSupervisionReports = 4, - kRestoreReports = 5, - kTrouble = 6, - kAc = 7, - kTest = 8, - kBatteryDefect = 9, + kAlarm1 = 0x1, + kAlarm2 = 0x2, + kTamper = 0x4, + kBattery = 0x8, + kSupervisionReports = 0x10, + kRestoreReports = 0x20, + kTrouble = 0x40, + kAc = 0x80, + kTest = 0x100, + kBatteryDefect = 0x200, }; namespace Structs { @@ -23970,17 +23970,17 @@ namespace IasWd { // Bitmap for SquawkInfo enum class SquawkInfo : uint8_t { - kMode = 4, - kStrobe = 3, - kLevel = 0, + kMode = 0xF0, + kStrobe = 0x8, + kLevel = 0x3, }; // Bitmap for WarningInfo enum class WarningInfo : uint8_t { - kMode = 4, - kStrobe = 2, - kSirenLevel = 0, + kMode = 0xF0, + kStrobe = 0xC, + kSirenLevel = 0x3, }; namespace Commands { @@ -27105,9 +27105,9 @@ using SimpleEnum = EmberAfSimpleEnum; // Bitmap for SimpleBitmap enum class SimpleBitmap : uint8_t { - kValueA = 0, - kValueB = 1, - kValueC = 2, + kValueA = 0x1, + kValueB = 0x2, + kValueC = 0x4, }; namespace Structs { @@ -29071,23 +29071,23 @@ using MessagingControlTransmission = EmberAfMessagingControlTransmission // Bitmap for MessagingConfirmationControl enum class MessagingConfirmationControl : uint8_t { - kNoReturned = 0, - kYesReturned = 1, + kNoReturned = 0x1, + kYesReturned = 0x2, }; // Bitmap for MessagingControlMask enum class MessagingControlMask : uint8_t { - kTransMechanism = 0, - kMessageUrgency = 2, - kEnhancedConfirmationRequest = 5, - kMessageConfirmation = 7, + kTransMechanism = 0x3, + kMessageUrgency = 0xC, + kEnhancedConfirmationRequest = 0x20, + kMessageConfirmation = 0x80, }; // Bitmap for MessagingExtendedControlMask enum class MessagingExtendedControlMask : uint8_t { - kMessageConfirmationStatus = 0, + kMessageConfirmationStatus = 0x1, }; namespace Commands { @@ -29744,16 +29744,16 @@ using EventIdentification = EmberAfEventIdentification; // Bitmap for AlertCount enum class AlertCount : uint8_t { - kNumberOfAlerts = 0, - kTypeOfAlert = 4, + kNumberOfAlerts = 0xF, + kTypeOfAlert = 0xF0, }; // Bitmap for AlertStructure enum class AlertStructure : uint32_t { - kAlertId = 0, - kCategory = 8, - kPresenceRecovery = 12, + kAlertId = 0xFF, + kCategory = 0xF00, + kPresenceRecovery = 0x3000, }; namespace Commands {