blob: 4394ed79a7c25a093a229df6db3e808fca185039 [file] [log] [blame]
{{> header}}
#pragma once
#include <stdint.h>
#include <app-common/zap-generated/enums.h>
namespace chip {
namespace app {
namespace Clusters {
{{#zcl_clusters}}
namespace {{asUpperCamelCase name}} {
{{#zcl_enums}}
{{#if (isInConfigList label "WeakEnums")}}
// Need to convert consumers to using the new enum classes, so we
// don't just have casts all over.
#ifdef CHIP_USE_ENUM_CLASS_FOR_IM_ENUM
{{/if}}
// Enum for {{label}}
enum class {{asType label}} : {{asUnderlyingZclType name}} {
{{#zcl_enum_items}}
k{{asUpperCamelCase label}} = {{asHex value 2}},
{{/zcl_enum_items}}
// All received enum values that are not listed above will be mapped
// to kUnknownEnumValue. This is a helper enum value that should only
// be used by code to process how it handles receiving and unknown
// enum value. This specific should never be transmitted.
kUnknownEnumValue = {{first_unused_enum_value mode="first_unused"}},
};
{{#if (isInConfigList label "WeakEnums")}}
#else // CHIP_USE_ENUM_CLASS_FOR_IM_ENUM
using {{asType label}} = EmberAf{{asType label}};
static {{asType label}} __attribute__((unused)) k{{asType label}}kUnknownEnumValue = static_cast<{{asType label}}>({{first_unused_enum_value mode="first_unused"}});
#endif // CHIP_USE_ENUM_CLASS_FOR_IM_ENUM
{{/if}}
{{/zcl_enums}}
{{#zcl_bitmaps}}
// Bitmap for {{label}}
enum class {{asType label}} : {{asUnderlyingZclType name}} {
{{#zcl_bitmap_items}}
k{{asUpperCamelCase label}} = {{asHex mask}},
{{/zcl_bitmap_items}}
};
{{/zcl_bitmaps}}
} // namespace {{asUpperCamelCase name}}
{{/zcl_clusters}}
} // namespace Clusters
} // namespace app
} // namespace chip