diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 8b6f099ca15c48..8a770ecb46b6f0 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -223,7 +223,3 @@ jobs: run: | git grep -n 'SuccessOrExit([^=)]*(' -- './*' ':(exclude).github/workflows/lint.yml' && exit 1 || exit 0 - - name: Check that our hardcoded SHA for clang-format on ARM mac matches the pigweed SHA. - if: always() - run: | - ./scripts/lints/clang-format-version-matches.py diff --git a/scripts/lints/clang-format-version-matches.py b/scripts/lints/clang-format-version-matches.py deleted file mode 100755 index 09bf7eda7d8e15..00000000000000 --- a/scripts/lints/clang-format-version-matches.py +++ /dev/null @@ -1,43 +0,0 @@ -#!/usr/bin/env python3 -# -# Copyright (c) 2021 Project CHIP Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -import json -import os - -CHIP_ROOT_DIR = os.path.realpath( - os.path.join(os.path.dirname(__file__), '../..')) - - -def readClangRevision(jsonFileName): - with open(os.path.join(CHIP_ROOT_DIR, jsonFileName)) as file: - data = json.load(file) - - packages = data['packages'] - for package in packages: - if package['path'].startswith('fuchsia/third_party/clang/'): - return package['tags'] - - raise Exception('Could not find clang package in %s' % jsonFileName) - - -pigweed_revision = readClangRevision('third_party/pigweed/repo/pw_env_setup/py/pw_env_setup/cipd_setup/pigweed.json') - -our_file = 'scripts/setup/clang.json' -our_revision = readClangRevision(our_file) - -if our_revision != pigweed_revision: - raise Exception('In %s, "%s" should be changed to "%s"' % (our_file, our_revision, pigweed_revision)) diff --git a/scripts/setup/clang.json b/scripts/setup/clang.json deleted file mode 100644 index 5c09ee6798672f..00000000000000 --- a/scripts/setup/clang.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "packages": [ - { - "path": "fuchsia/third_party/clang/mac-arm64", - "platforms": [ - "mac-arm64" - ], - "tags": [ - "git_revision:6d667d4b261e81f325756fdfd5bb43b3b3d2451d" - ] - } - ] -} diff --git a/scripts/setup/environment.json b/scripts/setup/environment.json index 6c32bb62ebe8e4..ebe77d9db6dbc8 100644 --- a/scripts/setup/environment.json +++ b/scripts/setup/environment.json @@ -2,7 +2,6 @@ "cipd_package_files": [ "third_party/pigweed/repo/pw_env_setup/py/pw_env_setup/cipd_setup/arm.json", "third_party/pigweed/repo/pw_env_setup/py/pw_env_setup/cipd_setup/pigweed.json", - "scripts/setup/clang.json", "scripts/setup/python.json", "scripts/setup/zap.json" ], diff --git a/scripts/tools/zap/generate.py b/scripts/tools/zap/generate.py index cb932b0cefc2eb..5b1f4f4c629f49 100755 --- a/scripts/tools/zap/generate.py +++ b/scripts/tools/zap/generate.py @@ -23,6 +23,7 @@ import subprocess import sys import tempfile +import traceback import urllib.request from dataclasses import dataclass from pathlib import Path @@ -216,6 +217,59 @@ def runGeneration(cmdLineArgs): extractGeneratedIdl(output_dir, zap_file) +def getClangFormatBinaryChoices(): + """ + Returns an ordered list of paths that may be suitable clang-format versions + """ + PW_CLANG_FORMAT_PATH = 'cipd/packages/pigweed/bin/clang-format' + + if 'PW_ENVIRONMENT_ROOT' in os.environ: + yield os.path.join(os.environ["PW_ENVIRONMENT_ROOT"], PW_CLANG_FORMAT_PATH) + + dot_name = os.path.join(CHIP_ROOT_DIR, '.environment', PW_CLANG_FORMAT_PATH) + if os.path.exists(dot_name): + yield dot_name + + os_name = shutil.which('clang-format') + if os_name: + yield os_name + + +def getClangFormatBinary(): + """Fetches the clang-format binary that is to be used for formatting. + + Tries to figure out where the pigweed-provided binary is (via cipd) + """ + for binary in getClangFormatBinaryChoices(): + # Running the binary with `--version` yields a string of the form: + # "Fuchsia clang-format version 17.0.0 (https://llvm.googlesource.com/llvm-project 6d667d4b261e81f325756fdfd5bb43b3b3d2451d)" + # + # the SHA at the end generally should match pigweed version + + try: + version_string = subprocess.check_output([binary, '--version']).decode('utf8') + + pigweed_config = json.load( + open(os.path.join(CHIP_ROOT_DIR, 'third_party/pigweed/repo/pw_env_setup/py/pw_env_setup/cipd_setup/pigweed.json'))) + clang_config = [p for p in pigweed_config['packages'] if p['path'].startswith('fuchsia/third_party/clang/')][0] + + # Tags should be like: + # ['git_revision:895b55537870cdaf6e4c304a09f4bf01954ccbd6'] + prefix, sha = clang_config['tags'][0].split(':') + + if sha not in version_string: + print('WARNING: clang-format may not be the right version:') + print(' PIGWEED TAG: %s' % clang_config['tags'][0]) + print(' ACTUAL VERSION: %s' % version_string) + except: + print("Failed to validate clang version.") + traceback.print_last() + + return binary + + raise Exception('Could not find a suitable clang-format') + + def runClangPrettifier(templates_file, output_dir): listOfSupportedFileExtensions = [ '.js', '.h', '.c', '.hpp', '.cpp', '.m', '.mm'] @@ -228,28 +282,17 @@ def runClangPrettifier(templates_file, output_dir): filepath)[1] in listOfSupportedFileExtensions, outputs)) if len(clangOutputs) > 0: - # NOTE: clang-format may differ in time. Currently pigweed comes - # with clang-format 15. CI may have clang-format-10 installed - # on linux. - # - # We generally want consistent formatting, so - # at this point attempt to use clang-format 15. - clang_formats = ['clang-format-15', 'clang-format'] - for clang_format in clang_formats: - args = [clang_format, '-i'] - args.extend(clangOutputs) - try: - subprocess.check_call(args) - err = None - print('Formatted using %s (%s)' % (clang_format, subprocess.check_output([clang_format, '--version']))) - for outputName in clangOutputs: - print(' - %s' % outputName) - break - except Exception as thrown: - err = thrown - # Press on to the next binary name - if err is not None: - raise err + # NOTE: clang-format differs output in time. We generally would be + # compatible only with pigweed provided clang-format (which is + # tracking non-released clang). + clang_format = getClangFormatBinary() + args = [clang_format, '-i'] + args.extend(clangOutputs) + subprocess.check_call(args) + err = None + print('Formatted using %s (%s)' % (clang_format, subprocess.check_output([clang_format, '--version']))) + for outputName in clangOutputs: + print(' - %s' % outputName) except Exception as err: print('clang-format error:', err) diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm index e1bd15f91a8ccc..66c3b15412707c 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm @@ -12282,179 +12282,180 @@ @implementation MTRUnitTestingClusterTestStructArrayArgumentResponseParams (Inte - (CHIP_ERROR)_setFieldsFromDecodableStruct: (const chip::app::Clusters::UnitTesting::Commands::TestStructArrayArgumentResponse::DecodableType &)decodableStruct { - { { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = decodableStruct.arg1.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - MTRUnitTestingClusterNestedStructList * newElement_0; - newElement_0 = [MTRUnitTestingClusterNestedStructList new]; - newElement_0.a = [NSNumber numberWithUnsignedChar:entry_0.a]; - newElement_0.b = [NSNumber numberWithBool:entry_0.b]; - newElement_0.c = [MTRUnitTestingClusterSimpleStruct new]; - newElement_0.c.a = [NSNumber numberWithUnsignedChar:entry_0.c.a]; - newElement_0.c.b = [NSNumber numberWithBool:entry_0.c.b]; - newElement_0.c.c = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.c.c)]; - newElement_0.c.d = AsData(entry_0.c.d); - newElement_0.c.e = AsString(entry_0.c.e); - if (newElement_0.c.e == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - return err; - } - newElement_0.c.f = [NSNumber numberWithUnsignedChar:entry_0.c.f.Raw()]; - newElement_0.c.g = [NSNumber numberWithFloat:entry_0.c.g]; - newElement_0.c.h = [NSNumber numberWithDouble:entry_0.c.h]; + { { // Scope for our temporary variables - auto * array_2 = [NSMutableArray new]; - auto iter_2 = entry_0.d.begin(); - while (iter_2.Next()) { - auto & entry_2 = iter_2.GetValue(); - MTRUnitTestingClusterSimpleStruct * newElement_2; - newElement_2 = [MTRUnitTestingClusterSimpleStruct new]; - newElement_2.a = [NSNumber numberWithUnsignedChar:entry_2.a]; - newElement_2.b = [NSNumber numberWithBool:entry_2.b]; - newElement_2.c = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_2.c)]; - newElement_2.d = AsData(entry_2.d); - newElement_2.e = AsString(entry_2.e); - if (newElement_2.e == nil) { + auto * array_0 = [NSMutableArray new]; + auto iter_0 = decodableStruct.arg1.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + MTRUnitTestingClusterNestedStructList * newElement_0; + newElement_0 = [MTRUnitTestingClusterNestedStructList new]; + newElement_0.a = [NSNumber numberWithUnsignedChar:entry_0.a]; + newElement_0.b = [NSNumber numberWithBool:entry_0.b]; + newElement_0.c = [MTRUnitTestingClusterSimpleStruct new]; + newElement_0.c.a = [NSNumber numberWithUnsignedChar:entry_0.c.a]; + newElement_0.c.b = [NSNumber numberWithBool:entry_0.c.b]; + newElement_0.c.c = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.c.c)]; + newElement_0.c.d = AsData(entry_0.c.d); + newElement_0.c.e = AsString(entry_0.c.e); + if (newElement_0.c.e == nil) { CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; return err; } - newElement_2.f = [NSNumber numberWithUnsignedChar:entry_2.f.Raw()]; - newElement_2.g = [NSNumber numberWithFloat:entry_2.g]; - newElement_2.h = [NSNumber numberWithDouble:entry_2.h]; - [array_2 addObject:newElement_2]; + newElement_0.c.f = [NSNumber numberWithUnsignedChar:entry_0.c.f.Raw()]; + newElement_0.c.g = [NSNumber numberWithFloat:entry_0.c.g]; + newElement_0.c.h = [NSNumber numberWithDouble:entry_0.c.h]; + { // Scope for our temporary variables + auto * array_2 = [NSMutableArray new]; + auto iter_2 = entry_0.d.begin(); + while (iter_2.Next()) { + auto & entry_2 = iter_2.GetValue(); + MTRUnitTestingClusterSimpleStruct * newElement_2; + newElement_2 = [MTRUnitTestingClusterSimpleStruct new]; + newElement_2.a = [NSNumber numberWithUnsignedChar:entry_2.a]; + newElement_2.b = [NSNumber numberWithBool:entry_2.b]; + newElement_2.c = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_2.c)]; + newElement_2.d = AsData(entry_2.d); + newElement_2.e = AsString(entry_2.e); + if (newElement_2.e == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + return err; + } + newElement_2.f = [NSNumber numberWithUnsignedChar:entry_2.f.Raw()]; + newElement_2.g = [NSNumber numberWithFloat:entry_2.g]; + newElement_2.h = [NSNumber numberWithDouble:entry_2.h]; + [array_2 addObject:newElement_2]; + } + CHIP_ERROR err = iter_2.GetStatus(); + if (err != CHIP_NO_ERROR) { + return err; + } + newElement_0.d = array_2; + } + { // Scope for our temporary variables + auto * array_2 = [NSMutableArray new]; + auto iter_2 = entry_0.e.begin(); + while (iter_2.Next()) { + auto & entry_2 = iter_2.GetValue(); + NSNumber * newElement_2; + newElement_2 = [NSNumber numberWithUnsignedInt:entry_2]; + [array_2 addObject:newElement_2]; + } + CHIP_ERROR err = iter_2.GetStatus(); + if (err != CHIP_NO_ERROR) { + return err; + } + newElement_0.e = array_2; + } + { // Scope for our temporary variables + auto * array_2 = [NSMutableArray new]; + auto iter_2 = entry_0.f.begin(); + while (iter_2.Next()) { + auto & entry_2 = iter_2.GetValue(); + NSData * newElement_2; + newElement_2 = AsData(entry_2); + [array_2 addObject:newElement_2]; + } + CHIP_ERROR err = iter_2.GetStatus(); + if (err != CHIP_NO_ERROR) { + return err; + } + newElement_0.f = array_2; + } + { // Scope for our temporary variables + auto * array_2 = [NSMutableArray new]; + auto iter_2 = entry_0.g.begin(); + while (iter_2.Next()) { + auto & entry_2 = iter_2.GetValue(); + NSNumber * newElement_2; + newElement_2 = [NSNumber numberWithUnsignedChar:entry_2]; + [array_2 addObject:newElement_2]; + } + CHIP_ERROR err = iter_2.GetStatus(); + if (err != CHIP_NO_ERROR) { + return err; + } + newElement_0.g = array_2; + } + [array_0 addObject:newElement_0]; } - CHIP_ERROR err = iter_2.GetStatus(); + CHIP_ERROR err = iter_0.GetStatus(); if (err != CHIP_NO_ERROR) { return err; } - newElement_0.d = array_2; + self.arg1 = array_0; } + } + { { // Scope for our temporary variables - auto * array_2 = [NSMutableArray new]; - auto iter_2 = entry_0.e.begin(); - while (iter_2.Next()) { - auto & entry_2 = iter_2.GetValue(); - NSNumber * newElement_2; - newElement_2 = [NSNumber numberWithUnsignedInt:entry_2]; - [array_2 addObject:newElement_2]; + auto * array_0 = [NSMutableArray new]; + auto iter_0 = decodableStruct.arg2.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + MTRUnitTestingClusterSimpleStruct * newElement_0; + newElement_0 = [MTRUnitTestingClusterSimpleStruct new]; + newElement_0.a = [NSNumber numberWithUnsignedChar:entry_0.a]; + newElement_0.b = [NSNumber numberWithBool:entry_0.b]; + newElement_0.c = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.c)]; + newElement_0.d = AsData(entry_0.d); + newElement_0.e = AsString(entry_0.e); + if (newElement_0.e == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + return err; + } + newElement_0.f = [NSNumber numberWithUnsignedChar:entry_0.f.Raw()]; + newElement_0.g = [NSNumber numberWithFloat:entry_0.g]; + newElement_0.h = [NSNumber numberWithDouble:entry_0.h]; + [array_0 addObject:newElement_0]; } - CHIP_ERROR err = iter_2.GetStatus(); + CHIP_ERROR err = iter_0.GetStatus(); if (err != CHIP_NO_ERROR) { return err; } - newElement_0.e = array_2; + self.arg2 = array_0; } + } + { { // Scope for our temporary variables - auto * array_2 = [NSMutableArray new]; - auto iter_2 = entry_0.f.begin(); - while (iter_2.Next()) { - auto & entry_2 = iter_2.GetValue(); - NSData * newElement_2; - newElement_2 = AsData(entry_2); - [array_2 addObject:newElement_2]; + auto * array_0 = [NSMutableArray new]; + auto iter_0 = decodableStruct.arg3.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + NSNumber * newElement_0; + newElement_0 = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0)]; + [array_0 addObject:newElement_0]; } - CHIP_ERROR err = iter_2.GetStatus(); + CHIP_ERROR err = iter_0.GetStatus(); if (err != CHIP_NO_ERROR) { return err; } - newElement_0.f = array_2; + self.arg3 = array_0; } + } + { { // Scope for our temporary variables - auto * array_2 = [NSMutableArray new]; - auto iter_2 = entry_0.g.begin(); - while (iter_2.Next()) { - auto & entry_2 = iter_2.GetValue(); - NSNumber * newElement_2; - newElement_2 = [NSNumber numberWithUnsignedChar:entry_2]; - [array_2 addObject:newElement_2]; + auto * array_0 = [NSMutableArray new]; + auto iter_0 = decodableStruct.arg4.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + NSNumber * newElement_0; + newElement_0 = [NSNumber numberWithBool:entry_0]; + [array_0 addObject:newElement_0]; } - CHIP_ERROR err = iter_2.GetStatus(); + CHIP_ERROR err = iter_0.GetStatus(); if (err != CHIP_NO_ERROR) { return err; } - newElement_0.g = array_2; - } - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - return err; - } - self.arg1 = array_0; -} -} -{ - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = decodableStruct.arg2.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - MTRUnitTestingClusterSimpleStruct * newElement_0; - newElement_0 = [MTRUnitTestingClusterSimpleStruct new]; - newElement_0.a = [NSNumber numberWithUnsignedChar:entry_0.a]; - newElement_0.b = [NSNumber numberWithBool:entry_0.b]; - newElement_0.c = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.c)]; - newElement_0.d = AsData(entry_0.d); - newElement_0.e = AsString(entry_0.e); - if (newElement_0.e == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - return err; - } - newElement_0.f = [NSNumber numberWithUnsignedChar:entry_0.f.Raw()]; - newElement_0.g = [NSNumber numberWithFloat:entry_0.g]; - newElement_0.h = [NSNumber numberWithDouble:entry_0.h]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - return err; + self.arg4 = array_0; } - self.arg2 = array_0; } -} -{ - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = decodableStruct.arg3.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0)]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - return err; - } - self.arg3 = array_0; + { + self.arg5 = [NSNumber numberWithUnsignedChar:chip::to_underlying(decodableStruct.arg5)]; } -} -{ - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = decodableStruct.arg4.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithBool:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - return err; - } - self.arg4 = array_0; + { + self.arg6 = [NSNumber numberWithBool:decodableStruct.arg6]; } -} -{ - self.arg5 = [NSNumber numberWithUnsignedChar:chip::to_underlying(decodableStruct.arg5)]; -} -{ - self.arg6 = [NSNumber numberWithBool:decodableStruct.arg6]; -} -return CHIP_NO_ERROR; + return CHIP_NO_ERROR; } @end diff --git a/third_party/pigweed/repo b/third_party/pigweed/repo index d6b036c2c385b8..7c875693d478ac 160000 --- a/third_party/pigweed/repo +++ b/third_party/pigweed/repo @@ -1 +1 @@ -Subproject commit d6b036c2c385b8934e83d6d4d258870ccfcc1e08 +Subproject commit 7c875693d478ac0da2f358a1542a4fc1cad1b60d 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 0f6bc8b423c395..0d755baec83fee 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 @@ -186,8 +186,8 @@ enum class MoveMode : uint8_t kUnknownEnumValue = 2, }; #else // CHIP_USE_ENUM_CLASS_FOR_IM_ENUM -using MoveMode = EmberAfMoveMode; -static MoveMode __attribute__((unused)) kMoveModekUnknownEnumValue = static_cast(2); +using MoveMode = EmberAfMoveMode; +static MoveMode __attribute__((unused)) kMoveModekUnknownEnumValue = static_cast(2); #endif // CHIP_USE_ENUM_CLASS_FOR_IM_ENUM // Need to convert consumers to using the new enum classes, so we @@ -205,8 +205,8 @@ enum class StepMode : uint8_t kUnknownEnumValue = 2, }; #else // CHIP_USE_ENUM_CLASS_FOR_IM_ENUM -using StepMode = EmberAfStepMode; -static StepMode __attribute__((unused)) kStepModekUnknownEnumValue = static_cast(2); +using StepMode = EmberAfStepMode; +static StepMode __attribute__((unused)) kStepModekUnknownEnumValue = static_cast(2); #endif // CHIP_USE_ENUM_CLASS_FOR_IM_ENUM // Bitmap for Feature @@ -1050,8 +1050,8 @@ enum class RadioFaultEnum : uint8_t kUnknownEnumValue = 7, }; #else // CHIP_USE_ENUM_CLASS_FOR_IM_ENUM -using RadioFaultEnum = EmberAfRadioFaultEnum; -static RadioFaultEnum __attribute__((unused)) kRadioFaultEnumkUnknownEnumValue = static_cast(7); +using RadioFaultEnum = EmberAfRadioFaultEnum; +static RadioFaultEnum __attribute__((unused)) kRadioFaultEnumkUnknownEnumValue = static_cast(7); #endif // CHIP_USE_ENUM_CLASS_FOR_IM_ENUM } // namespace GeneralDiagnostics @@ -1213,8 +1213,8 @@ enum class PHYRateEnum : uint8_t kUnknownEnumValue = 10, }; #else // CHIP_USE_ENUM_CLASS_FOR_IM_ENUM -using PHYRateEnum = EmberAfPHYRateEnum; -static PHYRateEnum __attribute__((unused)) kPHYRateEnumkUnknownEnumValue = static_cast(10); +using PHYRateEnum = EmberAfPHYRateEnum; +static PHYRateEnum __attribute__((unused)) kPHYRateEnumkUnknownEnumValue = static_cast(10); #endif // CHIP_USE_ENUM_CLASS_FOR_IM_ENUM // Bitmap for Feature @@ -3173,8 +3173,8 @@ enum class ColorMode : uint8_t kUnknownEnumValue = 3, }; #else // CHIP_USE_ENUM_CLASS_FOR_IM_ENUM -using ColorMode = EmberAfColorMode; -static ColorMode __attribute__((unused)) kColorModekUnknownEnumValue = static_cast(3); +using ColorMode = EmberAfColorMode; +static ColorMode __attribute__((unused)) kColorModekUnknownEnumValue = static_cast(3); #endif // CHIP_USE_ENUM_CLASS_FOR_IM_ENUM // Enum for HueDirection