From 12231957eeda7997850b4971707649084126fb00 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Wed, 24 Nov 2021 02:18:06 -0500 Subject: [PATCH] Add support for odd-sized (3, 5, 6, 7 bytes) integer types for attributes (#11870) * Add support for odd-sized (3, 5, 6, 7 bytes) integer types for attributes. Fixes https://github.com/project-chip/connectedhomeip/issues/8202 * Make it easier to test both endian-nesses of NumericAttributeTraits. * Fix null representation for the signed case. * Add unit tests for NumericAttributeTraits for unusual integer sizes. Co-authored-by: Thomas Lykkeberg --- .../all-clusters-common/all-clusters-app.zap | 4 +- src/app/tests/BUILD.gn | 1 + src/app/tests/TestNumericAttributeTraits.cpp | 1054 ++ .../util/attribute-storage-null-handling.h | 57 +- .../util/ember-compatibility-functions.cpp | 97 +- src/app/util/odd-sized-integers.h | 235 + .../common/attributes/Accessors.js | 23 +- .../app/attributes/Accessors-src.zapt | 27 +- .../data_model/controller-clusters.zap | 4 +- .../java/zap-generated/CHIPCallbackTypes.h | 4 + .../java/zap-generated/CHIPClusters-JNI.cpp | 186 + .../zap-generated/CHIPClustersRead-JNI.cpp | 73 + .../chip/devicecontroller/ChipClusters.java | 56 + .../devicecontroller/ClusterReadMapping.java | 26 + .../devicecontroller/ClusterWriteMapping.java | 36 + .../python/chip/clusters/CHIPClusters.cpp | 46 + .../python/chip/clusters/CHIPClusters.py | 42 + .../CHIP/zap-generated/CHIPClustersObjc.h | 17 + .../CHIP/zap-generated/CHIPClustersObjc.mm | 112 + .../Framework/CHIPTests/CHIPClustersTests.m | 85 + .../zap-generated/endpoint_config.h | 347 +- .../zap-generated/attributes/Accessors.cpp | 10110 ++++++++++------ .../zap-generated/attributes/Accessors.h | 50 + .../zap-generated/cluster/Commands.h | 247 + .../zap-generated/reporting/Commands.h | 12 + .../zap-generated/CHIPClusters.cpp | 80 + .../zap-generated/CHIPClusters.h | 14 + 27 files changed, 9126 insertions(+), 3919 deletions(-) create mode 100644 src/app/tests/TestNumericAttributeTraits.cpp create mode 100644 src/app/util/odd-sized-integers.h diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap index d7927af71a4ce6..a2dcec02d081bd 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap @@ -11262,7 +11262,7 @@ "code": 21, "mfgCode": null, "side": "server", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, @@ -11277,7 +11277,7 @@ "code": 22, "mfgCode": null, "side": "server", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, diff --git a/src/app/tests/BUILD.gn b/src/app/tests/BUILD.gn index 2afac555a09b5b..703af8c94fc5f4 100644 --- a/src/app/tests/BUILD.gn +++ b/src/app/tests/BUILD.gn @@ -53,6 +53,7 @@ chip_test_suite("tests") { "TestEventPathParams.cpp", "TestInteractionModelEngine.cpp", "TestMessageDef.cpp", + "TestNumericAttributeTraits.cpp", "TestReadInteraction.cpp", "TestReportingEngine.cpp", "TestStatusResponseMessage.cpp", diff --git a/src/app/tests/TestNumericAttributeTraits.cpp b/src/app/tests/TestNumericAttributeTraits.cpp new file mode 100644 index 00000000000000..e96657563a66fc --- /dev/null +++ b/src/app/tests/TestNumericAttributeTraits.cpp @@ -0,0 +1,1054 @@ +/* + * + * Copyright (c) 2021 Project CHIP Authors + * All rights reserved. + * + * 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. + */ + +/** + * @file + * This file implements unit tests for the NumericAttributeTraits object + * which includes handling of odd sized intergers in the attribute store. + * + * StorageType is the type used in the attribute store. Ie. a 24-bit attribute + * must occupy exactly 3 bytes in the attribute store. But for the 24-bit + * WorkingType the best suitable type must be used, as long as it is >= 3 bytes. + * + */ + +#include +#include + +// We are testing the odd-sized-integers.h module +#include + +using namespace chip; +using namespace chip::app; + +namespace { + +//////////////////////////////////////////////////////////// +// ______ __ __ _______ ______ ________ // +// / \ / | / | / \ / |/ | // +// /$$$$$$ |$$ | $$ | $$$$$$$ |$$$$$$/ $$$$$$$$/ // +// $$____$$ |$$ |__$$ | $$ |__$$ | $$ | $$ | // +// / $$/ $$ $$ | $$ $$< $$ | $$ | // +// /$$$$$$/ $$$$$$$$ | $$$$$$$ | $$ | $$ | // +// $$ |_____ $$ | $$ |__$$ | _$$ |_ $$ | // +// $$ | $$ | $$ $$/ / $$ | $$ | // +// $$$$$$$$/ $$/ $$$$$$$/ $$$$$$/ $$/ // +// // +//////////////////////////////////////////////////////////// +void Test_UINT24_LE(nlTestSuite * apSuite, void * apContext) +{ + // Unsigned 24-bit Integer : 3 bytes - little-endian + using IntType = NumericAttributeTraits, false>; + using StorageType = typename IntType::StorageType; + using WorkingType = typename IntType::WorkingType; + + StorageType sValue; + WorkingType wValue; + StorageType sNullValue; + WorkingType wNullValue; + const StorageType storageTestData = { 0x56, 0x34, 0x12 }; + const WorkingType workingTestUnsignedNullValue = 16777215; // 0xFFFFFF + + // 1) Verify the size of the types + NL_TEST_ASSERT(apSuite, sizeof(sValue) == 3); + NL_TEST_ASSERT(apSuite, sizeof(wValue) >= 3); + + // Initialize the Storage Value with the test-buffer + memcpy(&sValue, storageTestData, sizeof(sValue)); + + // Convert the Storage Type to Working Type and + wValue = IntType::StorageToWorking(sValue); + + // 2) Verify that the correct storage format has been used + NL_TEST_ASSERT(apSuite, wValue == 0x123456); + + StorageType sNewValue; + + // Convert back to Storage Value + IntType::WorkingToStorage(wValue, sNewValue); + + // 3) Verify that the bytes are located as intended + NL_TEST_ASSERT(apSuite, memcmp(storageTestData, &sNewValue, sizeof(sNewValue)) == 0); + + // Set Storage value to Null + IntType::SetNull(sNullValue); + wNullValue = IntType::StorageToWorking(sNullValue); + NL_TEST_ASSERT(apSuite, wNullValue == workingTestUnsignedNullValue); + NL_TEST_ASSERT(apSuite, (IntType::IsNullValue(sNullValue) == true)); + + // Verify that null values can fit into not nullable + NL_TEST_ASSERT(apSuite, (IntType::CanRepresentValue(false, sNullValue) == true)); + + // Verify that null values can't fit into nullable + NL_TEST_ASSERT(apSuite, (IntType::CanRepresentValue(true, sNullValue) == false)); +} + +void Test_UINT24_BE(nlTestSuite * apSuite, void * apContext) +{ + // Unsigned 24-bit Integer : 3 bytes - big-endian + using IntType = NumericAttributeTraits, true>; + using StorageType = typename IntType::StorageType; + using WorkingType = typename IntType::WorkingType; + + StorageType sValue; + WorkingType wValue; + StorageType sNullValue; + WorkingType wNullValue; + const StorageType storageTestData = { 0x12, 0x34, 0x56 }; + const WorkingType workingTestUnsignedNullValue = 16777215; // 0xFFFFFF + + // 1) Verify the size of the types + NL_TEST_ASSERT(apSuite, sizeof(sValue) == 3); + NL_TEST_ASSERT(apSuite, sizeof(wValue) >= 3); + + // Initialize the Storage Value with the test-buffer + memcpy(&sValue, storageTestData, sizeof(sValue)); + + // Convert the Storage Type to Working Type and + wValue = IntType::StorageToWorking(sValue); + + // 2) Verify that the correct storage format has been used + NL_TEST_ASSERT(apSuite, wValue == 0x123456); + + StorageType sNewValue; + + // Convert back to Storage Value + IntType::WorkingToStorage(wValue, sNewValue); + + // 3) Verify that the bytes are located as intended + NL_TEST_ASSERT(apSuite, memcmp(storageTestData, &sNewValue, sizeof(sNewValue)) == 0); + + // Set Storage value to Null + IntType::SetNull(sNullValue); + wNullValue = IntType::StorageToWorking(sNullValue); + NL_TEST_ASSERT(apSuite, wNullValue == workingTestUnsignedNullValue); + NL_TEST_ASSERT(apSuite, (IntType::IsNullValue(sNullValue) == true)); + + // Verify that null values can fit into not nullable + NL_TEST_ASSERT(apSuite, (IntType::CanRepresentValue(false, sNullValue) == true)); + + // Verify that null values can't fit into nullable + NL_TEST_ASSERT(apSuite, (IntType::CanRepresentValue(true, sNullValue) == false)); +} + +void Test_SINT24_LE(nlTestSuite * apSuite, void * apContext) +{ + // Signed 24-bit Integer : 3 bytes - little-endian + using IntType = NumericAttributeTraits, false>; + using StorageType = typename IntType::StorageType; + using WorkingType = typename IntType::WorkingType; + + StorageType sValuePos; + WorkingType wValuePos; + StorageType sValueNeg; + WorkingType wValueNeg; + + const StorageType storageTestDataPos = { 0xEF, 0xFE, 0x7F }; // 8388335 + const StorageType storageTestDataNeg = { 0x11, 0x22, 0x80 }; // -8379887 + const WorkingType workingDataPos = 8388335; // 0x7FFEEF + const WorkingType workingDataNeg = -8379887; // INV(0x802211) = 0x7FDDEE + 1 => -0x7FDDEF + const WorkingType workingTestSignedNullValue = -8388608; // -0x800000 + + // 1) Verify the size of the types + NL_TEST_ASSERT(apSuite, sizeof(sValuePos) == 3); + NL_TEST_ASSERT(apSuite, sizeof(wValuePos) >= 3); + NL_TEST_ASSERT(apSuite, sizeof(sValueNeg) == 3); + NL_TEST_ASSERT(apSuite, sizeof(wValueNeg) >= 3); + + // Initialize the Storage Values with the test-buffer + memcpy(&sValuePos, storageTestDataPos, sizeof(sValuePos)); + memcpy(&sValueNeg, storageTestDataNeg, sizeof(sValueNeg)); + + // Convert the Storage Types to Working Types and + wValuePos = IntType::StorageToWorking(sValuePos); + wValueNeg = IntType::StorageToWorking(sValueNeg); + + // 2) Verify that the correct storage format has been used + NL_TEST_ASSERT(apSuite, wValuePos == workingDataPos); + NL_TEST_ASSERT(apSuite, wValueNeg == workingDataNeg); + + StorageType sNewValuePos; + StorageType sNewValueNeg; + + // Convert back to Storage Values + IntType::WorkingToStorage(wValuePos, sNewValuePos); + IntType::WorkingToStorage(wValueNeg, sNewValueNeg); + + // 3) Verify that the bytes are located as intended + NL_TEST_ASSERT(apSuite, memcmp(storageTestDataPos, &sNewValuePos, sizeof(sNewValuePos)) == 0); + NL_TEST_ASSERT(apSuite, memcmp(storageTestDataNeg, &sNewValueNeg, sizeof(sNewValueNeg)) == 0); + + StorageType sNullValue; + WorkingType wNullValue; + + // Set Storage value to Null + IntType::SetNull(sNullValue); + wNullValue = IntType::StorageToWorking(sNullValue); + NL_TEST_ASSERT(apSuite, wNullValue == workingTestSignedNullValue); + NL_TEST_ASSERT(apSuite, (IntType::IsNullValue(sNullValue) == true)); + + // Verify that null values can fit into not nullable + NL_TEST_ASSERT(apSuite, (IntType::CanRepresentValue(false, sNullValue) == true)); + NL_TEST_ASSERT(apSuite, (IntType::CanRepresentValue(false, wNullValue) == true)); + + // Verify that null values can't fit into nullable + NL_TEST_ASSERT(apSuite, (IntType::CanRepresentValue(true, sNullValue) == false)); + NL_TEST_ASSERT(apSuite, (IntType::CanRepresentValue(true, wNullValue) == false)); +} + +void Test_SINT24_BE(nlTestSuite * apSuite, void * apContext) +{ + // Signed 24-bit Integer : 3 bytes - big-endian + using IntType = NumericAttributeTraits, true>; + using StorageType = typename IntType::StorageType; + using WorkingType = typename IntType::WorkingType; + + StorageType sValuePos; + WorkingType wValuePos; + StorageType sValueNeg; + WorkingType wValueNeg; + + const StorageType storageTestDataPos = { 0x7F, 0xFE, 0xEF }; // 8388335 + const StorageType storageTestDataNeg = { 0x80, 0x22, 0x11 }; // -8379887 + const WorkingType workingDataPos = 8388335; // 0x7FFEEF + const WorkingType workingDataNeg = -8379887; // INV(0x802211) = 0x7FDDEE + 1 => -0x7FDDEF + const WorkingType workingTestSignedNullValue = -8388608; // -0x800000 + + // 1) Verify the size of the types + NL_TEST_ASSERT(apSuite, sizeof(sValuePos) == 3); + NL_TEST_ASSERT(apSuite, sizeof(wValuePos) >= 3); + NL_TEST_ASSERT(apSuite, sizeof(sValueNeg) == 3); + NL_TEST_ASSERT(apSuite, sizeof(wValueNeg) >= 3); + + // Initialize the Storage Values with the test-buffer + memcpy(&sValuePos, storageTestDataPos, sizeof(sValuePos)); + memcpy(&sValueNeg, storageTestDataNeg, sizeof(sValueNeg)); + + // Convert the Storage Types to Working Types and + wValuePos = IntType::StorageToWorking(sValuePos); + wValueNeg = IntType::StorageToWorking(sValueNeg); + + // 2) Verify that the correct storage format has been used + NL_TEST_ASSERT(apSuite, wValuePos == workingDataPos); + NL_TEST_ASSERT(apSuite, wValueNeg == workingDataNeg); + + StorageType sNewValuePos; + StorageType sNewValueNeg; + + // Convert back to Storage Values + IntType::WorkingToStorage(wValuePos, sNewValuePos); + IntType::WorkingToStorage(wValueNeg, sNewValueNeg); + + // 3) Verify that the bytes are located as intended + NL_TEST_ASSERT(apSuite, memcmp(storageTestDataPos, &sNewValuePos, sizeof(sNewValuePos)) == 0); + NL_TEST_ASSERT(apSuite, memcmp(storageTestDataNeg, &sNewValueNeg, sizeof(sNewValueNeg)) == 0); + + StorageType sNullValue; + WorkingType wNullValue; + + // Set Storage value to Null + IntType::SetNull(sNullValue); + wNullValue = IntType::StorageToWorking(sNullValue); + NL_TEST_ASSERT(apSuite, wNullValue == workingTestSignedNullValue); + NL_TEST_ASSERT(apSuite, (IntType::IsNullValue(sNullValue) == true)); + + // Verify that null values can fit into not nullable + NL_TEST_ASSERT(apSuite, (IntType::CanRepresentValue(false, sNullValue) == true)); + NL_TEST_ASSERT(apSuite, (IntType::CanRepresentValue(false, wNullValue) == true)); + + // Verify that null values can't fit into nullable + NL_TEST_ASSERT(apSuite, (IntType::CanRepresentValue(true, sNullValue) == false)); + NL_TEST_ASSERT(apSuite, (IntType::CanRepresentValue(true, wNullValue) == false)); +} + +//////////////////////////////////////////////////////////// +// __ __ ______ _______ ______ ________ // +// / | / | / \ / \ / |/ | // +// $$ | $$ |/$$$$$$ | $$$$$$$ |$$$$$$/ $$$$$$$$/ // +// $$ |__$$ |$$$ \$$ | $$ |__$$ | $$ | $$ | // +// $$ $$ |$$$$ $$ | $$ $$< $$ | $$ | // +// $$$$$$$$ |$$ $$ $$ | $$$$$$$ | $$ | $$ | // +// $$ |$$ \$$$$ | $$ |__$$ | _$$ |_ $$ | // +// $$ |$$ $$$/ $$ $$/ / $$ | $$ | // +// $$/ $$$$$$/ $$$$$$$/ $$$$$$/ $$/ // +// // +//////////////////////////////////////////////////////////// +void Test_UINT40_LE(nlTestSuite * apSuite, void * apContext) +{ + // Unsigned 40-bit Integer : 5 bytes - little-endian + using IntType = NumericAttributeTraits, false>; + using StorageType = typename IntType::StorageType; + using WorkingType = typename IntType::WorkingType; + + StorageType sValue; + WorkingType wValue; + StorageType sNullValue; + WorkingType wNullValue; + const StorageType storageTestData = { 0x9A, 0x78, 0x56, 0x34, 0x12 }; + const WorkingType workingTestUnsignedNullValue = 1099511627775; // 0xFFFFFFFFFF + + // 1) Verify the size of the types + NL_TEST_ASSERT(apSuite, sizeof(sValue) == 5); + NL_TEST_ASSERT(apSuite, sizeof(wValue) >= 5); + + // Initialize the Storage Value with the test-buffer + memcpy(&sValue, storageTestData, sizeof(sValue)); + + // Convert the Storage Type to Working Type and + wValue = IntType::StorageToWorking(sValue); + + // 2) Verify that the correct storage format has been used + NL_TEST_ASSERT(apSuite, wValue == 0x123456789A); + + StorageType sNewValue; + + // Convert back to Storage Value + IntType::WorkingToStorage(wValue, sNewValue); + + // 3) Verify that the bytes are located as intended + NL_TEST_ASSERT(apSuite, memcmp(storageTestData, &sNewValue, sizeof(sNewValue)) == 0); + + // Set Storage value to Null + IntType::SetNull(sNullValue); + wNullValue = IntType::StorageToWorking(sNullValue); + NL_TEST_ASSERT(apSuite, wNullValue == workingTestUnsignedNullValue); + NL_TEST_ASSERT(apSuite, (IntType::IsNullValue(sNullValue) == true)); + + // Verify that null values can fit into not nullable + NL_TEST_ASSERT(apSuite, (IntType::CanRepresentValue(false, sNullValue) == true)); + + // Verify that null values can't fit into nullable + NL_TEST_ASSERT(apSuite, (IntType::CanRepresentValue(true, sNullValue) == false)); +} + +void Test_UINT40_BE(nlTestSuite * apSuite, void * apContext) +{ + // Unsigned 40-bit Integer : 5 bytes - big-endian + using IntType = NumericAttributeTraits, true>; + using StorageType = typename IntType::StorageType; + using WorkingType = typename IntType::WorkingType; + + StorageType sValue; + WorkingType wValue; + StorageType sNullValue; + WorkingType wNullValue; + const StorageType storageTestData = { 0x12, 0x34, 0x56, 0x78, 0x9A }; + const WorkingType workingTestUnsignedNullValue = 1099511627775; // 0xFFFFFFFFFF + // 1) Verify the size of the types + NL_TEST_ASSERT(apSuite, sizeof(sValue) == 5); + NL_TEST_ASSERT(apSuite, sizeof(wValue) >= 5); + + // Initialize the Storage Value with the test-buffer + memcpy(&sValue, storageTestData, sizeof(sValue)); + + // Convert the Storage Type to Working Type and + wValue = IntType::StorageToWorking(sValue); + + // 2) Verify that the correct storage format has been used + NL_TEST_ASSERT(apSuite, wValue == 0x123456789A); + + StorageType sNewValue; + + // Convert back to Storage Value + IntType::WorkingToStorage(wValue, sNewValue); + + // 3) Verify that the bytes are located as intended + NL_TEST_ASSERT(apSuite, memcmp(storageTestData, &sNewValue, sizeof(sNewValue)) == 0); + + // Set Storage value to Null + IntType::SetNull(sNullValue); + wNullValue = IntType::StorageToWorking(sNullValue); + NL_TEST_ASSERT(apSuite, wNullValue == workingTestUnsignedNullValue); + NL_TEST_ASSERT(apSuite, (IntType::IsNullValue(sNullValue) == true)); + + // Verify that null values can fit into not nullable + NL_TEST_ASSERT(apSuite, (IntType::CanRepresentValue(false, sNullValue) == true)); + + // Verify that null values can't fit into nullable + NL_TEST_ASSERT(apSuite, (IntType::CanRepresentValue(true, sNullValue) == false)); +} + +void Test_SINT40_LE(nlTestSuite * apSuite, void * apContext) +{ + // Signed 40-bit Integer : 5 bytes - little-endian + using IntType = NumericAttributeTraits, false>; + using StorageType = typename IntType::StorageType; + using WorkingType = typename IntType::WorkingType; + + StorageType sValuePos; + WorkingType wValuePos; + StorageType sValueNeg; + WorkingType wValueNeg; + + const StorageType storageTestDataPos = { 0xEF, 0xFE, 0xEE, 0xFF, 0x7F }; // 549754699503 + const StorageType storageTestDataNeg = { 0x11, 0x22, 0x33, 0x44, 0x80 }; // -548611612143 + const WorkingType workingDataPos = 549754699503; // 0x7FFFEEFEEF + const WorkingType workingDataNeg = -548611612143; // INV(0x8044332211) = 0x7FBBCCDDEE + 1 => -0x7FBBCCDDEF + const WorkingType workingTestSignedNullValue = -549755813888; // -0x8000000000 + + // 1) Verify the size of the types + NL_TEST_ASSERT(apSuite, sizeof(sValuePos) == 5); + NL_TEST_ASSERT(apSuite, sizeof(wValuePos) >= 5); + NL_TEST_ASSERT(apSuite, sizeof(sValueNeg) == 5); + NL_TEST_ASSERT(apSuite, sizeof(wValueNeg) >= 5); + + // Initialize the Storage Values with the test-buffer + memcpy(&sValuePos, storageTestDataPos, sizeof(sValuePos)); + memcpy(&sValueNeg, storageTestDataNeg, sizeof(sValueNeg)); + + // Convert the Storage Types to Working Types and + wValuePos = IntType::StorageToWorking(sValuePos); + wValueNeg = IntType::StorageToWorking(sValueNeg); + + // 2) Verify that the correct storage format has been used + NL_TEST_ASSERT(apSuite, wValuePos == workingDataPos); + NL_TEST_ASSERT(apSuite, wValueNeg == workingDataNeg); + + StorageType sNewValuePos; + StorageType sNewValueNeg; + + // Convert back to Storage Values + IntType::WorkingToStorage(wValuePos, sNewValuePos); + IntType::WorkingToStorage(wValueNeg, sNewValueNeg); + + // 3) Verify that the bytes are located as intended + NL_TEST_ASSERT(apSuite, memcmp(storageTestDataPos, &sNewValuePos, sizeof(sNewValuePos)) == 0); + NL_TEST_ASSERT(apSuite, memcmp(storageTestDataNeg, &sNewValueNeg, sizeof(sNewValueNeg)) == 0); + + StorageType sNullValue; + WorkingType wNullValue; + + // Set Storage value to Null + IntType::SetNull(sNullValue); + wNullValue = IntType::StorageToWorking(sNullValue); + NL_TEST_ASSERT(apSuite, wNullValue == workingTestSignedNullValue); + NL_TEST_ASSERT(apSuite, (IntType::IsNullValue(sNullValue) == true)); + + // Verify that null values can fit into not nullable + NL_TEST_ASSERT(apSuite, (IntType::CanRepresentValue(false, sNullValue) == true)); + NL_TEST_ASSERT(apSuite, (IntType::CanRepresentValue(false, wNullValue) == true)); + + // Verify that null values can't fit into nullable + NL_TEST_ASSERT(apSuite, (IntType::CanRepresentValue(true, sNullValue) == false)); + NL_TEST_ASSERT(apSuite, (IntType::CanRepresentValue(true, wNullValue) == false)); +} + +void Test_SINT40_BE(nlTestSuite * apSuite, void * apContext) +{ + // Signed 40-bit Integer : 5 bytes - big-endian + using IntType = NumericAttributeTraits, true>; + using StorageType = typename IntType::StorageType; + using WorkingType = typename IntType::WorkingType; + + StorageType sValuePos; + WorkingType wValuePos; + StorageType sValueNeg; + WorkingType wValueNeg; + + const StorageType storageTestDataPos = { 0x7F, 0xFF, 0xEE, 0xFE, 0xEF }; // 549754699503 + const StorageType storageTestDataNeg = { 0x80, 0x44, 0x33, 0x22, 0x11 }; // -548611612143 + const WorkingType workingDataPos = 549754699503; // 0x7FFFEEFEEF + const WorkingType workingDataNeg = -548611612143; // INV(0x8044332211) = 0x7FBBCCDDEE + 1 => -0x7FBBCCDDEF + const WorkingType workingTestSignedNullValue = -549755813888; // -0x8000000000 + + // 1) Verify the size of the types + NL_TEST_ASSERT(apSuite, sizeof(sValuePos) == 5); + NL_TEST_ASSERT(apSuite, sizeof(wValuePos) >= 5); + NL_TEST_ASSERT(apSuite, sizeof(sValueNeg) == 5); + NL_TEST_ASSERT(apSuite, sizeof(wValueNeg) >= 5); + + // Initialize the Storage Values with the test-buffer + memcpy(&sValuePos, storageTestDataPos, sizeof(sValuePos)); + memcpy(&sValueNeg, storageTestDataNeg, sizeof(sValueNeg)); + + // Convert the Storage Types to Working Types and + wValuePos = IntType::StorageToWorking(sValuePos); + wValueNeg = IntType::StorageToWorking(sValueNeg); + + // 2) Verify that the correct storage format has been used + NL_TEST_ASSERT(apSuite, wValuePos == workingDataPos); + NL_TEST_ASSERT(apSuite, wValueNeg == workingDataNeg); + + StorageType sNewValuePos; + StorageType sNewValueNeg; + + // Convert back to Storage Values + IntType::WorkingToStorage(wValuePos, sNewValuePos); + IntType::WorkingToStorage(wValueNeg, sNewValueNeg); + + // 3) Verify that the bytes are located as intended + NL_TEST_ASSERT(apSuite, memcmp(storageTestDataPos, &sNewValuePos, sizeof(sNewValuePos)) == 0); + NL_TEST_ASSERT(apSuite, memcmp(storageTestDataNeg, &sNewValueNeg, sizeof(sNewValueNeg)) == 0); + + StorageType sNullValue; + WorkingType wNullValue; + + // Set Storage value to Null + IntType::SetNull(sNullValue); + wNullValue = IntType::StorageToWorking(sNullValue); + NL_TEST_ASSERT(apSuite, wNullValue == workingTestSignedNullValue); + NL_TEST_ASSERT(apSuite, (IntType::IsNullValue(sNullValue) == true)); + + // Verify that null values can fit into not nullable + NL_TEST_ASSERT(apSuite, (IntType::CanRepresentValue(false, sNullValue) == true)); + NL_TEST_ASSERT(apSuite, (IntType::CanRepresentValue(false, wNullValue) == true)); + + // Verify that null values can't fit into nullable + NL_TEST_ASSERT(apSuite, (IntType::CanRepresentValue(true, sNullValue) == false)); + NL_TEST_ASSERT(apSuite, (IntType::CanRepresentValue(true, wNullValue) == false)); +} + +//////////////////////////////////////////////////////////// +// __ __ ______ _______ ______ ________ // +// / | / | / \ / \ / |/ | // +// $$ | $$ |/$$$$$$ | $$$$$$$ |$$$$$$/ $$$$$$$$/ // +// $$ |__$$ |$$ \__$$ | $$ |__$$ | $$ | $$ | // +// $$ $$ |$$ $$< $$ $$< $$ | $$ | // +// $$$$$$$$ | $$$$$$ | $$$$$$$ | $$ | $$ | // +// $$ |$$ \__$$ | $$ |__$$ | _$$ |_ $$ | // +// $$ |$$ $$/ $$ $$/ / $$ | $$ | // +// $$/ $$$$$$/ $$$$$$$/ $$$$$$/ $$/ // +// // +//////////////////////////////////////////////////////////// +void Test_UINT48_LE(nlTestSuite * apSuite, void * apContext) +{ + // Unsigned 48-bit Integer : 6 bytes - little-endian + using IntType = NumericAttributeTraits, false>; + using StorageType = typename IntType::StorageType; + using WorkingType = typename IntType::WorkingType; + + StorageType sValue; + WorkingType wValue; + StorageType sNullValue; + WorkingType wNullValue; + const StorageType storageTestData = { 0xBC, 0x9A, 0x78, 0x56, 0x34, 0x12 }; + const WorkingType workingTestUnsignedNullValue = 281474976710655; // 0xFFFFFFFFFFFF + + // 1) Verify the size of the types + NL_TEST_ASSERT(apSuite, sizeof(sValue) == 6); + NL_TEST_ASSERT(apSuite, sizeof(wValue) >= 6); + + // Initialize the Storage Value with the test-buffer + memcpy(&sValue, storageTestData, sizeof(sValue)); + + // Convert the Storage Type to Working Type and + wValue = IntType::StorageToWorking(sValue); + + // 2) Verify that the correct storage format has been used + NL_TEST_ASSERT(apSuite, wValue == 0x123456789ABC); + + StorageType sNewValue; + + // Convert back to Storage Value + IntType::WorkingToStorage(wValue, sNewValue); + + // 3) Verify that the bytes are located as intended + NL_TEST_ASSERT(apSuite, memcmp(storageTestData, &sNewValue, sizeof(sNewValue)) == 0); + + // Set Storage value to Null + IntType::SetNull(sNullValue); + wNullValue = IntType::StorageToWorking(sNullValue); + NL_TEST_ASSERT(apSuite, wNullValue == workingTestUnsignedNullValue); + NL_TEST_ASSERT(apSuite, (IntType::IsNullValue(sNullValue) == true)); + + // Verify that null values can fit into not nullable + NL_TEST_ASSERT(apSuite, (IntType::CanRepresentValue(false, sNullValue) == true)); + + // Verify that null values can't fit into nullable + NL_TEST_ASSERT(apSuite, (IntType::CanRepresentValue(true, sNullValue) == false)); +} + +void Test_UINT48_BE(nlTestSuite * apSuite, void * apContext) +{ + // Unsigned 48-bit Integer : 6 bytes - big-endian + using IntType = NumericAttributeTraits, true>; + using StorageType = typename IntType::StorageType; + using WorkingType = typename IntType::WorkingType; + + StorageType sValue; + WorkingType wValue; + StorageType sNullValue; + WorkingType wNullValue; + const StorageType storageTestData = { 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC }; + const WorkingType workingTestUnsignedNullValue = 281474976710655; // 0xFFFFFFFFFFFF + + // 1) Verify the size of the types + NL_TEST_ASSERT(apSuite, sizeof(sValue) == 6); + NL_TEST_ASSERT(apSuite, sizeof(wValue) >= 6); + + // Initialize the Storage Value with the test-buffer + memcpy(&sValue, storageTestData, sizeof(sValue)); + + // Convert the Storage Type to Working Type and + wValue = IntType::StorageToWorking(sValue); + + // 2) Verify that the correct storage format has been used + NL_TEST_ASSERT(apSuite, wValue == 0x123456789ABC); + + StorageType sNewValue; + + // Convert back to Storage Value + IntType::WorkingToStorage(wValue, sNewValue); + + // 3) Verify that the bytes are located as intended + NL_TEST_ASSERT(apSuite, memcmp(storageTestData, &sNewValue, sizeof(sNewValue)) == 0); + + // Set Storage value to Null + IntType::SetNull(sNullValue); + wNullValue = IntType::StorageToWorking(sNullValue); + NL_TEST_ASSERT(apSuite, wNullValue == workingTestUnsignedNullValue); + NL_TEST_ASSERT(apSuite, (IntType::IsNullValue(sNullValue) == true)); + + // Verify that null values can fit into not nullable + NL_TEST_ASSERT(apSuite, (IntType::CanRepresentValue(false, sNullValue) == true)); + + // Verify that null values can't fit into nullable + NL_TEST_ASSERT(apSuite, (IntType::CanRepresentValue(true, sNullValue) == false)); +} + +void Test_SINT48_LE(nlTestSuite * apSuite, void * apContext) +{ + // Signed 48-bit Integer : 6 bytes - little-endian + using IntType = NumericAttributeTraits, false>; + using StorageType = typename IntType::StorageType; + using WorkingType = typename IntType::WorkingType; + + StorageType sValuePos; + WorkingType wValuePos; + StorageType sValueNeg; + WorkingType wValueNeg; + + const StorageType storageTestDataPos = { 0xEF, 0xFE, 0xEE, 0xFF, 0x00, 0x7F }; // 139642270580463 + const StorageType storageTestDataNeg = { 0x11, 0x22, 0x33, 0x44, 0x55, 0x80 }; // -140371271933423 + const WorkingType workingDataPos = 139642270580463; // 0x7F00FFEEFEEF + const WorkingType workingDataNeg = -140371271933423; // INV(0x805544332211) = 0x7FAABBCCDDEE + 1 => -0x7FAABBCCDDEF + const WorkingType workingTestSignedNullValue = -140737488355328; // -0x800000000000 + + // 1) Verify the size of the types + NL_TEST_ASSERT(apSuite, sizeof(sValuePos) == 6); + NL_TEST_ASSERT(apSuite, sizeof(wValuePos) >= 6); + NL_TEST_ASSERT(apSuite, sizeof(sValueNeg) == 6); + NL_TEST_ASSERT(apSuite, sizeof(wValueNeg) >= 6); + + // Initialize the Storage Values with the test-buffer + memcpy(&sValuePos, storageTestDataPos, sizeof(sValuePos)); + memcpy(&sValueNeg, storageTestDataNeg, sizeof(sValueNeg)); + + // Convert the Storage Types to Working Types and + wValuePos = IntType::StorageToWorking(sValuePos); + wValueNeg = IntType::StorageToWorking(sValueNeg); + + // 2) Verify that the correct storage format has been used + NL_TEST_ASSERT(apSuite, wValuePos == workingDataPos); + NL_TEST_ASSERT(apSuite, wValueNeg == workingDataNeg); + + StorageType sNewValuePos; + StorageType sNewValueNeg; + + // Convert back to Storage Values + IntType::WorkingToStorage(wValuePos, sNewValuePos); + IntType::WorkingToStorage(wValueNeg, sNewValueNeg); + + // 3) Verify that the bytes are located as intended + NL_TEST_ASSERT(apSuite, memcmp(storageTestDataPos, &sNewValuePos, sizeof(sNewValuePos)) == 0); + NL_TEST_ASSERT(apSuite, memcmp(storageTestDataNeg, &sNewValueNeg, sizeof(sNewValueNeg)) == 0); + + StorageType sNullValue; + WorkingType wNullValue; + + // Set Storage value to Null + IntType::SetNull(sNullValue); + wNullValue = IntType::StorageToWorking(sNullValue); + NL_TEST_ASSERT(apSuite, wNullValue == workingTestSignedNullValue); + NL_TEST_ASSERT(apSuite, (IntType::IsNullValue(sNullValue) == true)); + + // Verify that null values can fit into not nullable + NL_TEST_ASSERT(apSuite, (IntType::CanRepresentValue(false, sNullValue) == true)); + NL_TEST_ASSERT(apSuite, (IntType::CanRepresentValue(false, wNullValue) == true)); + + // Verify that null values can't fit into nullable + NL_TEST_ASSERT(apSuite, (IntType::CanRepresentValue(true, sNullValue) == false)); + NL_TEST_ASSERT(apSuite, (IntType::CanRepresentValue(true, wNullValue) == false)); +} + +void Test_SINT48_BE(nlTestSuite * apSuite, void * apContext) +{ + // Signed 48-bit Integer : 6 bytes - big-endian + using IntType = NumericAttributeTraits, true>; + using StorageType = typename IntType::StorageType; + using WorkingType = typename IntType::WorkingType; + + StorageType sValuePos; + WorkingType wValuePos; + StorageType sValueNeg; + WorkingType wValueNeg; + + const StorageType storageTestDataPos = { 0x7F, 0x00, 0xFF, 0xEE, 0xFE, 0xEF }; // 139642270580463 + const StorageType storageTestDataNeg = { 0x80, 0x55, 0x44, 0x33, 0x22, 0x11 }; // -140371271933423 + const WorkingType workingDataPos = 139642270580463; // 0x7F00FFEEFEEF + const WorkingType workingDataNeg = -140371271933423; // INV(0x805544332211) = 0x7FAABBCCDDEE + 1 => -0x7FAABBCCDDEF + const WorkingType workingTestSignedNullValue = -140737488355328; // -0x800000000000 + + // 1) Verify the size of the types + NL_TEST_ASSERT(apSuite, sizeof(sValuePos) == 6); + NL_TEST_ASSERT(apSuite, sizeof(wValuePos) >= 6); + NL_TEST_ASSERT(apSuite, sizeof(sValueNeg) == 6); + NL_TEST_ASSERT(apSuite, sizeof(wValueNeg) >= 6); + + // Initialize the Storage Values with the test-buffer + memcpy(&sValuePos, storageTestDataPos, sizeof(sValuePos)); + memcpy(&sValueNeg, storageTestDataNeg, sizeof(sValueNeg)); + + // Convert the Storage Types to Working Types and + wValuePos = IntType::StorageToWorking(sValuePos); + wValueNeg = IntType::StorageToWorking(sValueNeg); + + // 2) Verify that the correct storage format has been used + NL_TEST_ASSERT(apSuite, wValuePos == workingDataPos); + NL_TEST_ASSERT(apSuite, wValueNeg == workingDataNeg); + + StorageType sNewValuePos; + StorageType sNewValueNeg; + + // Convert back to Storage Values + IntType::WorkingToStorage(wValuePos, sNewValuePos); + IntType::WorkingToStorage(wValueNeg, sNewValueNeg); + + // 3) Verify that the bytes are located as intended + NL_TEST_ASSERT(apSuite, memcmp(storageTestDataPos, &sNewValuePos, sizeof(sNewValuePos)) == 0); + NL_TEST_ASSERT(apSuite, memcmp(storageTestDataNeg, &sNewValueNeg, sizeof(sNewValueNeg)) == 0); + + StorageType sNullValue; + WorkingType wNullValue; + + // Set Storage value to Null + IntType::SetNull(sNullValue); + wNullValue = IntType::StorageToWorking(sNullValue); + NL_TEST_ASSERT(apSuite, wNullValue == workingTestSignedNullValue); + NL_TEST_ASSERT(apSuite, (IntType::IsNullValue(sNullValue) == true)); + + // Verify that null values can fit into not nullable + NL_TEST_ASSERT(apSuite, (IntType::CanRepresentValue(false, sNullValue) == true)); + NL_TEST_ASSERT(apSuite, (IntType::CanRepresentValue(false, wNullValue) == true)); + + // Verify that null values can't fit into nullable + NL_TEST_ASSERT(apSuite, (IntType::CanRepresentValue(true, sNullValue) == false)); + NL_TEST_ASSERT(apSuite, (IntType::CanRepresentValue(true, wNullValue) == false)); +} + +//////////////////////////////////////////////////////////// +// _______ ______ _______ ______ ________ // +// / | / \ / \ / |/ | // +// $$$$$$$/ /$$$$$$ | $$$$$$$ |$$$$$$/ $$$$$$$$/ // +// $$ |____ $$ \__$$/ $$ |__$$ | $$ | $$ | // +// $$ \ $$ \ $$ $$< $$ | $$ | // +// $$$$$$$ |$$$$$$$ | $$$$$$$ | $$ | $$ | // +// / \__$$ |$$ \__$$ | $$ |__$$ | _$$ |_ $$ | // +// $$ $$/ $$ $$/ $$ $$/ / $$ | $$ | // +// $$$$$$/ $$$$$$/ $$$$$$$/ $$$$$$/ $$/ // +// // +//////////////////////////////////////////////////////////// +void Test_UINT56_LE(nlTestSuite * apSuite, void * apContext) +{ + // Unsigned 56-bit Integer : 7 bytes - little-endian + using IntType = NumericAttributeTraits, false>; + using StorageType = typename IntType::StorageType; + using WorkingType = typename IntType::WorkingType; + + StorageType sValue; + WorkingType wValue; + StorageType sNullValue; + WorkingType wNullValue; + const StorageType storageTestData = { 0xDE, 0xBC, 0x9A, 0x78, 0x56, 0x34, 0x12 }; + const WorkingType workingTestUnsignedNullValue = 72057594037927935; // 0xFFFFFFFFFFFFFF + + // 1) Verify the size of the types + NL_TEST_ASSERT(apSuite, sizeof(sValue) == 7); + NL_TEST_ASSERT(apSuite, sizeof(wValue) >= 7); + + // Initialize the Storage Value with the test-buffer + memcpy(&sValue, storageTestData, sizeof(sValue)); + + // Convert the Storage Type to Working Type and + wValue = IntType::StorageToWorking(sValue); + + // 2) Verify that the correct storage format has been used + NL_TEST_ASSERT(apSuite, wValue == 0x123456789ABCDE); + + StorageType sNewValue; + + // Convert back to Storage Value + IntType::WorkingToStorage(wValue, sNewValue); + + // 3) Verify that the bytes are located as intended + NL_TEST_ASSERT(apSuite, memcmp(storageTestData, &sNewValue, sizeof(sNewValue)) == 0); + + // Set Storage value to Null + IntType::SetNull(sNullValue); + wNullValue = IntType::StorageToWorking(sNullValue); + NL_TEST_ASSERT(apSuite, wNullValue == workingTestUnsignedNullValue); + NL_TEST_ASSERT(apSuite, (IntType::IsNullValue(sNullValue) == true)); + + // Verify that null values can fit into not nullable + NL_TEST_ASSERT(apSuite, (IntType::CanRepresentValue(false, sNullValue) == true)); + + // Verify that null values can't fit into nullable + NL_TEST_ASSERT(apSuite, (IntType::CanRepresentValue(true, sNullValue) == false)); +} + +void Test_UINT56_BE(nlTestSuite * apSuite, void * apContext) +{ + // Unsigned 56-bit Integer : 7 bytes - big-endian + using IntType = NumericAttributeTraits, true>; + using StorageType = typename IntType::StorageType; + using WorkingType = typename IntType::WorkingType; + + StorageType sValue; + WorkingType wValue; + StorageType sNullValue; + WorkingType wNullValue; + const StorageType storageTestData = { 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE }; + const WorkingType workingTestUnsignedNullValue = 72057594037927935; // 0xFFFFFFFFFFFFFF + + // 1) Verify the size of the types + NL_TEST_ASSERT(apSuite, sizeof(sValue) == 7); + NL_TEST_ASSERT(apSuite, sizeof(wValue) >= 7); + + // Initialize the Storage Value with the test-buffer + memcpy(&sValue, storageTestData, sizeof(sValue)); + + // Convert the Storage Type to Working Type and + wValue = IntType::StorageToWorking(sValue); + + // 2) Verify that the correct storage format has been used + NL_TEST_ASSERT(apSuite, wValue == 0x123456789ABCDE); + + StorageType sNewValue; + + // Convert back to Storage Value + IntType::WorkingToStorage(wValue, sNewValue); + + // 3) Verify that the bytes are located as intended + NL_TEST_ASSERT(apSuite, memcmp(storageTestData, &sNewValue, sizeof(sNewValue)) == 0); + + // Set Storage value to Null + IntType::SetNull(sNullValue); + wNullValue = IntType::StorageToWorking(sNullValue); + NL_TEST_ASSERT(apSuite, wNullValue == workingTestUnsignedNullValue); + NL_TEST_ASSERT(apSuite, (IntType::IsNullValue(sNullValue) == true)); + + // Verify that null values can fit into not nullable + NL_TEST_ASSERT(apSuite, (IntType::CanRepresentValue(false, sNullValue) == true)); + + // Verify that null values can't fit into nullable + NL_TEST_ASSERT(apSuite, (IntType::CanRepresentValue(true, sNullValue) == false)); +} + +void Test_SINT56_LE(nlTestSuite * apSuite, void * apContext) +{ + // Signed 56-bit Integer : 6 bytes - little-endian + using IntType = NumericAttributeTraits, false>; + using StorageType = typename IntType::StorageType; + using WorkingType = typename IntType::WorkingType; + + StorageType sValuePos; + WorkingType wValuePos; + StorageType sValueNeg; + WorkingType wValueNeg; + + const StorageType storageTestDataPos = { 0xEF, 0xFE, 0xEE, 0xFF, 0x00, 0x11, 0x7F }; // 35766018033778415 + const StorageType storageTestDataNeg = { 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x80 }; // -35916280616508911 + const WorkingType workingDataPos = 35766018033778415; // 0x7F1100FFEEFEEF + const WorkingType workingDataNeg = -35916280616508911; // INV(0x80665544332211) = 0x7F99AABBCCDDEE + 1 => 0x7F99AABBCCDDEF + const WorkingType workingTestSignedNullValue = -36028797018963968; // -0x80000000000000 + + // 1) Verify the size of the types + NL_TEST_ASSERT(apSuite, sizeof(sValuePos) == 7); + NL_TEST_ASSERT(apSuite, sizeof(wValuePos) >= 7); + NL_TEST_ASSERT(apSuite, sizeof(sValueNeg) == 7); + NL_TEST_ASSERT(apSuite, sizeof(wValueNeg) >= 7); + + // Initialize the Storage Values with the test-buffer + memcpy(&sValuePos, storageTestDataPos, sizeof(sValuePos)); + memcpy(&sValueNeg, storageTestDataNeg, sizeof(sValueNeg)); + + // Convert the Storage Types to Working Types and + wValuePos = IntType::StorageToWorking(sValuePos); + wValueNeg = IntType::StorageToWorking(sValueNeg); + + // 2) Verify that the correct storage format has been used + NL_TEST_ASSERT(apSuite, wValuePos == workingDataPos); + NL_TEST_ASSERT(apSuite, wValueNeg == workingDataNeg); + + StorageType sNewValuePos; + StorageType sNewValueNeg; + + // Convert back to Storage Values + IntType::WorkingToStorage(wValuePos, sNewValuePos); + IntType::WorkingToStorage(wValueNeg, sNewValueNeg); + + // 3) Verify that the bytes are located as intended + NL_TEST_ASSERT(apSuite, memcmp(storageTestDataPos, &sNewValuePos, sizeof(sNewValuePos)) == 0); + NL_TEST_ASSERT(apSuite, memcmp(storageTestDataNeg, &sNewValueNeg, sizeof(sNewValueNeg)) == 0); + + StorageType sNullValue; + WorkingType wNullValue; + + // Set Storage value to Null + IntType::SetNull(sNullValue); + wNullValue = IntType::StorageToWorking(sNullValue); + NL_TEST_ASSERT(apSuite, wNullValue == workingTestSignedNullValue); + NL_TEST_ASSERT(apSuite, (IntType::IsNullValue(sNullValue) == true)); + + // Verify that null values can fit into not nullable + NL_TEST_ASSERT(apSuite, (IntType::CanRepresentValue(false, sNullValue) == true)); + NL_TEST_ASSERT(apSuite, (IntType::CanRepresentValue(false, wNullValue) == true)); + + // Verify that null values can't fit into nullable + NL_TEST_ASSERT(apSuite, (IntType::CanRepresentValue(true, sNullValue) == false)); + NL_TEST_ASSERT(apSuite, (IntType::CanRepresentValue(true, wNullValue) == false)); +} + +void Test_SINT56_BE(nlTestSuite * apSuite, void * apContext) +{ + // Signed 56-bit Integer : 7 bytes - big-endian + using IntType = NumericAttributeTraits, true>; + using StorageType = typename IntType::StorageType; + using WorkingType = typename IntType::WorkingType; + + StorageType sValuePos; + WorkingType wValuePos; + StorageType sValueNeg; + WorkingType wValueNeg; + + const StorageType storageTestDataPos = { 0x7F, 0x11, 0x00, 0xFF, 0xEE, 0xFE, 0xEF }; // 35766018033778415 + const StorageType storageTestDataNeg = { 0x80, 0x66, 0x55, 0x44, 0x33, 0x22, 0x11 }; // -35916280616508911 + const WorkingType workingDataPos = 35766018033778415; // 0x7F1100FFEEFEEF + const WorkingType workingDataNeg = -35916280616508911; // INV(0x80665544332211) = 0x7F99AABBCCDDEE + 1 => 0x7F99AABBCCDDEF + const WorkingType workingTestSignedNullValue = -36028797018963968; // -0x80000000000000 + + // 1) Verify the size of the types + NL_TEST_ASSERT(apSuite, sizeof(sValuePos) == 7); + NL_TEST_ASSERT(apSuite, sizeof(wValuePos) >= 7); + NL_TEST_ASSERT(apSuite, sizeof(sValueNeg) == 7); + NL_TEST_ASSERT(apSuite, sizeof(wValueNeg) >= 7); + + // Initialize the Storage Values with the test-buffer + memcpy(&sValuePos, storageTestDataPos, sizeof(sValuePos)); + memcpy(&sValueNeg, storageTestDataNeg, sizeof(sValueNeg)); + + // Convert the Storage Types to Working Types and + wValuePos = IntType::StorageToWorking(sValuePos); + wValueNeg = IntType::StorageToWorking(sValueNeg); + + // 2) Verify that the correct storage format has been used + NL_TEST_ASSERT(apSuite, wValuePos == workingDataPos); + NL_TEST_ASSERT(apSuite, wValueNeg == workingDataNeg); + + StorageType sNewValuePos; + StorageType sNewValueNeg; + + // Convert back to Storage Values + IntType::WorkingToStorage(wValuePos, sNewValuePos); + IntType::WorkingToStorage(wValueNeg, sNewValueNeg); + + // 3) Verify that the bytes are located as intended + NL_TEST_ASSERT(apSuite, memcmp(storageTestDataPos, &sNewValuePos, sizeof(sNewValuePos)) == 0); + NL_TEST_ASSERT(apSuite, memcmp(storageTestDataNeg, &sNewValueNeg, sizeof(sNewValueNeg)) == 0); + + StorageType sNullValue; + WorkingType wNullValue; + + // Set Storage value to Null + IntType::SetNull(sNullValue); + wNullValue = IntType::StorageToWorking(sNullValue); + NL_TEST_ASSERT(apSuite, wNullValue == workingTestSignedNullValue); + NL_TEST_ASSERT(apSuite, (IntType::IsNullValue(sNullValue) == true)); + + // Verify that null values can fit into not nullable + NL_TEST_ASSERT(apSuite, (IntType::CanRepresentValue(false, sNullValue) == true)); + NL_TEST_ASSERT(apSuite, (IntType::CanRepresentValue(false, wNullValue) == true)); + + // Verify that null values can't fit into nullable + NL_TEST_ASSERT(apSuite, (IntType::CanRepresentValue(true, sNullValue) == false)); + NL_TEST_ASSERT(apSuite, (IntType::CanRepresentValue(true, wNullValue) == false)); +} + +static int TestSetup(void * inContext) +{ + return SUCCESS; +} + +/** + * Tear down the test suite. + */ +static int TestTeardown(void * inContext) +{ + return SUCCESS; +} + +/** + * Test Suite. It lists all the test functions. + */ + +// clang-format off +const nlTest sTests[] = +{ + NL_TEST_DEF("Test_UINT24_LE",Test_UINT24_LE), + NL_TEST_DEF("Test_SINT24_LE",Test_SINT24_LE), + NL_TEST_DEF("Test_UINT24_BE",Test_UINT24_BE), + NL_TEST_DEF("Test_SINT24_BE",Test_SINT24_BE), + + NL_TEST_DEF("Test_UINT40_LE",Test_UINT40_LE), + NL_TEST_DEF("Test_SINT40_LE",Test_SINT40_LE), + NL_TEST_DEF("Test_UINT40_BE",Test_UINT40_BE), + NL_TEST_DEF("Test_SINT40_BE",Test_SINT40_BE), + + NL_TEST_DEF("Test_UINT48_LE",Test_UINT48_LE), + NL_TEST_DEF("Test_SINT48_LE",Test_SINT48_LE), + NL_TEST_DEF("Test_UINT48_BE",Test_UINT48_BE), + NL_TEST_DEF("Test_SINT48_BE",Test_SINT48_BE), + + NL_TEST_DEF("Test_UINT56_LE",Test_UINT56_LE), + NL_TEST_DEF("Test_SINT56_LE",Test_SINT56_LE), + NL_TEST_DEF("Test_UINT56_BE",Test_UINT56_BE), + NL_TEST_DEF("Test_SINT56_BE",Test_SINT56_BE), + + NL_TEST_SENTINEL() +}; +// clang-format on + +// clang-format off +nlTestSuite theSuite = +{ + "TestNumericAttributeTraits", + &sTests[0], + TestSetup, + TestTeardown +}; +// clang-format on + +} // namespace + +int TestNumericAttributeTraits() +{ + nlTestRunner(&theSuite, NULL); + return (nlTestRunnerStats(&theSuite)); +} + +CHIP_REGISTER_TEST_SUITE(TestNumericAttributeTraits) diff --git a/src/app/util/attribute-storage-null-handling.h b/src/app/util/attribute-storage-null-handling.h index b7a6d908fac6b3..935a54cccd26c1 100644 --- a/src/app/util/attribute-storage-null-handling.h +++ b/src/app/util/attribute-storage-null-handling.h @@ -17,6 +17,7 @@ #pragma once +#include #include #include @@ -24,13 +25,36 @@ namespace chip { namespace app { -template +template struct NumericAttributeTraits { // StorageType is the type used to represent this C++ type in the attribute // store. using StorageType = T; + // WorkingType is the type used to represent this C++ type when we are + // actually working with it as a value. + using WorkingType = T; + + // Convert a working value to a storage value. This uses an outparam + // instead of a return value because some specializations have complicated + // StorageTypes that can't be returned by value. This function can assume + // that WorkingType passed a CanRepresentValue check. + static constexpr void WorkingToStorage(WorkingType workingValue, StorageType & storageValue) { storageValue = workingValue; } + + // Convert a storage value to a working value. Some specializations do more + // interesting things here. + static constexpr WorkingType StorageToWorking(StorageType storageValue) { return storageValue; } + // The value reserved in the value space of StorageType to represent null, // for cases when we have a nullable value. This value must match the value // excluded from the valid value range in the spec, so that we don't confuse @@ -40,6 +64,8 @@ struct NumericAttributeTraits static constexpr bool IsNullValue(StorageType value) { return value == kNullValue; } + static constexpr void SetNull(StorageType & value) { value = kNullValue; } + // Test whether a value can be represented in a "not null" value of the // given type, which may be a nullable value or not. This needs to be // implemented for both T and StorageType if the two are distinct. @@ -52,20 +78,45 @@ struct NumericAttributeTraits // it's doing. return !isNullable || !IsNullValue(value); } + + static CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag, StorageType value) + { + return writer.Put(tag, static_cast(value)); + } + + // Utility that lets consumers treat a StorageType instance as a uint8_t* + // for writing to the attribute store. + static uint8_t * ToAttributeStoreRepresentation(StorageType & value) { return reinterpret_cast(&value); } }; template <> struct NumericAttributeTraits { - using StorageType = uint8_t; - static constexpr StorageType kNullValue = 0xFF; + using StorageType = uint8_t; + using WorkingType = bool; + + static constexpr void WorkingToStorage(WorkingType workingValue, StorageType & storageValue) { storageValue = workingValue; } + + static constexpr WorkingType StorageToWorking(StorageType storageValue) { return storageValue; } + static constexpr bool IsNullValue(StorageType value) { return value == kNullValue; } + static constexpr void SetNull(StorageType & value) { value = kNullValue; } static constexpr bool CanRepresentValue(bool isNullable, StorageType value) { // This treats all nonzero values (except the null value) as true. return !IsNullValue(value); } static constexpr bool CanRepresentValue(bool isNullable, bool value) { return true; } + + static CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag, StorageType value) + { + return writer.Put(tag, static_cast(value)); + } + + static uint8_t * ToAttributeStoreRepresentation(StorageType & value) { return reinterpret_cast(&value); } + +private: + static constexpr StorageType kNullValue = 0xFF; }; } // namespace app diff --git a/src/app/util/ember-compatibility-functions.cpp b/src/app/util/ember-compatibility-functions.cpp index a2d08b902cfdfd..c3699ea1fbf74d 100644 --- a/src/app/util/ember-compatibility-functions.cpp +++ b/src/app/util/ember-compatibility-functions.cpp @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include @@ -198,7 +199,7 @@ CHIP_ERROR attributeBufferToNumericTlvData(TLV::TLVWriter & writer, bool isNulla return CHIP_ERROR_INCORRECT_STATE; } - return writer.Put(tag, static_cast(value)); + return NumericAttributeTraits::Encode(writer, tag, value); } } // anonymous namespace @@ -283,11 +284,35 @@ CHIP_ERROR ReadSingleClusterData(FabricIndex aAccessingFabricIndex, const Concre ReturnErrorOnFailure(attributeBufferToNumericTlvData(*writer, isNullable)); break; } + case ZCL_INT24U_ATTRIBUTE_TYPE: // Unsigned 24-bit integer + { + using IntType = OddSizedInteger<3, false>; + ReturnErrorOnFailure(attributeBufferToNumericTlvData(*writer, isNullable)); + break; + } case ZCL_INT32U_ATTRIBUTE_TYPE: // Unsigned 32-bit integer { ReturnErrorOnFailure(attributeBufferToNumericTlvData(*writer, isNullable)); break; } + case ZCL_INT40U_ATTRIBUTE_TYPE: // Unsigned 40-bit integer + { + using IntType = OddSizedInteger<5, false>; + ReturnErrorOnFailure(attributeBufferToNumericTlvData(*writer, isNullable)); + break; + } + case ZCL_INT48U_ATTRIBUTE_TYPE: // Unsigned 48-bit integer + { + using IntType = OddSizedInteger<6, false>; + ReturnErrorOnFailure(attributeBufferToNumericTlvData(*writer, isNullable)); + break; + } + case ZCL_INT56U_ATTRIBUTE_TYPE: // Unsigned 56-bit integer + { + using IntType = OddSizedInteger<7, false>; + ReturnErrorOnFailure(attributeBufferToNumericTlvData(*writer, isNullable)); + break; + } case ZCL_INT64U_ATTRIBUTE_TYPE: // Unsigned 64-bit integer { ReturnErrorOnFailure(attributeBufferToNumericTlvData(*writer, isNullable)); @@ -303,11 +328,35 @@ CHIP_ERROR ReadSingleClusterData(FabricIndex aAccessingFabricIndex, const Concre ReturnErrorOnFailure(attributeBufferToNumericTlvData(*writer, isNullable)); break; } + case ZCL_INT24S_ATTRIBUTE_TYPE: // Signed 24-bit integer + { + using IntType = OddSizedInteger<3, true>; + ReturnErrorOnFailure(attributeBufferToNumericTlvData(*writer, isNullable)); + break; + } case ZCL_INT32S_ATTRIBUTE_TYPE: // Signed 32-bit integer { ReturnErrorOnFailure(attributeBufferToNumericTlvData(*writer, isNullable)); break; } + case ZCL_INT40S_ATTRIBUTE_TYPE: // Signed 40-bit integer + { + using IntType = OddSizedInteger<5, true>; + ReturnErrorOnFailure(attributeBufferToNumericTlvData(*writer, isNullable)); + break; + } + case ZCL_INT48S_ATTRIBUTE_TYPE: // Signed 48-bit integer + { + using IntType = OddSizedInteger<6, true>; + ReturnErrorOnFailure(attributeBufferToNumericTlvData(*writer, isNullable)); + break; + } + case ZCL_INT56S_ATTRIBUTE_TYPE: // Signed 56-bit integer + { + using IntType = OddSizedInteger<7, true>; + ReturnErrorOnFailure(attributeBufferToNumericTlvData(*writer, isNullable)); + break; + } case ZCL_INT64S_ATTRIBUTE_TYPE: // Signed 64-bit integer { ReturnErrorOnFailure(attributeBufferToNumericTlvData(*writer, isNullable)); @@ -459,14 +508,14 @@ CHIP_ERROR numericTlvDataToAttributeBuffer(TLV::TLVReader & aReader, bool isNull static_assert(sizeof(value) <= sizeof(attributeData), "Value cannot fit into attribute data"); if (isNullable && aReader.GetType() == TLV::kTLVType_Null) { - value = NumericAttributeTraits::kNullValue; + NumericAttributeTraits::SetNull(value); } else { - T val; + typename NumericAttributeTraits::WorkingType val; ReturnErrorOnFailure(aReader.Get(val)); VerifyOrReturnError(NumericAttributeTraits::CanRepresentValue(isNullable, val), CHIP_ERROR_INVALID_ARGUMENT); - value = val; + NumericAttributeTraits::WorkingToStorage(val, value); } dataLen = sizeof(value); memcpy(attributeData, &value, sizeof(value)); @@ -515,16 +564,56 @@ CHIP_ERROR prepareWriteData(const EmberAfAttributeMetadata * metadata, TLV::TLVR return numericTlvDataToAttributeBuffer(aReader, isNullable, dataLen); case ZCL_INT16U_ATTRIBUTE_TYPE: // Unsigned 16-bit integer return numericTlvDataToAttributeBuffer(aReader, isNullable, dataLen); + case ZCL_INT24U_ATTRIBUTE_TYPE: // Unsigned 24-bit integer + { + using IntType = OddSizedInteger<3, false>; + return numericTlvDataToAttributeBuffer(aReader, isNullable, dataLen); + } case ZCL_INT32U_ATTRIBUTE_TYPE: // Unsigned 32-bit integer return numericTlvDataToAttributeBuffer(aReader, isNullable, dataLen); + case ZCL_INT40U_ATTRIBUTE_TYPE: // Unsigned 40-bit integer + { + using IntType = OddSizedInteger<5, false>; + return numericTlvDataToAttributeBuffer(aReader, isNullable, dataLen); + } + case ZCL_INT48U_ATTRIBUTE_TYPE: // Unsigned 48-bit integer + { + using IntType = OddSizedInteger<6, false>; + return numericTlvDataToAttributeBuffer(aReader, isNullable, dataLen); + } + case ZCL_INT56U_ATTRIBUTE_TYPE: // Unsigned 56-bit integer + { + using IntType = OddSizedInteger<7, false>; + return numericTlvDataToAttributeBuffer(aReader, isNullable, dataLen); + } case ZCL_INT64U_ATTRIBUTE_TYPE: // Unsigned 64-bit integer return numericTlvDataToAttributeBuffer(aReader, isNullable, dataLen); case ZCL_INT8S_ATTRIBUTE_TYPE: // Signed 8-bit integer return numericTlvDataToAttributeBuffer(aReader, isNullable, dataLen); case ZCL_INT16S_ATTRIBUTE_TYPE: // Signed 16-bit integer return numericTlvDataToAttributeBuffer(aReader, isNullable, dataLen); + case ZCL_INT24S_ATTRIBUTE_TYPE: // Signed 24-bit integer + { + using IntType = OddSizedInteger<3, true>; + return numericTlvDataToAttributeBuffer(aReader, isNullable, dataLen); + } case ZCL_INT32S_ATTRIBUTE_TYPE: // Signed 32-bit integer return numericTlvDataToAttributeBuffer(aReader, isNullable, dataLen); + case ZCL_INT40S_ATTRIBUTE_TYPE: // Signed 40-bit integer + { + using IntType = OddSizedInteger<5, true>; + return numericTlvDataToAttributeBuffer(aReader, isNullable, dataLen); + } + case ZCL_INT48S_ATTRIBUTE_TYPE: // Signed 48-bit integer + { + using IntType = OddSizedInteger<6, true>; + return numericTlvDataToAttributeBuffer(aReader, isNullable, dataLen); + } + case ZCL_INT56S_ATTRIBUTE_TYPE: // Signed 56-bit integer + { + using IntType = OddSizedInteger<7, true>; + return numericTlvDataToAttributeBuffer(aReader, isNullable, dataLen); + } case ZCL_INT64S_ATTRIBUTE_TYPE: // Signed 64-bit integer return numericTlvDataToAttributeBuffer(aReader, isNullable, dataLen); case ZCL_OCTET_STRING_ATTRIBUTE_TYPE: // Octet string diff --git a/src/app/util/odd-sized-integers.h b/src/app/util/odd-sized-integers.h new file mode 100644 index 00000000000000..f5f1bb50c6b4bf --- /dev/null +++ b/src/app/util/odd-sized-integers.h @@ -0,0 +1,235 @@ +/* + * + * 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. + */ + +#pragma once + +#include +#include + +#include + +namespace chip { +namespace app { + +namespace detail { +template +struct WorkingTypeMapper +{ +}; +template +struct WorkingTypeMapper +{ + using WorkingType = int64_t; +}; +template <> +struct WorkingTypeMapper<3, true> +{ + using WorkingType = int32_t; +}; +template +struct WorkingTypeMapper +{ + using WorkingType = uint64_t; +}; +template <> +struct WorkingTypeMapper<3, false> +{ + using WorkingType = uint32_t; +}; +} // namespace detail + +template +struct OddSizedInteger +{ + // WorkingType is the type we use to represent the value as an actual + // integer that we can do arithmetic, greater/less-than compares, etc on. + using WorkingType = typename detail::WorkingTypeMapper::WorkingType; + + // StorageType is the type "at rest" in the attribute store. It's a + // native-endian byte buffer. + using StorageType = uint8_t[ByteSize]; +}; + +namespace detail { +template +struct IntegerByteIndexing; + +template +struct IntegerByteIndexing +{ + static constexpr int highIndex = 0; + static constexpr int lowIndex = ByteSize - 1; + static constexpr int lowerIndex = 1; + static constexpr int raiseIndex = -1; + static constexpr int pastLowIndex = ByteSize; + static constexpr int pastHighIndex = -1; +}; + +template +struct IntegerByteIndexing +{ + static constexpr int highIndex = ByteSize - 1; + static constexpr int lowIndex = 0; + static constexpr int lowerIndex = -1; + static constexpr int raiseIndex = 1; + static constexpr int pastLowIndex = -1; + static constexpr int pastHighIndex = ByteSize; +}; +} // namespace detail + +template +struct NumericAttributeTraits, IsBigEndian> : detail::IntegerByteIndexing +{ + using IntType = OddSizedInteger; + // StorageType is the type "at rest" in the attribute store. It's a + // native-endian byte buffer. + using StorageType = typename IntType::StorageType; + // WorkingType is the type we use to represent the value as an actual + // integer that we can do arithmetic, greater/less-than compares, etc on. + using WorkingType = typename IntType::WorkingType; + + using Indexing = detail::IntegerByteIndexing; + using Indexing::highIndex; + using Indexing::lowerIndex; + using Indexing::lowIndex; + using Indexing::pastHighIndex; + using Indexing::pastLowIndex; + using Indexing::raiseIndex; + + static constexpr WorkingType StorageToWorking(StorageType storageValue) + { + // WorkingType can always fit all of our bit-shifting, because it has at + // least one extra byte. + WorkingType value = 0; + for (int i = highIndex; i != pastLowIndex; i += lowerIndex) + { + value = (value << 8) | storageValue[i]; + } + + // If unsigned, we are done. If signed, we need to make sure our high + // bit gets treated as a sign bit, not a value bit, with our bits in 2s + // complement. + if (IsSigned) + { + constexpr WorkingType MaxPositive = (static_cast(1) << (8 * ByteSize - 1)) - 1; + if (value > MaxPositive) + { + value = value - (static_cast(1) << (8 * ByteSize)); + } + } + + return value; + } + + static constexpr void WorkingToStorage(WorkingType workingValue, StorageType & storageValue) + { + // We can just grab the low ByteSize bytes of workingValue. + for (int i = lowIndex; i != pastHighIndex; i += raiseIndex) + { + // Casting to uint8_t exactly grabs the lowest byte. + storageValue[i] = static_cast(workingValue); + workingValue = workingValue >> 8; + } + } + + static constexpr bool IsNullValue(StorageType value) + { + if (IsSigned) + { + // Check for the equivalent of the most negative integer, in 2s + // complement notation. + if (value[highIndex] != 0x80) + { + return false; + } + for (int i = highIndex + lowerIndex; i != pastLowIndex; i += lowerIndex) + { + if (value[i] != 0x00) + { + return false; + } + } + return true; + } + + // Check for the equivalent of the largest unsigned integer. + for (int i = highIndex; i != pastLowIndex; i += lowerIndex) + { + if (value[i] != 0xFF) + { + return false; + } + } + return true; + } + + static constexpr void SetNull(StorageType & value) + { + if (IsSigned) + { + value[highIndex] = 0x80; + for (int i = highIndex + lowerIndex; i != pastLowIndex; i += lowerIndex) + { + value[i] = 0x00; + } + } + else + { + for (int i = highIndex; i != pastLowIndex; i += lowerIndex) + { + value[i] = 0xFF; + } + } + } + + static constexpr bool CanRepresentValue(bool isNullable, StorageType value) { return !isNullable || !IsNullValue(value); } + + static constexpr bool CanRepresentValue(bool isNullable, WorkingType value) + { + // Since WorkingType has at least one extra byte, none of our bitshifts + // overflow. + if (IsSigned) + { + WorkingType max = (static_cast(1) << (8 * ByteSize - 1)) - 1; + WorkingType min = -max; + if (!isNullable) + { + // We have one more value. + min -= 1; + } + return value >= min && value <= max; + } + + WorkingType max = (static_cast(1) << (8 * ByteSize)) - 1; + if (isNullable) + { + // we have one less value + max -= 1; + } + return value <= max; + } + + static CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag, StorageType value) + { + return writer.Put(tag, StorageToWorking(value)); + } + + static uint8_t * ToAttributeStoreRepresentation(StorageType & value) { return value; } +}; + +} // namespace app +} // namespace chip diff --git a/src/app/zap-templates/common/attributes/Accessors.js b/src/app/zap-templates/common/attributes/Accessors.js index d151c6935a92a0..a3a04f8df33021 100644 --- a/src/app/zap-templates/common/attributes/Accessors.js +++ b/src/app/zap-templates/common/attributes/Accessors.js @@ -21,11 +21,8 @@ const StringHelper = require('../../common/StringHelper.js'); const StructHelper = require('../../common/StructHelper.js'); const zclHelper = require(zapPath + 'generator/helper-zcl.js') -// Issue #8202 -// The specification allow non-standard signed and unsigned integer with a width of 24, 40, 48 or 56, but those types does not have -// proper support yet into the codebase and the resulting generated code can not be built with them. -// Once they are supported, the following method could be removed. -const unsupportedTypes = [ 'INT24S', 'INT40S', 'INT48S', 'INT56S', 'INT24U', 'INT40U', 'INT48U', 'INT56U', 'EUI64' ]; +// Not sure what to do with EUI64 yet. +const unsupportedTypes = [ 'EUI64' ]; function isUnsupportedType(type) { return unsupportedTypes.includes(type.toUpperCase()); @@ -75,8 +72,24 @@ async function accessorGetterType(attr) return type; } +async function accessorTraitType(type) +{ + let temp = type.toLowerCase(); + let matches = temp.match(/^int([0-9]+)(s?)/i); + if (matches) { + let signed = matches[2] != ""; + let size = parseInt(matches[1]) / 8; + + if (size != 1 && size != 2 && size != 4 && size != 8) { + return `OddSizedInteger<${size}, ${signed}>`; + } + } + return zclHelper.asUnderlyingZclType.call(this, type, { 'hash' : {} }); +} + // // Module exports // exports.canHaveSimpleAccessors = canHaveSimpleAccessors; exports.accessorGetterType = accessorGetterType; +exports.accessorTraitType = accessorTraitType; diff --git a/src/app/zap-templates/templates/app/attributes/Accessors-src.zapt b/src/app/zap-templates/templates/app/attributes/Accessors-src.zapt index b51829b143f0dc..c5c6e0e86778e0 100644 --- a/src/app/zap-templates/templates/app/attributes/Accessors-src.zapt +++ b/src/app/zap-templates/templates/app/attributes/Accessors-src.zapt @@ -12,6 +12,7 @@ #include #include #include +#include namespace chip { namespace app { @@ -58,24 +59,25 @@ EmberAfStatus Get(chip::EndpointId endpoint, {{accessorGetterType this}} value) {{>value}}.reduce_size(length); return status; {{else}} - NumericAttributeTraits<{{asUnderlyingZclType type}}>::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, {{>clusterId}}, Id, reinterpret_cast(&temp), sizeof(temp)); + NumericAttributeTraits<{{accessorTraitType type}}>::StorageType temp; + uint8_t * readable = NumericAttributeTraits<{{accessorTraitType type}}>::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, {{>clusterId}}, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); {{#if isNullable}} - if (NumericAttributeTraits<{{asUnderlyingZclType type}}>::IsNullValue(temp)) + if (NumericAttributeTraits<{{accessorTraitType type}}>::IsNullValue(temp)) { value.SetNull(); } else { - value.SetNonNull() = temp; + value.SetNonNull() = NumericAttributeTraits<{{accessorTraitType type}}>::StorageToWorking(temp); } {{else}} - if (!NumericAttributeTraits<{{asUnderlyingZclType type}}>::CanRepresentValue(/* isNullable = */ {{isNullable}}, temp)) + if (!NumericAttributeTraits<{{accessorTraitType type}}>::CanRepresentValue(/* isNullable = */ {{isNullable}}, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits<{{accessorTraitType type}}>::StorageToWorking(temp); {{/if}} return status; {{/if}} @@ -92,11 +94,14 @@ EmberAfStatus Set(chip::EndpointId endpoint, {{asUnderlyingZclType type}} value) memcpy(&zclString[{{>sizingBytes}}], value.data(), value.size()); return emberAfWriteServerAttribute(endpoint, {{>clusterId}}, Id, zclString, ZCL_{{asDelimitedMacro type}}_ATTRIBUTE_TYPE); {{else}} - if (!NumericAttributeTraits<{{asUnderlyingZclType type}}>::CanRepresentValue(/* isNullable = */ {{isNullable}}, value)) + if (!NumericAttributeTraits<{{accessorTraitType type}}>::CanRepresentValue(/* isNullable = */ {{isNullable}}, value)) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, {{>clusterId}}, Id, (uint8_t *) &value, ZCL_{{asDelimitedMacro type}}_ATTRIBUTE_TYPE); + NumericAttributeTraits<{{accessorTraitType type}}>::StorageType storageValue; + NumericAttributeTraits<{{accessorTraitType type}}>::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits<{{accessorTraitType type}}>::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, {{>clusterId}}, Id, writable, ZCL_{{asDelimitedMacro type}}_ATTRIBUTE_TYPE); {{/if}} } @@ -107,8 +112,10 @@ EmberAfStatus SetNull(chip::EndpointId endpoint) uint8_t zclString[{{>sizingBytes}}] = { {{#if (isShortString type)}}0xFF{{else}}0xFF, 0xFF{{/if}} }; return emberAfWriteServerAttribute(endpoint, {{>clusterId}}, Id, zclString, ZCL_{{asDelimitedMacro type}}_ATTRIBUTE_TYPE); {{else}} - auto value = NumericAttributeTraits<{{asUnderlyingZclType type}}>::kNullValue; - return emberAfWriteServerAttribute(endpoint, {{>clusterId}}, Id, reinterpret_cast(&value), ZCL_{{asDelimitedMacro type}}_ATTRIBUTE_TYPE); + NumericAttributeTraits<{{accessorTraitType type}}>::StorageType value; + NumericAttributeTraits<{{accessorTraitType type}}>::SetNull(value); + uint8_t * writable = NumericAttributeTraits<{{accessorTraitType type}}>::ToAttributeStoreRepresentation(value); + return emberAfWriteServerAttribute(endpoint, {{>clusterId}}, Id, writable, ZCL_{{asDelimitedMacro type}}_ATTRIBUTE_TYPE); {{/if}} } diff --git a/src/controller/data_model/controller-clusters.zap b/src/controller/data_model/controller-clusters.zap index 1708d74a8dc1af..d55742b6b18fda 100644 --- a/src/controller/data_model/controller-clusters.zap +++ b/src/controller/data_model/controller-clusters.zap @@ -7511,7 +7511,7 @@ "code": 21, "mfgCode": null, "side": "server", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, @@ -7526,7 +7526,7 @@ "code": 22, "mfgCode": null, "side": "server", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, diff --git a/src/controller/java/zap-generated/CHIPCallbackTypes.h b/src/controller/java/zap-generated/CHIPCallbackTypes.h index 9726fde6694af4..70cf3fd1757f86 100644 --- a/src/controller/java/zap-generated/CHIPCallbackTypes.h +++ b/src/controller/java/zap-generated/CHIPCallbackTypes.h @@ -728,6 +728,10 @@ typedef void (*CHIPPumpConfigurationAndControlClusterCapacityAttributeCallbackTy void *, chip::app::Clusters::PumpConfigurationAndControl::Attributes::Capacity::TypeInfo::DecodableArgType); typedef void (*CHIPPumpConfigurationAndControlClusterSpeedAttributeCallbackType)( void *, chip::app::Clusters::PumpConfigurationAndControl::Attributes::Speed::TypeInfo::DecodableArgType); +typedef void (*CHIPPumpConfigurationAndControlClusterLifetimeRunningHoursAttributeCallbackType)( + void *, chip::app::Clusters::PumpConfigurationAndControl::Attributes::LifetimeRunningHours::TypeInfo::DecodableArgType); +typedef void (*CHIPPumpConfigurationAndControlClusterPowerAttributeCallbackType)( + void *, chip::app::Clusters::PumpConfigurationAndControl::Attributes::Power::TypeInfo::DecodableArgType); typedef void (*CHIPPumpConfigurationAndControlClusterLifetimeEnergyConsumedAttributeCallbackType)( void *, chip::app::Clusters::PumpConfigurationAndControl::Attributes::LifetimeEnergyConsumed::TypeInfo::DecodableArgType); typedef void (*CHIPPumpConfigurationAndControlClusterOperationModeAttributeCallbackType)( diff --git a/src/controller/java/zap-generated/CHIPClusters-JNI.cpp b/src/controller/java/zap-generated/CHIPClusters-JNI.cpp index e39fe408957816..bb1e4ab5b61a45 100644 --- a/src/controller/java/zap-generated/CHIPClusters-JNI.cpp +++ b/src/controller/java/zap-generated/CHIPClusters-JNI.cpp @@ -20684,6 +20684,192 @@ JNI_METHOD(void, PumpConfigurationAndControlCluster, reportSpeedAttribute) onReport.release(); } + +JNI_METHOD(void, PumpConfigurationAndControlCluster, writeLifetimeRunningHoursAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::PumpConfigurationAndControl::Attributes::LifetimeRunningHours::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(value)); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} +JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeLifetimeRunningHoursAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) +{ + chip::DeviceLayer::StackLock lock; + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + err = cppCluster->SubscribeAttributeLifetimeRunningHours( + onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), static_cast(maxInterval)); + VerifyOrReturn(err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, PumpConfigurationAndControlCluster, reportLifetimeRunningHoursAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +{ + chip::DeviceLayer::StackLock lock; + std::unique_ptr onReport( + Platform::New(callback, true), Platform::Delete); + VerifyOrReturn(onReport.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + err = cppCluster->ReportAttributeLifetimeRunningHours(onReport->Cancel()); + VerifyOrReturn(err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error registering for attribute reporting", err)); + + onReport.release(); +} + +JNI_METHOD(void, PumpConfigurationAndControlCluster, writePowerAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::PumpConfigurationAndControl::Attributes::Power::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(value)); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} +JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribePowerAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) +{ + chip::DeviceLayer::StackLock lock; + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + err = cppCluster->SubscribeAttributePower(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), + static_cast(maxInterval)); + VerifyOrReturn(err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, PumpConfigurationAndControlCluster, reportPowerAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +{ + chip::DeviceLayer::StackLock lock; + std::unique_ptr onReport( + Platform::New(callback, true), Platform::Delete); + VerifyOrReturn(onReport.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + err = cppCluster->ReportAttributePower(onReport->Cancel()); + VerifyOrReturn(err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error registering for attribute reporting", err)); + + onReport.release(); +} JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeLifetimeEnergyConsumedAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { diff --git a/src/controller/java/zap-generated/CHIPClustersRead-JNI.cpp b/src/controller/java/zap-generated/CHIPClustersRead-JNI.cpp index 22229f0e59d875..974ee4fa91003e 100644 --- a/src/controller/java/zap-generated/CHIPClustersRead-JNI.cpp +++ b/src/controller/java/zap-generated/CHIPClustersRead-JNI.cpp @@ -9527,6 +9527,79 @@ JNI_METHOD(void, PumpConfigurationAndControlCluster, readSpeedAttribute) onFailure.release(); } +JNI_METHOD(void, PumpConfigurationAndControlCluster, readLifetimeRunningHoursAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::PumpConfigurationAndControl::Attributes::LifetimeRunningHours::TypeInfo; + std::unique_ptr onSuccess( + chip::Platform::New(callback, false), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + chip::Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + chip::Controller::PumpConfigurationAndControlCluster * cppCluster = + reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, PumpConfigurationAndControlCluster, readPowerAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::PumpConfigurationAndControl::Attributes::Power::TypeInfo; + std::unique_ptr onSuccess( + chip::Platform::New(callback, false), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + chip::Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + chip::Controller::PumpConfigurationAndControlCluster * cppCluster = + reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + JNI_METHOD(void, PumpConfigurationAndControlCluster, readLifetimeEnergyConsumedAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java b/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java index 7d2c0a8e49a8a9..50692adffdcebe 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java @@ -8932,6 +8932,40 @@ public void reportSpeedAttribute(IntegerAttributeCallback callback) { reportSpeedAttribute(chipClusterPtr, callback); } + public void readLifetimeRunningHoursAttribute(LongAttributeCallback callback) { + readLifetimeRunningHoursAttribute(chipClusterPtr, callback); + } + + public void writeLifetimeRunningHoursAttribute(DefaultClusterCallback callback, Long value) { + writeLifetimeRunningHoursAttribute(chipClusterPtr, callback, value); + } + + public void subscribeLifetimeRunningHoursAttribute( + DefaultClusterCallback callback, int minInterval, int maxInterval) { + subscribeLifetimeRunningHoursAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void reportLifetimeRunningHoursAttribute(LongAttributeCallback callback) { + reportLifetimeRunningHoursAttribute(chipClusterPtr, callback); + } + + public void readPowerAttribute(LongAttributeCallback callback) { + readPowerAttribute(chipClusterPtr, callback); + } + + public void writePowerAttribute(DefaultClusterCallback callback, Long value) { + writePowerAttribute(chipClusterPtr, callback, value); + } + + public void subscribePowerAttribute( + DefaultClusterCallback callback, int minInterval, int maxInterval) { + subscribePowerAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void reportPowerAttribute(LongAttributeCallback callback) { + reportPowerAttribute(chipClusterPtr, callback); + } + public void readLifetimeEnergyConsumedAttribute(LongAttributeCallback callback) { readLifetimeEnergyConsumedAttribute(chipClusterPtr, callback); } @@ -9179,6 +9213,28 @@ private native void subscribeSpeedAttribute( private native void reportSpeedAttribute( long chipClusterPtr, IntegerAttributeCallback callback); + private native void readLifetimeRunningHoursAttribute( + long chipClusterPtr, LongAttributeCallback callback); + + private native void writeLifetimeRunningHoursAttribute( + long chipClusterPtr, DefaultClusterCallback callback, Long value); + + private native void subscribeLifetimeRunningHoursAttribute( + long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); + + private native void reportLifetimeRunningHoursAttribute( + long chipClusterPtr, LongAttributeCallback callback); + + private native void readPowerAttribute(long chipClusterPtr, LongAttributeCallback callback); + + private native void writePowerAttribute( + long chipClusterPtr, DefaultClusterCallback callback, Long value); + + private native void subscribePowerAttribute( + long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); + + private native void reportPowerAttribute(long chipClusterPtr, LongAttributeCallback callback); + private native void readLifetimeEnergyConsumedAttribute( long chipClusterPtr, LongAttributeCallback callback); diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ClusterReadMapping.java b/src/controller/java/zap-generated/chip/devicecontroller/ClusterReadMapping.java index b03c060a474e2a..56a7e9ff53c032 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ClusterReadMapping.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ClusterReadMapping.java @@ -3559,6 +3559,32 @@ public Map> getReadAttributeMap() { readPumpConfigurationAndControlSpeedCommandParams); readPumpConfigurationAndControlInteractionInfo.put( "readSpeedAttribute", readPumpConfigurationAndControlSpeedAttributeInteractionInfo); + Map + readPumpConfigurationAndControlLifetimeRunningHoursCommandParams = + new LinkedHashMap(); + InteractionInfo readPumpConfigurationAndControlLifetimeRunningHoursAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.PumpConfigurationAndControlCluster) cluster) + .readLifetimeRunningHoursAttribute((ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readPumpConfigurationAndControlLifetimeRunningHoursCommandParams); + readPumpConfigurationAndControlInteractionInfo.put( + "readLifetimeRunningHoursAttribute", + readPumpConfigurationAndControlLifetimeRunningHoursAttributeInteractionInfo); + Map readPumpConfigurationAndControlPowerCommandParams = + new LinkedHashMap(); + InteractionInfo readPumpConfigurationAndControlPowerAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.PumpConfigurationAndControlCluster) cluster) + .readPowerAttribute((ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readPumpConfigurationAndControlPowerCommandParams); + readPumpConfigurationAndControlInteractionInfo.put( + "readPowerAttribute", readPumpConfigurationAndControlPowerAttributeInteractionInfo); Map readPumpConfigurationAndControlLifetimeEnergyConsumedCommandParams = new LinkedHashMap(); diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ClusterWriteMapping.java b/src/controller/java/zap-generated/chip/devicecontroller/ClusterWriteMapping.java index 8b448710e9893b..b0964042852eb8 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ClusterWriteMapping.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ClusterWriteMapping.java @@ -689,6 +689,42 @@ public Map> getWriteAttributeMap() { writeAttributeMap.put("pressureMeasurement", writePressureMeasurementInteractionInfo); Map writePumpConfigurationAndControlInteractionInfo = new LinkedHashMap<>(); + Map + writePumpConfigurationAndControlLifetimeRunningHoursCommandParams = + new LinkedHashMap(); + CommandParameterInfo pumpConfigurationAndControllifetimeRunningHoursCommandParameterInfo = + new CommandParameterInfo("value", long.class); + writePumpConfigurationAndControlLifetimeRunningHoursCommandParams.put( + "value", pumpConfigurationAndControllifetimeRunningHoursCommandParameterInfo); + InteractionInfo writePumpConfigurationAndControlLifetimeRunningHoursAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.PumpConfigurationAndControlCluster) cluster) + .writeLifetimeRunningHoursAttribute( + (DefaultClusterCallback) callback, (Long) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writePumpConfigurationAndControlLifetimeRunningHoursCommandParams); + writePumpConfigurationAndControlInteractionInfo.put( + "writeLifetimeRunningHoursAttribute", + writePumpConfigurationAndControlLifetimeRunningHoursAttributeInteractionInfo); + Map writePumpConfigurationAndControlPowerCommandParams = + new LinkedHashMap(); + CommandParameterInfo pumpConfigurationAndControlpowerCommandParameterInfo = + new CommandParameterInfo("value", long.class); + writePumpConfigurationAndControlPowerCommandParams.put( + "value", pumpConfigurationAndControlpowerCommandParameterInfo); + InteractionInfo writePumpConfigurationAndControlPowerAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.PumpConfigurationAndControlCluster) cluster) + .writePowerAttribute( + (DefaultClusterCallback) callback, (Long) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writePumpConfigurationAndControlPowerCommandParams); + writePumpConfigurationAndControlInteractionInfo.put( + "writePowerAttribute", writePumpConfigurationAndControlPowerAttributeInteractionInfo); Map writePumpConfigurationAndControlOperationModeCommandParams = new LinkedHashMap(); CommandParameterInfo pumpConfigurationAndControloperationModeCommandParameterInfo = diff --git a/src/controller/python/chip/clusters/CHIPClusters.cpp b/src/controller/python/chip/clusters/CHIPClusters.cpp index 40bd9f67c23a25..467148f12f4fbc 100644 --- a/src/controller/python/chip/clusters/CHIPClusters.cpp +++ b/src/controller/python/chip/clusters/CHIPClusters.cpp @@ -8022,6 +8022,52 @@ chip::ChipError::StorageType chip_ime_SubscribeAttribute_PumpConfigurationAndCon .AsInteger(); } +chip::ChipError::StorageType chip_ime_ReadAttribute_PumpConfigurationAndControl_LifetimeRunningHours(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::PumpConfigurationAndControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeLifetimeRunningHours(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_PumpConfigurationAndControl_LifetimeRunningHours( + chip::DeviceProxy * device, chip::EndpointId ZCLendpointId, uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::PumpConfigurationAndControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeLifetimeRunningHours(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_PumpConfigurationAndControl_Power(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::PumpConfigurationAndControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributePower(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_PumpConfigurationAndControl_Power(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::PumpConfigurationAndControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributePower(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, maxInterval) + .AsInteger(); +} + chip::ChipError::StorageType chip_ime_ReadAttribute_PumpConfigurationAndControl_LifetimeEnergyConsumed( chip::DeviceProxy * device, chip::EndpointId ZCLendpointId, chip::GroupId /* ZCLgroupId */) { diff --git a/src/controller/python/chip/clusters/CHIPClusters.py b/src/controller/python/chip/clusters/CHIPClusters.py index 1890696674850c..ed0c5868e41ad7 100644 --- a/src/controller/python/chip/clusters/CHIPClusters.py +++ b/src/controller/python/chip/clusters/CHIPClusters.py @@ -3145,6 +3145,20 @@ class ChipClusters: "type": "int", "reportable": True, }, + 0x00000015: { + "attributeName": "LifetimeRunningHours", + "attributeId": 0x00000015, + "type": "int", + "reportable": True, + "writable": True, + }, + 0x00000016: { + "attributeName": "Power", + "attributeId": 0x00000016, + "type": "int", + "reportable": True, + "writable": True, + }, 0x00000017: { "attributeName": "LifetimeEnergyConsumed", "attributeId": 0x00000017, @@ -6564,6 +6578,18 @@ def ClusterPumpConfigurationAndControl_ReadAttributeSpeed(self, device: ctypes.c def ClusterPumpConfigurationAndControl_SubscribeAttributeSpeed(self, device: ctypes.c_void_p, ZCLendpoint: int, minInterval: int, maxInterval: int): return self._chipLib.chip_ime_SubscribeAttribute_PumpConfigurationAndControl_Speed(device, ZCLendpoint, minInterval, maxInterval) + def ClusterPumpConfigurationAndControl_ReadAttributeLifetimeRunningHours(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int): + return self._chipLib.chip_ime_ReadAttribute_PumpConfigurationAndControl_LifetimeRunningHours(device, ZCLendpoint, ZCLgroupid) + + def ClusterPumpConfigurationAndControl_SubscribeAttributeLifetimeRunningHours(self, device: ctypes.c_void_p, ZCLendpoint: int, minInterval: int, maxInterval: int): + return self._chipLib.chip_ime_SubscribeAttribute_PumpConfigurationAndControl_LifetimeRunningHours(device, ZCLendpoint, minInterval, maxInterval) + + def ClusterPumpConfigurationAndControl_ReadAttributePower(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int): + return self._chipLib.chip_ime_ReadAttribute_PumpConfigurationAndControl_Power(device, ZCLendpoint, ZCLgroupid) + + def ClusterPumpConfigurationAndControl_SubscribeAttributePower(self, device: ctypes.c_void_p, ZCLendpoint: int, minInterval: int, maxInterval: int): + return self._chipLib.chip_ime_SubscribeAttribute_PumpConfigurationAndControl_Power(device, ZCLendpoint, minInterval, maxInterval) + def ClusterPumpConfigurationAndControl_ReadAttributeLifetimeEnergyConsumed(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int): return self._chipLib.chip_ime_ReadAttribute_PumpConfigurationAndControl_LifetimeEnergyConsumed(device, ZCLendpoint, ZCLgroupid) @@ -9876,6 +9902,22 @@ def InitLib(self, chipLib): self._chipLib.chip_ime_SubscribeAttribute_PumpConfigurationAndControl_Speed.argtypes = [ ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16, ctypes.c_uint16] self._chipLib.chip_ime_SubscribeAttribute_PumpConfigurationAndControl_Speed.restype = ctypes.c_uint32 + # Cluster PumpConfigurationAndControl ReadAttribute LifetimeRunningHours + self._chipLib.chip_ime_ReadAttribute_PumpConfigurationAndControl_LifetimeRunningHours.argtypes = [ + ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16] + self._chipLib.chip_ime_ReadAttribute_PumpConfigurationAndControl_LifetimeRunningHours.restype = ctypes.c_uint32 + # Cluster PumpConfigurationAndControl SubscribeAttribute LifetimeRunningHours + self._chipLib.chip_ime_SubscribeAttribute_PumpConfigurationAndControl_LifetimeRunningHours.argtypes = [ + ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16, ctypes.c_uint16] + self._chipLib.chip_ime_SubscribeAttribute_PumpConfigurationAndControl_LifetimeRunningHours.restype = ctypes.c_uint32 + # Cluster PumpConfigurationAndControl ReadAttribute Power + self._chipLib.chip_ime_ReadAttribute_PumpConfigurationAndControl_Power.argtypes = [ + ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16] + self._chipLib.chip_ime_ReadAttribute_PumpConfigurationAndControl_Power.restype = ctypes.c_uint32 + # Cluster PumpConfigurationAndControl SubscribeAttribute Power + self._chipLib.chip_ime_SubscribeAttribute_PumpConfigurationAndControl_Power.argtypes = [ + ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16, ctypes.c_uint16] + self._chipLib.chip_ime_SubscribeAttribute_PumpConfigurationAndControl_Power.restype = ctypes.c_uint32 # Cluster PumpConfigurationAndControl ReadAttribute LifetimeEnergyConsumed self._chipLib.chip_ime_ReadAttribute_PumpConfigurationAndControl_LifetimeEnergyConsumed.argtypes = [ ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16] diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.h b/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.h index 67306f6823cff0..3aaa336311dcf2 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.h @@ -2735,6 +2735,23 @@ NS_ASSUME_NONNULL_BEGIN responseHandler:(ResponseHandler)responseHandler; - (void)reportAttributeSpeedWithResponseHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))responseHandler; +- (void)readAttributeLifetimeRunningHoursWithCompletionHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))completionHandler; +- (void)writeAttributeLifetimeRunningHoursWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler; +- (void)subscribeAttributeLifetimeRunningHoursWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + responseHandler:(ResponseHandler)responseHandler; +- (void)reportAttributeLifetimeRunningHoursWithResponseHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))responseHandler; + +- (void)readAttributePowerWithCompletionHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler; +- (void)writeAttributePowerWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)subscribeAttributePowerWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + responseHandler:(ResponseHandler)responseHandler; +- (void)reportAttributePowerWithResponseHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))responseHandler; + - (void)readAttributeLifetimeEnergyConsumedWithCompletionHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler; - (void)subscribeAttributeLifetimeEnergyConsumedWithMinInterval:(uint16_t)minInterval diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.mm b/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.mm index 7e300d9247d66d..2bcd132210ea5c 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.mm @@ -13786,6 +13786,118 @@ new CHIPInt16uAttributeCallbackBridge( true); } +- (void)readAttributeLifetimeRunningHoursWithCompletionHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))completionHandler +{ + new CHIPInt32uAttributeCallbackBridge( + self.callbackQueue, + ^(NSError * _Nullable error, id _Nullable value) { + completionHandler(value, error); + }, + ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = PumpConfigurationAndControl::Attributes::LifetimeRunningHours::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeLifetimeRunningHoursWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(NSError * _Nullable error, id _Nullable ignored) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = PumpConfigurationAndControl::Attributes::LifetimeRunningHours::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedIntValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)subscribeAttributeLifetimeRunningHoursWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + responseHandler:(ResponseHandler)responseHandler +{ + new CHIPInt32uAttributeCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { + return self.cppCluster.SubscribeAttributeLifetimeRunningHours(success, failure, minInterval, maxInterval); + }); +} + +- (void)reportAttributeLifetimeRunningHoursWithResponseHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))responseHandler +{ + new CHIPInt32uAttributeCallbackBridge( + self.callbackQueue, + ^(NSError * _Nullable error, id _Nullable value) { + responseHandler(value, error); + }, + ^(Cancelable * success, Cancelable * failure) { + return self.cppCluster.ReportAttributeLifetimeRunningHours(success); + }, + true); +} + +- (void)readAttributePowerWithCompletionHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler +{ + new CHIPInt32uAttributeCallbackBridge( + self.callbackQueue, + ^(NSError * _Nullable error, id _Nullable value) { + completionHandler(value, error); + }, + ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = PumpConfigurationAndControl::Attributes::Power::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributePowerWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(NSError * _Nullable error, id _Nullable ignored) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = PumpConfigurationAndControl::Attributes::Power::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedIntValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)subscribeAttributePowerWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + responseHandler:(ResponseHandler)responseHandler +{ + new CHIPInt32uAttributeCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { + return self.cppCluster.SubscribeAttributePower(success, failure, minInterval, maxInterval); + }); +} + +- (void)reportAttributePowerWithResponseHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))responseHandler +{ + new CHIPInt32uAttributeCallbackBridge( + self.callbackQueue, + ^(NSError * _Nullable error, id _Nullable value) { + responseHandler(value, error); + }, + ^(Cancelable * success, Cancelable * failure) { + return self.cppCluster.ReportAttributePower(success); + }, + true); +} + - (void)readAttributeLifetimeEnergyConsumedWithCompletionHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler { diff --git a/src/darwin/Framework/CHIPTests/CHIPClustersTests.m b/src/darwin/Framework/CHIPTests/CHIPClustersTests.m index 249f155bd88a0b..e5be1bb15d0433 100644 --- a/src/darwin/Framework/CHIPTests/CHIPClustersTests.m +++ b/src/darwin/Framework/CHIPTests/CHIPClustersTests.m @@ -31192,6 +31192,91 @@ - (void)testSendClusterPumpConfigurationAndControlReadAttributeSpeedWithCompleti [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } +- (void)testSendClusterPumpConfigurationAndControlReadAttributeLifetimeRunningHoursWithCompletionHandler +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"PumpConfigurationAndControlReadAttributeLifetimeRunningHoursWithCompletionHandler"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:1 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeLifetimeRunningHoursWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"PumpConfigurationAndControl LifetimeRunningHours Error: %@", err); + XCTAssertEqual(err.code, 0); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} + +- (void)testSendClusterPumpConfigurationAndControlWriteAttributeLifetimeRunningHoursWithValue +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"PumpConfigurationAndControlWriteAttributeLifetimeRunningHoursWithValue"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:1 + queue:queue]; + XCTAssertNotNil(cluster); + + NSNumber * _Nonnull value = @(0x000000); + [cluster writeAttributeLifetimeRunningHoursWithValue:value + completionHandler:^(NSError * _Nullable err) { + NSLog(@"PumpConfigurationAndControl LifetimeRunningHours Error: %@", err); + XCTAssertEqual(err.code, 0); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterPumpConfigurationAndControlReadAttributePowerWithCompletionHandler +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"PumpConfigurationAndControlReadAttributePowerWithCompletionHandler"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:1 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributePowerWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"PumpConfigurationAndControl Power Error: %@", err); + XCTAssertEqual(err.code, 0); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} + +- (void)testSendClusterPumpConfigurationAndControlWriteAttributePowerWithValue +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"PumpConfigurationAndControlWriteAttributePowerWithValue"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:1 + queue:queue]; + XCTAssertNotNil(cluster); + + NSNumber * _Nonnull value = @(0x000000); + [cluster writeAttributePowerWithValue:value + completionHandler:^(NSError * _Nullable err) { + NSLog(@"PumpConfigurationAndControl Power Error: %@", err); + XCTAssertEqual(err.code, 0); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} - (void)testSendClusterPumpConfigurationAndControlReadAttributeLifetimeEnergyConsumedWithCompletionHandler { XCTestExpectation * expectation = diff --git a/zzz_generated/all-clusters-app/zap-generated/endpoint_config.h b/zzz_generated/all-clusters-app/zap-generated/endpoint_config.h index 3f68bbca1135dc..fe65a411df9ca4 100644 --- a/zzz_generated/all-clusters-app/zap-generated/endpoint_config.h +++ b/zzz_generated/all-clusters-app/zap-generated/endpoint_config.h @@ -351,25 +351,31 @@ \ /* Endpoint: 1, Cluster: Pump Configuration and Control (server), big-endian */ \ \ - /* 1409 - LifetimeEnergyConsumed, */ \ + /* 1409 - LifetimeRunningHours, */ \ + 0x00, 0x00, 0x00, \ + \ + /* 1412 - Power, */ \ + 0x00, 0x00, 0x00, \ + \ + /* 1415 - LifetimeEnergyConsumed, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1413 - FeatureMap, */ \ + /* 1419 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Thermostat (server), big-endian */ \ \ - /* 1417 - FeatureMap, */ \ + /* 1423 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x0B, \ \ /* Endpoint: 1, Cluster: IAS Zone (server), big-endian */ \ \ - /* 1421 - IAS CIE address, */ \ + /* 1427 - IAS CIE address, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: TV Channel (server), big-endian */ \ \ - /* 1429 - tv channel list, */ \ + /* 1435 - tv channel list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -387,7 +393,7 @@ \ /* Endpoint: 1, Cluster: Target Navigator (server), big-endian */ \ \ - /* 1683 - target navigator list, */ \ + /* 1689 - target navigator list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -405,30 +411,30 @@ \ /* Endpoint: 1, Cluster: Media Playback (server), big-endian */ \ \ - /* 1937 - start time, */ \ + /* 1943 - start time, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, \ \ - /* 1945 - duration, */ \ + /* 1951 - duration, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1953 - position updated at, */ \ + /* 1959 - position updated at, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1961 - position, */ \ + /* 1967 - position, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1969 - playback speed, */ \ + /* 1975 - playback speed, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1977 - seek range end, */ \ + /* 1983 - seek range end, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1985 - seek range start, */ \ + /* 1991 - seek range start, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Media Input (server), big-endian */ \ \ - /* 1993 - media input list, */ \ + /* 1999 - media input list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -446,7 +452,7 @@ \ /* Endpoint: 1, Cluster: Content Launcher (server), big-endian */ \ \ - /* 2247 - accepts header list, */ \ + /* 2253 - accepts header list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -462,7 +468,7 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2501 - supported streaming types, */ \ + /* 2507 - supported streaming types, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -480,7 +486,7 @@ \ /* Endpoint: 1, Cluster: Audio Output (server), big-endian */ \ \ - /* 2755 - audio output list, */ \ + /* 2761 - audio output list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -498,7 +504,7 @@ \ /* Endpoint: 1, Cluster: Application Launcher (server), big-endian */ \ \ - /* 3009 - application launcher list, */ \ + /* 3015 - application launcher list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -516,28 +522,28 @@ \ /* Endpoint: 1, Cluster: Test Cluster (server), big-endian */ \ \ - /* 3263 - bitmap32, */ \ + /* 3269 - bitmap32, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 3267 - bitmap64, */ \ + /* 3273 - bitmap64, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3275 - int32u, */ \ + /* 3281 - int32u, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 3279 - int64u, */ \ + /* 3285 - int64u, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3287 - int32s, */ \ + /* 3293 - int32s, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 3291 - int64s, */ \ + /* 3297 - int64s, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3299 - list_int8u, */ \ + /* 3305 - list_int8u, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3309 - list_octet_string, */ \ + /* 3315 - list_octet_string, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -553,7 +559,7 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3563 - list_struct_octet_string, */ \ + /* 3569 - list_struct_octet_string, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -569,41 +575,41 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3817 - epoch_us, */ \ + /* 3823 - epoch_us, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3825 - epoch_s, */ \ + /* 3831 - epoch_s, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 3829 - nullable_bitmap32, */ \ + /* 3835 - nullable_bitmap32, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 3833 - nullable_bitmap64, */ \ + /* 3839 - nullable_bitmap64, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3841 - nullable_int32u, */ \ + /* 3847 - nullable_int32u, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 3845 - nullable_int64u, */ \ + /* 3851 - nullable_int64u, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3853 - nullable_int32s, */ \ + /* 3859 - nullable_int32s, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 3857 - nullable_int64s, */ \ + /* 3863 - nullable_int64s, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Electrical Measurement (server), big-endian */ \ \ - /* 3865 - measurement type, */ \ + /* 3871 - measurement type, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 3869 - total active power, */ \ + /* 3875 - total active power, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 2, Cluster: On/Off (server), big-endian */ \ \ - /* 3873 - FeatureMap, */ \ + /* 3879 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x00, \ } @@ -935,25 +941,31 @@ \ /* Endpoint: 1, Cluster: Pump Configuration and Control (server), little-endian */ \ \ - /* 1409 - LifetimeEnergyConsumed, */ \ + /* 1409 - LifetimeRunningHours, */ \ + 0x00, 0x00, 0x00, \ + \ + /* 1412 - Power, */ \ + 0x00, 0x00, 0x00, \ + \ + /* 1415 - LifetimeEnergyConsumed, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1413 - FeatureMap, */ \ + /* 1419 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Thermostat (server), little-endian */ \ \ - /* 1417 - FeatureMap, */ \ + /* 1423 - FeatureMap, */ \ 0x0B, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: IAS Zone (server), little-endian */ \ \ - /* 1421 - IAS CIE address, */ \ + /* 1427 - IAS CIE address, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: TV Channel (server), little-endian */ \ \ - /* 1429 - tv channel list, */ \ + /* 1435 - tv channel list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -971,7 +983,7 @@ \ /* Endpoint: 1, Cluster: Target Navigator (server), little-endian */ \ \ - /* 1683 - target navigator list, */ \ + /* 1689 - target navigator list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -989,30 +1001,30 @@ \ /* Endpoint: 1, Cluster: Media Playback (server), little-endian */ \ \ - /* 1937 - start time, */ \ + /* 1943 - start time, */ \ 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1945 - duration, */ \ + /* 1951 - duration, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1953 - position updated at, */ \ + /* 1959 - position updated at, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1961 - position, */ \ + /* 1967 - position, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1969 - playback speed, */ \ + /* 1975 - playback speed, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1977 - seek range end, */ \ + /* 1983 - seek range end, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1985 - seek range start, */ \ + /* 1991 - seek range start, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Media Input (server), little-endian */ \ \ - /* 1993 - media input list, */ \ + /* 1999 - media input list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -1030,7 +1042,7 @@ \ /* Endpoint: 1, Cluster: Content Launcher (server), little-endian */ \ \ - /* 2247 - accepts header list, */ \ + /* 2253 - accepts header list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -1046,7 +1058,7 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2501 - supported streaming types, */ \ + /* 2507 - supported streaming types, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -1064,7 +1076,7 @@ \ /* Endpoint: 1, Cluster: Audio Output (server), little-endian */ \ \ - /* 2755 - audio output list, */ \ + /* 2761 - audio output list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -1082,7 +1094,7 @@ \ /* Endpoint: 1, Cluster: Application Launcher (server), little-endian */ \ \ - /* 3009 - application launcher list, */ \ + /* 3015 - application launcher list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -1100,28 +1112,28 @@ \ /* Endpoint: 1, Cluster: Test Cluster (server), little-endian */ \ \ - /* 3263 - bitmap32, */ \ + /* 3269 - bitmap32, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 3267 - bitmap64, */ \ + /* 3273 - bitmap64, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3275 - int32u, */ \ + /* 3281 - int32u, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 3279 - int64u, */ \ + /* 3285 - int64u, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3287 - int32s, */ \ + /* 3293 - int32s, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 3291 - int64s, */ \ + /* 3297 - int64s, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3299 - list_int8u, */ \ + /* 3305 - list_int8u, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3309 - list_octet_string, */ \ + /* 3315 - list_octet_string, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -1137,7 +1149,7 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3563 - list_struct_octet_string, */ \ + /* 3569 - list_struct_octet_string, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -1153,47 +1165,47 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3817 - epoch_us, */ \ + /* 3823 - epoch_us, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3825 - epoch_s, */ \ + /* 3831 - epoch_s, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 3829 - nullable_bitmap32, */ \ + /* 3835 - nullable_bitmap32, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 3833 - nullable_bitmap64, */ \ + /* 3839 - nullable_bitmap64, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3841 - nullable_int32u, */ \ + /* 3847 - nullable_int32u, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 3845 - nullable_int64u, */ \ + /* 3851 - nullable_int64u, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3853 - nullable_int32s, */ \ + /* 3859 - nullable_int32s, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 3857 - nullable_int64s, */ \ + /* 3863 - nullable_int64s, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Electrical Measurement (server), little-endian */ \ \ - /* 3865 - measurement type, */ \ + /* 3871 - measurement type, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 3869 - total active power, */ \ + /* 3875 - total active power, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 2, Cluster: On/Off (server), little-endian */ \ \ - /* 3873 - FeatureMap, */ \ + /* 3879 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x00, \ } #endif // BIGENDIAN_CPU -#define GENERATED_DEFAULTS_COUNT (118) +#define GENERATED_DEFAULTS_COUNT (120) #define ZAP_TYPE(type) ZCL_##type##_ATTRIBUTE_TYPE #define ZAP_LONG_DEFAULTS_INDEX(index) \ @@ -1221,7 +1233,7 @@ #define ZAP_ATTRIBUTE_MASK(mask) ATTRIBUTE_MASK_##mask // This is an array of EmberAfAttributeMetadata structures. -#define GENERATED_ATTRIBUTE_COUNT 511 +#define GENERATED_ATTRIBUTE_COUNT 513 #define GENERATED_ATTRIBUTES \ { \ \ @@ -1569,29 +1581,32 @@ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Pump Configuration and Control (server) */ \ - { 0x0000, ZAP_TYPE(INT16S), 2, 0, ZAP_EMPTY_DEFAULT() }, /* MaxPressure */ \ - { 0x0001, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* MaxSpeed */ \ - { 0x0002, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* MaxFlow */ \ - { 0x0003, ZAP_TYPE(INT16S), 2, 0, ZAP_EMPTY_DEFAULT() }, /* MinConstPressure */ \ - { 0x0004, ZAP_TYPE(INT16S), 2, 0, ZAP_EMPTY_DEFAULT() }, /* MaxConstPressure */ \ - { 0x0005, ZAP_TYPE(INT16S), 2, 0, ZAP_EMPTY_DEFAULT() }, /* MinCompPressure */ \ - { 0x0006, ZAP_TYPE(INT16S), 2, 0, ZAP_EMPTY_DEFAULT() }, /* MaxCompPressure */ \ - { 0x0007, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* MinConstSpeed */ \ - { 0x0008, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* MaxConstSpeed */ \ - { 0x0009, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* MinConstFlow */ \ - { 0x000A, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* MaxConstFlow */ \ - { 0x000B, ZAP_TYPE(INT16S), 2, 0, ZAP_EMPTY_DEFAULT() }, /* MinConstTemp */ \ - { 0x000C, ZAP_TYPE(INT16S), 2, 0, ZAP_EMPTY_DEFAULT() }, /* MaxConstTemp */ \ - { 0x0010, ZAP_TYPE(BITMAP16), 2, 0, ZAP_EMPTY_DEFAULT() }, /* PumpStatus */ \ - { 0x0011, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* EffectiveOperationMode */ \ - { 0x0012, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* EffectiveControlMode */ \ - { 0x0013, ZAP_TYPE(INT16S), 2, 0, ZAP_EMPTY_DEFAULT() }, /* Capacity */ \ - { 0x0014, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* Speed */ \ - { 0x0017, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1409) }, /* LifetimeEnergyConsumed */ \ + { 0x0000, ZAP_TYPE(INT16S), 2, 0, ZAP_EMPTY_DEFAULT() }, /* MaxPressure */ \ + { 0x0001, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* MaxSpeed */ \ + { 0x0002, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* MaxFlow */ \ + { 0x0003, ZAP_TYPE(INT16S), 2, 0, ZAP_EMPTY_DEFAULT() }, /* MinConstPressure */ \ + { 0x0004, ZAP_TYPE(INT16S), 2, 0, ZAP_EMPTY_DEFAULT() }, /* MaxConstPressure */ \ + { 0x0005, ZAP_TYPE(INT16S), 2, 0, ZAP_EMPTY_DEFAULT() }, /* MinCompPressure */ \ + { 0x0006, ZAP_TYPE(INT16S), 2, 0, ZAP_EMPTY_DEFAULT() }, /* MaxCompPressure */ \ + { 0x0007, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* MinConstSpeed */ \ + { 0x0008, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* MaxConstSpeed */ \ + { 0x0009, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* MinConstFlow */ \ + { 0x000A, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* MaxConstFlow */ \ + { 0x000B, ZAP_TYPE(INT16S), 2, 0, ZAP_EMPTY_DEFAULT() }, /* MinConstTemp */ \ + { 0x000C, ZAP_TYPE(INT16S), 2, 0, ZAP_EMPTY_DEFAULT() }, /* MaxConstTemp */ \ + { 0x0010, ZAP_TYPE(BITMAP16), 2, 0, ZAP_EMPTY_DEFAULT() }, /* PumpStatus */ \ + { 0x0011, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* EffectiveOperationMode */ \ + { 0x0012, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* EffectiveControlMode */ \ + { 0x0013, ZAP_TYPE(INT16S), 2, 0, ZAP_EMPTY_DEFAULT() }, /* Capacity */ \ + { 0x0014, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* Speed */ \ + { 0x0015, ZAP_TYPE(INT24U), 3, ZAP_ATTRIBUTE_MASK(WRITABLE), \ + ZAP_LONG_DEFAULTS_INDEX(1409) }, /* LifetimeRunningHours */ \ + { 0x0016, ZAP_TYPE(INT24U), 3, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(1412) }, /* Power */ \ + { 0x0017, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1415) }, /* LifetimeEnergyConsumed */ \ { 0x0020, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0x00) }, /* OperationMode */ \ { 0x0021, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0x00) }, /* ControlMode */ \ { 0x0022, ZAP_TYPE(BITMAP16), 2, 0, ZAP_EMPTY_DEFAULT() }, /* AlarmMask */ \ - { 0xFFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1413) }, /* FeatureMap */ \ + { 0xFFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1419) }, /* FeatureMap */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Thermostat (server) */ \ @@ -1619,7 +1634,7 @@ { 0x0020, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0) }, /* start of week */ \ { 0x0021, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(7) }, /* number of weekly transitions */ \ { 0x0022, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(4) }, /* number of daily transitions */ \ - { 0xFFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1417) }, /* FeatureMap */ \ + { 0xFFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1423) }, /* FeatureMap */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(3) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Thermostat User Interface Configuration (server) */ \ @@ -1730,7 +1745,7 @@ { 0x0000, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* zone state */ \ { 0x0001, ZAP_TYPE(ENUM16), 2, 0, ZAP_EMPTY_DEFAULT() }, /* zone type */ \ { 0x0002, ZAP_TYPE(BITMAP16), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* zone status */ \ - { 0x0010, ZAP_TYPE(NODE_ID), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(1421) }, /* IAS CIE address */ \ + { 0x0010, ZAP_TYPE(NODE_ID), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(1427) }, /* IAS CIE address */ \ { 0x0011, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0xff) }, /* Zone ID */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(2) }, /* ClusterRevision */ \ \ @@ -1739,28 +1754,28 @@ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: TV Channel (server) */ \ - { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(1429) }, /* tv channel list */ \ + { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(1435) }, /* tv channel list */ \ { 0x0001, ZAP_TYPE(OCTET_STRING), 33, 0, ZAP_EMPTY_DEFAULT() }, /* tv channel lineup */ \ { 0x0002, ZAP_TYPE(OCTET_STRING), 33, 0, ZAP_EMPTY_DEFAULT() }, /* current tv channel */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Target Navigator (server) */ \ - { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(1683) }, /* target navigator list */ \ + { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(1689) }, /* target navigator list */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Media Playback (server) */ \ { 0x0000, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* playback state */ \ - { 0x0001, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1937) }, /* start time */ \ - { 0x0002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1945) }, /* duration */ \ - { 0x0003, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1953) }, /* position updated at */ \ - { 0x0004, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1961) }, /* position */ \ - { 0x0005, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1969) }, /* playback speed */ \ - { 0x0006, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1977) }, /* seek range end */ \ - { 0x0007, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1985) }, /* seek range start */ \ + { 0x0001, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1943) }, /* start time */ \ + { 0x0002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1951) }, /* duration */ \ + { 0x0003, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1959) }, /* position updated at */ \ + { 0x0004, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1967) }, /* position */ \ + { 0x0005, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1975) }, /* playback speed */ \ + { 0x0006, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1983) }, /* seek range end */ \ + { 0x0007, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1991) }, /* seek range start */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Media Input (server) */ \ - { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(1993) }, /* media input list */ \ + { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(1999) }, /* media input list */ \ { 0x0001, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* current media input */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ @@ -1771,17 +1786,17 @@ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Content Launcher (server) */ \ - { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(2247) }, /* accepts header list */ \ - { 0x0001, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(2501) }, /* supported streaming types */ \ + { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(2253) }, /* accepts header list */ \ + { 0x0001, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(2507) }, /* supported streaming types */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Audio Output (server) */ \ - { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(2755) }, /* audio output list */ \ + { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(2761) }, /* audio output list */ \ { 0x0001, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* current audio output */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Application Launcher (server) */ \ - { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(3009) }, /* application launcher list */ \ + { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(3015) }, /* application launcher list */ \ { 0x0001, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* catalog vendor id */ \ { 0x0002, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* application id */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ @@ -1803,30 +1818,30 @@ { 0x0000, ZAP_TYPE(BOOLEAN), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(false) }, /* boolean */ \ { 0x0001, ZAP_TYPE(BITMAP8), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* bitmap8 */ \ { 0x0002, ZAP_TYPE(BITMAP16), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* bitmap16 */ \ - { 0x0003, ZAP_TYPE(BITMAP32), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(3263) }, /* bitmap32 */ \ - { 0x0004, ZAP_TYPE(BITMAP64), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(3267) }, /* bitmap64 */ \ + { 0x0003, ZAP_TYPE(BITMAP32), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(3269) }, /* bitmap32 */ \ + { 0x0004, ZAP_TYPE(BITMAP64), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(3273) }, /* bitmap64 */ \ { 0x0005, ZAP_TYPE(INT8U), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* int8u */ \ { 0x0006, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* int16u */ \ - { 0x0008, ZAP_TYPE(INT32U), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(3275) }, /* int32u */ \ - { 0x000C, ZAP_TYPE(INT64U), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(3279) }, /* int64u */ \ + { 0x0008, ZAP_TYPE(INT32U), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(3281) }, /* int32u */ \ + { 0x000C, ZAP_TYPE(INT64U), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(3285) }, /* int64u */ \ { 0x000D, ZAP_TYPE(INT8S), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* int8s */ \ { 0x000E, ZAP_TYPE(INT16S), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* int16s */ \ - { 0x0010, ZAP_TYPE(INT32S), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(3287) }, /* int32s */ \ - { 0x0014, ZAP_TYPE(INT64S), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(3291) }, /* int64s */ \ + { 0x0010, ZAP_TYPE(INT32S), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(3293) }, /* int32s */ \ + { 0x0014, ZAP_TYPE(INT64S), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(3297) }, /* int64s */ \ { 0x0015, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* enum8 */ \ { 0x0016, ZAP_TYPE(ENUM16), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* enum16 */ \ { 0x0019, ZAP_TYPE(OCTET_STRING), 11, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_EMPTY_DEFAULT() }, /* octet_string */ \ - { 0x001A, ZAP_TYPE(ARRAY), 10, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(3299) }, /* list_int8u */ \ - { 0x001B, ZAP_TYPE(ARRAY), 254, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(3309) }, /* list_octet_string */ \ + { 0x001A, ZAP_TYPE(ARRAY), 10, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(3305) }, /* list_int8u */ \ + { 0x001B, ZAP_TYPE(ARRAY), 254, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(3315) }, /* list_octet_string */ \ { 0x001C, ZAP_TYPE(ARRAY), 254, ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_LONG_DEFAULTS_INDEX(3563) }, /* list_struct_octet_string */ \ + ZAP_LONG_DEFAULTS_INDEX(3569) }, /* list_struct_octet_string */ \ { 0x001D, ZAP_TYPE(LONG_OCTET_STRING), 1002, ZAP_ATTRIBUTE_MASK(WRITABLE), \ ZAP_EMPTY_DEFAULT() }, /* long_octet_string */ \ { 0x001E, ZAP_TYPE(CHAR_STRING), 11, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_EMPTY_DEFAULT() }, /* char_string */ \ { 0x001F, ZAP_TYPE(LONG_CHAR_STRING), 1002, ZAP_ATTRIBUTE_MASK(WRITABLE), \ ZAP_EMPTY_DEFAULT() }, /* long_char_string */ \ - { 0x0020, ZAP_TYPE(EPOCH_US), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(3817) }, /* epoch_us */ \ - { 0x0021, ZAP_TYPE(EPOCH_S), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(3825) }, /* epoch_s */ \ + { 0x0020, ZAP_TYPE(EPOCH_US), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(3823) }, /* epoch_us */ \ + { 0x0021, ZAP_TYPE(EPOCH_S), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(3831) }, /* epoch_s */ \ { 0x0022, ZAP_TYPE(VENDOR_ID), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_EMPTY_DEFAULT() }, /* vendor_id */ \ { 0x0023, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ ZAP_EMPTY_DEFAULT() }, /* list_nullables_and_optionals_struct */ \ @@ -1837,25 +1852,25 @@ { 0x8002, ZAP_TYPE(BITMAP16), 2, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ ZAP_SIMPLE_DEFAULT(0) }, /* nullable_bitmap16 */ \ { 0x8003, ZAP_TYPE(BITMAP32), 4, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_LONG_DEFAULTS_INDEX(3829) }, /* nullable_bitmap32 */ \ + ZAP_LONG_DEFAULTS_INDEX(3835) }, /* nullable_bitmap32 */ \ { 0x8004, ZAP_TYPE(BITMAP64), 8, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_LONG_DEFAULTS_INDEX(3833) }, /* nullable_bitmap64 */ \ + ZAP_LONG_DEFAULTS_INDEX(3839) }, /* nullable_bitmap64 */ \ { 0x8005, ZAP_TYPE(INT8U), 1, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ ZAP_SIMPLE_DEFAULT(0) }, /* nullable_int8u */ \ { 0x8006, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ ZAP_SIMPLE_DEFAULT(0) }, /* nullable_int16u */ \ { 0x8008, ZAP_TYPE(INT32U), 4, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_LONG_DEFAULTS_INDEX(3841) }, /* nullable_int32u */ \ + ZAP_LONG_DEFAULTS_INDEX(3847) }, /* nullable_int32u */ \ { 0x800C, ZAP_TYPE(INT64U), 8, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_LONG_DEFAULTS_INDEX(3845) }, /* nullable_int64u */ \ + ZAP_LONG_DEFAULTS_INDEX(3851) }, /* nullable_int64u */ \ { 0x800D, ZAP_TYPE(INT8S), 1, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ ZAP_SIMPLE_DEFAULT(0) }, /* nullable_int8s */ \ { 0x800E, ZAP_TYPE(INT16S), 2, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ ZAP_SIMPLE_DEFAULT(0) }, /* nullable_int16s */ \ { 0x8010, ZAP_TYPE(INT32S), 4, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_LONG_DEFAULTS_INDEX(3853) }, /* nullable_int32s */ \ + ZAP_LONG_DEFAULTS_INDEX(3859) }, /* nullable_int32s */ \ { 0x8014, ZAP_TYPE(INT64S), 8, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_LONG_DEFAULTS_INDEX(3857) }, /* nullable_int64s */ \ + ZAP_LONG_DEFAULTS_INDEX(3863) }, /* nullable_int64s */ \ { 0x8015, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ ZAP_SIMPLE_DEFAULT(0) }, /* nullable_enum8 */ \ { 0x8016, ZAP_TYPE(ENUM16), 2, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ @@ -1867,8 +1882,8 @@ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Electrical Measurement (server) */ \ - { 0x0000, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(3865) }, /* measurement type */ \ - { 0x0304, ZAP_TYPE(INT32S), 4, 0, ZAP_LONG_DEFAULTS_INDEX(3869) }, /* total active power */ \ + { 0x0000, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(3871) }, /* measurement type */ \ + { 0x0304, ZAP_TYPE(INT32S), 4, 0, ZAP_LONG_DEFAULTS_INDEX(3875) }, /* total active power */ \ { 0x0505, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0xffff) }, /* rms voltage */ \ { 0x0506, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x8000) }, /* rms voltage min */ \ { 0x0507, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x8000) }, /* rms voltage max */ \ @@ -1889,7 +1904,7 @@ { 0x4001, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* OnTime */ \ { 0x4002, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* OffWaitTime */ \ { 0x4003, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_EMPTY_DEFAULT() }, /* StartUpOnOff */ \ - { 0xFFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(3873) }, /* FeatureMap */ \ + { 0xFFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(3879) }, /* FeatureMap */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(4) }, /* ClusterRevision */ \ \ /* Endpoint: 2, Cluster: Descriptor (server) */ \ @@ -2091,112 +2106,112 @@ { \ 0x0200, \ ZAP_ATTRIBUTE_INDEX(262), \ - 24, \ - 48, \ + 26, \ + 54, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION), \ chipFuncArrayPumpConfigurationAndControlServer \ }, /* Endpoint: 1, Cluster: Pump Configuration and Control (server) */ \ { \ - 0x0201, ZAP_ATTRIBUTE_INDEX(286), 19, 34, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0201, ZAP_ATTRIBUTE_INDEX(288), 19, 34, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Thermostat (server) */ \ { \ 0x0204, \ - ZAP_ATTRIBUTE_INDEX(305), \ + ZAP_ATTRIBUTE_INDEX(307), \ 4, \ 5, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ chipFuncArrayThermostatUserInterfaceConfigurationServer \ }, /* Endpoint: 1, Cluster: Thermostat User Interface Configuration (server) */ \ { 0x0300, \ - ZAP_ATTRIBUTE_INDEX(309), \ + ZAP_ATTRIBUTE_INDEX(311), \ 53, \ 341, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayColorControlServer }, /* Endpoint: 1, Cluster: Color Control (server) */ \ { \ - 0x0400, ZAP_ATTRIBUTE_INDEX(362), 6, 11, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0400, ZAP_ATTRIBUTE_INDEX(364), 6, 11, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Illuminance Measurement (server) */ \ { \ - 0x0402, ZAP_ATTRIBUTE_INDEX(368), 5, 10, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0402, ZAP_ATTRIBUTE_INDEX(370), 5, 10, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Temperature Measurement (server) */ \ { \ - 0x0403, ZAP_ATTRIBUTE_INDEX(373), 4, 8, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0403, ZAP_ATTRIBUTE_INDEX(375), 4, 8, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Pressure Measurement (server) */ \ { \ - 0x0404, ZAP_ATTRIBUTE_INDEX(377), 5, 10, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0404, ZAP_ATTRIBUTE_INDEX(379), 5, 10, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Flow Measurement (server) */ \ { \ - 0x0405, ZAP_ATTRIBUTE_INDEX(382), 5, 10, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0405, ZAP_ATTRIBUTE_INDEX(384), 5, 10, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Relative Humidity Measurement (server) */ \ { 0x0406, \ - ZAP_ATTRIBUTE_INDEX(387), \ + ZAP_ATTRIBUTE_INDEX(389), \ 4, \ 5, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayOccupancySensingServer }, /* Endpoint: 1, Cluster: Occupancy Sensing (server) */ \ { 0x0500, \ - ZAP_ATTRIBUTE_INDEX(391), \ + ZAP_ATTRIBUTE_INDEX(393), \ 6, \ 16, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION) | \ ZAP_CLUSTER_MASK(MESSAGE_SENT_FUNCTION), \ chipFuncArrayIasZoneServer }, /* Endpoint: 1, Cluster: IAS Zone (server) */ \ { \ - 0x0503, ZAP_ATTRIBUTE_INDEX(397), 2, 35, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0503, ZAP_ATTRIBUTE_INDEX(399), 2, 35, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Wake on LAN (server) */ \ { \ - 0x0504, ZAP_ATTRIBUTE_INDEX(399), 4, 322, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0504, ZAP_ATTRIBUTE_INDEX(401), 4, 322, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: TV Channel (server) */ \ { \ - 0x0505, ZAP_ATTRIBUTE_INDEX(403), 2, 256, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0505, ZAP_ATTRIBUTE_INDEX(405), 2, 256, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Target Navigator (server) */ \ { \ - 0x0506, ZAP_ATTRIBUTE_INDEX(405), 9, 59, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0506, ZAP_ATTRIBUTE_INDEX(407), 9, 59, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Media Playback (server) */ \ { \ - 0x0507, ZAP_ATTRIBUTE_INDEX(414), 3, 257, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0507, ZAP_ATTRIBUTE_INDEX(416), 3, 257, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Media Input (server) */ \ { \ - 0x0508, ZAP_ATTRIBUTE_INDEX(417), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0508, ZAP_ATTRIBUTE_INDEX(419), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Low Power (server) */ \ { \ - 0x0509, ZAP_ATTRIBUTE_INDEX(418), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0509, ZAP_ATTRIBUTE_INDEX(420), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Keypad Input (server) */ \ { \ - 0x050A, ZAP_ATTRIBUTE_INDEX(419), 3, 510, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x050A, ZAP_ATTRIBUTE_INDEX(421), 3, 510, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Content Launcher (server) */ \ { \ - 0x050B, ZAP_ATTRIBUTE_INDEX(422), 3, 257, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x050B, ZAP_ATTRIBUTE_INDEX(424), 3, 257, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Audio Output (server) */ \ { \ - 0x050C, ZAP_ATTRIBUTE_INDEX(425), 4, 258, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x050C, ZAP_ATTRIBUTE_INDEX(427), 4, 258, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Application Launcher (server) */ \ { \ - 0x050D, ZAP_ATTRIBUTE_INDEX(429), 8, 108, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x050D, ZAP_ATTRIBUTE_INDEX(431), 8, 108, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Application Basic (server) */ \ { \ - 0x050E, ZAP_ATTRIBUTE_INDEX(437), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x050E, ZAP_ATTRIBUTE_INDEX(439), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Account Login (server) */ \ { \ - 0x050F, ZAP_ATTRIBUTE_INDEX(438), 44, 2680, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x050F, ZAP_ATTRIBUTE_INDEX(440), 44, 2680, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Test Cluster (server) */ \ { \ - 0x0B04, ZAP_ATTRIBUTE_INDEX(482), 12, 28, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0B04, ZAP_ATTRIBUTE_INDEX(484), 12, 28, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Electrical Measurement (server) */ \ { \ - 0xF000, ZAP_ATTRIBUTE_INDEX(494), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0xF000, ZAP_ATTRIBUTE_INDEX(496), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Binding (server) */ \ { 0x0006, \ - ZAP_ATTRIBUTE_INDEX(495), \ + ZAP_ATTRIBUTE_INDEX(497), \ 7, \ 13, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayOnOffServer }, /* Endpoint: 2, Cluster: On/Off (server) */ \ { \ - 0x001D, ZAP_ATTRIBUTE_INDEX(502), 5, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x001D, ZAP_ATTRIBUTE_INDEX(504), 5, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 2, Cluster: Descriptor (server) */ \ { 0x0406, \ - ZAP_ATTRIBUTE_INDEX(507), \ + ZAP_ATTRIBUTE_INDEX(509), \ 4, \ 5, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ @@ -2208,7 +2223,7 @@ // This is an array of EmberAfEndpointType structures. #define GENERATED_ENDPOINT_TYPES \ { \ - { ZAP_CLUSTER_INDEX(0), 18, 1914 }, { ZAP_CLUSTER_INDEX(18), 44, 5780 }, { ZAP_CLUSTER_INDEX(62), 3, 18 }, \ + { ZAP_CLUSTER_INDEX(0), 18, 1914 }, { ZAP_CLUSTER_INDEX(18), 44, 5786 }, { ZAP_CLUSTER_INDEX(62), 3, 18 }, \ } // Largest attribute size is needed for various buffers @@ -2218,7 +2233,7 @@ #define ATTRIBUTE_SINGLETONS_SIZE (689) // Total size of attribute storage -#define ATTRIBUTE_MAX_SIZE (7712) +#define ATTRIBUTE_MAX_SIZE (7718) // Number of fixed endpoints #define FIXED_ENDPOINT_COUNT (3) diff --git a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp index 30f27cbeeb0143..f78db0ebadca13 100644 --- a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp +++ b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp @@ -29,6 +29,7 @@ #include #include #include +#include namespace chip { namespace app { @@ -42,14 +43,14 @@ namespace MainsVoltage { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -58,8 +59,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, - ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace MainsVoltage @@ -69,14 +72,14 @@ namespace MainsFrequency { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -85,8 +88,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, - ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace MainsFrequency @@ -96,14 +101,14 @@ namespace MainsAlarmMask { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -112,8 +117,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, - ZCL_BITMAP8_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, writable, ZCL_BITMAP8_ATTRIBUTE_TYPE); } } // namespace MainsAlarmMask @@ -123,14 +130,14 @@ namespace MainsVoltageMinThreshold { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -139,8 +146,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, - ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace MainsVoltageMinThreshold @@ -150,14 +159,14 @@ namespace MainsVoltageMaxThreshold { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -166,8 +175,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, - ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace MainsVoltageMaxThreshold @@ -177,14 +188,14 @@ namespace MainsVoltageDwellTrip { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -193,8 +204,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, - ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace MainsVoltageDwellTrip @@ -204,14 +217,14 @@ namespace BatteryVoltage { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -220,8 +233,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, - ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace BatteryVoltage @@ -231,14 +246,14 @@ namespace BatteryPercentageRemaining { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -247,8 +262,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, - ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace BatteryPercentageRemaining @@ -288,14 +305,14 @@ namespace BatterySize { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -304,8 +321,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, - ZCL_ENUM8_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } } // namespace BatterySize @@ -315,14 +334,14 @@ namespace BatteryAhrRating { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -331,8 +350,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, - ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace BatteryAhrRating @@ -342,14 +363,14 @@ namespace BatteryQuantity { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -358,8 +379,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, - ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace BatteryQuantity @@ -369,14 +392,14 @@ namespace BatteryRatedVoltage { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -385,8 +408,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, - ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace BatteryRatedVoltage @@ -396,14 +421,14 @@ namespace BatteryAlarmMask { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -412,8 +437,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, - ZCL_BITMAP8_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, writable, ZCL_BITMAP8_ATTRIBUTE_TYPE); } } // namespace BatteryAlarmMask @@ -423,14 +450,14 @@ namespace BatteryVoltageMinThreshold { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -439,8 +466,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, - ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace BatteryVoltageMinThreshold @@ -450,14 +479,14 @@ namespace BatteryVoltageThreshold1 { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -466,8 +495,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, - ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace BatteryVoltageThreshold1 @@ -477,14 +508,14 @@ namespace BatteryVoltageThreshold2 { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -493,8 +524,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, - ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace BatteryVoltageThreshold2 @@ -504,14 +537,14 @@ namespace BatteryVoltageThreshold3 { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -520,8 +553,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, - ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace BatteryVoltageThreshold3 @@ -531,14 +566,14 @@ namespace BatteryPercentageMinThreshold { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -547,8 +582,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, - ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace BatteryPercentageMinThreshold @@ -558,14 +595,14 @@ namespace BatteryPercentageThreshold1 { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -574,8 +611,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, - ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace BatteryPercentageThreshold1 @@ -585,14 +624,14 @@ namespace BatteryPercentageThreshold2 { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -601,8 +640,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, - ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace BatteryPercentageThreshold2 @@ -612,14 +653,14 @@ namespace BatteryPercentageThreshold3 { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -628,8 +669,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, - ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace BatteryPercentageThreshold3 @@ -639,14 +682,14 @@ namespace BatteryAlarmState { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) @@ -655,8 +698,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, - ZCL_BITMAP32_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } } // namespace BatteryAlarmState @@ -666,14 +711,14 @@ namespace Battery2Voltage { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -682,8 +727,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, - ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace Battery2Voltage @@ -693,14 +740,14 @@ namespace Battery2PercentageRemaining { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -709,8 +756,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, - ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace Battery2PercentageRemaining @@ -750,14 +799,14 @@ namespace Battery2Size { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -766,8 +815,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, - ZCL_ENUM8_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } } // namespace Battery2Size @@ -777,14 +828,14 @@ namespace Battery2AhrRating { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -793,8 +844,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, - ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace Battery2AhrRating @@ -804,14 +857,14 @@ namespace Battery2Quantity { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -820,8 +873,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, - ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace Battery2Quantity @@ -831,14 +886,14 @@ namespace Battery2RatedVoltage { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -847,8 +902,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, - ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace Battery2RatedVoltage @@ -858,14 +915,14 @@ namespace Battery2AlarmMask { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -874,8 +931,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, - ZCL_BITMAP8_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, writable, ZCL_BITMAP8_ATTRIBUTE_TYPE); } } // namespace Battery2AlarmMask @@ -885,14 +944,14 @@ namespace Battery2VoltageMinThreshold { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -901,8 +960,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, - ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace Battery2VoltageMinThreshold @@ -912,14 +973,14 @@ namespace Battery2VoltageThreshold1 { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -928,8 +989,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, - ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace Battery2VoltageThreshold1 @@ -939,14 +1002,14 @@ namespace Battery2VoltageThreshold2 { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -955,8 +1018,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, - ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace Battery2VoltageThreshold2 @@ -966,14 +1031,14 @@ namespace Battery2VoltageThreshold3 { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -982,8 +1047,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, - ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace Battery2VoltageThreshold3 @@ -993,14 +1060,14 @@ namespace Battery2PercentageMinThreshold { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -1009,8 +1076,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, - ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace Battery2PercentageMinThreshold @@ -1020,14 +1089,14 @@ namespace Battery2PercentageThreshold1 { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -1036,8 +1105,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, - ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace Battery2PercentageThreshold1 @@ -1047,14 +1118,14 @@ namespace Battery2PercentageThreshold2 { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -1063,8 +1134,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, - ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace Battery2PercentageThreshold2 @@ -1074,14 +1147,14 @@ namespace Battery2PercentageThreshold3 { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -1090,8 +1163,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, - ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace Battery2PercentageThreshold3 @@ -1101,14 +1176,14 @@ namespace Battery2AlarmState { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) @@ -1117,8 +1192,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, - ZCL_BITMAP32_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } } // namespace Battery2AlarmState @@ -1128,14 +1205,14 @@ namespace Battery3Voltage { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -1144,8 +1221,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, - ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace Battery3Voltage @@ -1155,14 +1234,14 @@ namespace Battery3PercentageRemaining { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -1171,8 +1250,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, - ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace Battery3PercentageRemaining @@ -1212,14 +1293,14 @@ namespace Battery3Size { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -1228,8 +1309,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, - ZCL_ENUM8_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } } // namespace Battery3Size @@ -1239,14 +1322,14 @@ namespace Battery3AhrRating { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -1255,8 +1338,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, - ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace Battery3AhrRating @@ -1266,14 +1351,14 @@ namespace Battery3Quantity { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -1282,8 +1367,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, - ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace Battery3Quantity @@ -1293,14 +1380,14 @@ namespace Battery3RatedVoltage { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -1309,8 +1396,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, - ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace Battery3RatedVoltage @@ -1320,14 +1409,14 @@ namespace Battery3AlarmMask { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -1336,8 +1425,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, - ZCL_BITMAP8_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, writable, ZCL_BITMAP8_ATTRIBUTE_TYPE); } } // namespace Battery3AlarmMask @@ -1347,14 +1438,14 @@ namespace Battery3VoltageMinThreshold { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -1363,8 +1454,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, - ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace Battery3VoltageMinThreshold @@ -1374,14 +1467,14 @@ namespace Battery3VoltageThreshold1 { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -1390,8 +1483,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, - ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace Battery3VoltageThreshold1 @@ -1401,14 +1496,14 @@ namespace Battery3VoltageThreshold2 { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -1417,8 +1512,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, - ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace Battery3VoltageThreshold2 @@ -1428,14 +1525,14 @@ namespace Battery3VoltageThreshold3 { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -1444,8 +1541,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, - ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace Battery3VoltageThreshold3 @@ -1455,14 +1554,14 @@ namespace Battery3PercentageMinThreshold { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -1471,8 +1570,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, - ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace Battery3PercentageMinThreshold @@ -1482,14 +1583,14 @@ namespace Battery3PercentageThreshold1 { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -1498,8 +1599,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, - ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace Battery3PercentageThreshold1 @@ -1509,14 +1612,14 @@ namespace Battery3PercentageThreshold2 { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -1525,8 +1628,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, - ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace Battery3PercentageThreshold2 @@ -1536,14 +1641,14 @@ namespace Battery3PercentageThreshold3 { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -1552,8 +1657,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, - ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace Battery3PercentageThreshold3 @@ -1563,14 +1670,14 @@ namespace Battery3AlarmState { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) @@ -1579,8 +1686,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, - ZCL_BITMAP32_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } } // namespace Battery3AlarmState @@ -1596,14 +1705,15 @@ namespace CurrentTemperature { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DeviceTemperatureConfiguration::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::DeviceTemperatureConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) @@ -1612,7 +1722,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::DeviceTemperatureConfiguration::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::DeviceTemperatureConfiguration::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -1623,14 +1736,15 @@ namespace MinTempExperienced { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DeviceTemperatureConfiguration::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::DeviceTemperatureConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) @@ -1639,7 +1753,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::DeviceTemperatureConfiguration::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::DeviceTemperatureConfiguration::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -1650,14 +1767,15 @@ namespace MaxTempExperienced { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DeviceTemperatureConfiguration::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::DeviceTemperatureConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) @@ -1666,7 +1784,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::DeviceTemperatureConfiguration::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::DeviceTemperatureConfiguration::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -1677,14 +1798,15 @@ namespace OverTempTotalDwell { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DeviceTemperatureConfiguration::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::DeviceTemperatureConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -1693,7 +1815,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::DeviceTemperatureConfiguration::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::DeviceTemperatureConfiguration::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -1704,14 +1829,15 @@ namespace DeviceTempAlarmMask { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DeviceTemperatureConfiguration::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::DeviceTemperatureConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -1720,7 +1846,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::DeviceTemperatureConfiguration::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::DeviceTemperatureConfiguration::Id, Id, writable, ZCL_BITMAP8_ATTRIBUTE_TYPE); } @@ -1731,14 +1860,15 @@ namespace LowTempThreshold { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DeviceTemperatureConfiguration::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::DeviceTemperatureConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) @@ -1747,7 +1877,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::DeviceTemperatureConfiguration::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::DeviceTemperatureConfiguration::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -1758,14 +1891,15 @@ namespace HighTempThreshold { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DeviceTemperatureConfiguration::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::DeviceTemperatureConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) @@ -1774,12 +1908,77 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::DeviceTemperatureConfiguration::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::DeviceTemperatureConfiguration::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } } // namespace HighTempThreshold +namespace LowTempDwellTripPoint { + +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) +{ + NumericAttributeTraits>::StorageType temp; + uint8_t * readable = NumericAttributeTraits>::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::DeviceTemperatureConfiguration::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits>::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = NumericAttributeTraits>::StorageToWorking(temp); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) +{ + if (!NumericAttributeTraits>::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } + NumericAttributeTraits>::StorageType storageValue; + NumericAttributeTraits>::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits>::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::DeviceTemperatureConfiguration::Id, Id, writable, + ZCL_INT24U_ATTRIBUTE_TYPE); +} + +} // namespace LowTempDwellTripPoint + +namespace HighTempDwellTripPoint { + +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) +{ + NumericAttributeTraits>::StorageType temp; + uint8_t * readable = NumericAttributeTraits>::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::DeviceTemperatureConfiguration::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits>::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = NumericAttributeTraits>::StorageToWorking(temp); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) +{ + if (!NumericAttributeTraits>::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } + NumericAttributeTraits>::StorageType storageValue; + NumericAttributeTraits>::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits>::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::DeviceTemperatureConfiguration::Id, Id, writable, + ZCL_INT24U_ATTRIBUTE_TYPE); +} + +} // namespace HighTempDwellTripPoint + } // namespace Attributes } // namespace DeviceTemperatureConfiguration @@ -1791,14 +1990,14 @@ namespace IdentifyTime { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::Identify::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Identify::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -1807,7 +2006,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::Identify::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::Identify::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace IdentifyTime @@ -1817,14 +2019,14 @@ namespace IdentifyType { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::Identify::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Identify::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -1833,7 +2035,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::Identify::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::Identify::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } } // namespace IdentifyType @@ -1849,14 +2054,14 @@ namespace NameSupport { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::Groups::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Groups::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -1865,7 +2070,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::Groups::Id, Id, (uint8_t *) &value, ZCL_BITMAP8_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::Groups::Id, Id, writable, ZCL_BITMAP8_ATTRIBUTE_TYPE); } } // namespace NameSupport @@ -1881,14 +2089,14 @@ namespace SceneCount { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::Scenes::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Scenes::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -1897,7 +2105,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::Scenes::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::Scenes::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace SceneCount @@ -1907,14 +2118,14 @@ namespace CurrentScene { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::Scenes::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Scenes::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -1923,7 +2134,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::Scenes::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::Scenes::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace CurrentScene @@ -1933,14 +2147,14 @@ namespace CurrentGroup { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::Scenes::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Scenes::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -1949,7 +2163,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::Scenes::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::Scenes::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace CurrentGroup @@ -1959,14 +2176,14 @@ namespace SceneValid { EmberAfStatus Get(chip::EndpointId endpoint, bool * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::Scenes::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Scenes::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, bool value) @@ -1975,7 +2192,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, bool value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::Scenes::Id, Id, (uint8_t *) &value, ZCL_BOOLEAN_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::Scenes::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE); } } // namespace SceneValid @@ -1985,14 +2205,14 @@ namespace NameSupport { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::Scenes::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Scenes::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -2001,7 +2221,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::Scenes::Id, Id, (uint8_t *) &value, ZCL_BITMAP8_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::Scenes::Id, Id, writable, ZCL_BITMAP8_ATTRIBUTE_TYPE); } } // namespace NameSupport @@ -2011,14 +2234,14 @@ namespace LastConfiguredBy { EmberAfStatus Get(chip::EndpointId endpoint, chip::NodeId * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::Scenes::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Scenes::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, chip::NodeId value) @@ -2027,7 +2250,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, chip::NodeId value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::Scenes::Id, Id, (uint8_t *) &value, ZCL_NODE_ID_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::Scenes::Id, Id, writable, ZCL_NODE_ID_ATTRIBUTE_TYPE); } } // namespace LastConfiguredBy @@ -2043,14 +2269,14 @@ namespace OnOff { EmberAfStatus Get(chip::EndpointId endpoint, bool * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::OnOff::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::OnOff::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, bool value) @@ -2059,7 +2285,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, bool value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::OnOff::Id, Id, (uint8_t *) &value, ZCL_BOOLEAN_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::OnOff::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE); } } // namespace OnOff @@ -2069,14 +2298,14 @@ namespace SampleMfgSpecificAttribute0x00000x1002 { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::OnOff::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::OnOff::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -2085,7 +2314,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::OnOff::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::OnOff::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace SampleMfgSpecificAttribute0x00000x1002 @@ -2095,14 +2327,14 @@ namespace SampleMfgSpecificAttribute0x00000x1049 { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::OnOff::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::OnOff::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -2111,7 +2343,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::OnOff::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::OnOff::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace SampleMfgSpecificAttribute0x00000x1049 @@ -2121,14 +2356,14 @@ namespace SampleMfgSpecificAttribute0x00010x1002 { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::OnOff::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::OnOff::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -2137,7 +2372,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::OnOff::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::OnOff::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace SampleMfgSpecificAttribute0x00010x1002 @@ -2147,14 +2385,14 @@ namespace SampleMfgSpecificAttribute0x00010x1040 { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::OnOff::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::OnOff::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -2163,7 +2401,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::OnOff::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::OnOff::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace SampleMfgSpecificAttribute0x00010x1040 @@ -2173,14 +2414,14 @@ namespace GlobalSceneControl { EmberAfStatus Get(chip::EndpointId endpoint, bool * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::OnOff::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::OnOff::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, bool value) @@ -2189,7 +2430,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, bool value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::OnOff::Id, Id, (uint8_t *) &value, ZCL_BOOLEAN_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::OnOff::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE); } } // namespace GlobalSceneControl @@ -2199,14 +2443,14 @@ namespace OnTime { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::OnOff::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::OnOff::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -2215,7 +2459,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::OnOff::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::OnOff::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace OnTime @@ -2225,14 +2472,14 @@ namespace OffWaitTime { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::OnOff::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::OnOff::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -2241,7 +2488,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::OnOff::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::OnOff::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace OffWaitTime @@ -2251,14 +2501,14 @@ namespace StartUpOnOff { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::OnOff::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::OnOff::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -2267,7 +2517,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::OnOff::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::OnOff::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } } // namespace StartUpOnOff @@ -2283,14 +2536,14 @@ namespace SwitchType { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::OnOffSwitchConfiguration::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::OnOffSwitchConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -2299,8 +2552,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::OnOffSwitchConfiguration::Id, Id, (uint8_t *) &value, - ZCL_ENUM8_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::OnOffSwitchConfiguration::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } } // namespace SwitchType @@ -2310,14 +2565,14 @@ namespace SwitchActions { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::OnOffSwitchConfiguration::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::OnOffSwitchConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -2326,8 +2581,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::OnOffSwitchConfiguration::Id, Id, (uint8_t *) &value, - ZCL_ENUM8_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::OnOffSwitchConfiguration::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } } // namespace SwitchActions @@ -2343,14 +2600,14 @@ namespace CurrentLevel { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::LevelControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::LevelControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -2359,7 +2616,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::LevelControl::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::LevelControl::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace CurrentLevel @@ -2369,14 +2629,14 @@ namespace RemainingTime { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::LevelControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::LevelControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -2385,7 +2645,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::LevelControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::LevelControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace RemainingTime @@ -2395,14 +2658,14 @@ namespace MinLevel { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::LevelControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::LevelControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -2411,7 +2674,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::LevelControl::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::LevelControl::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace MinLevel @@ -2421,14 +2687,14 @@ namespace MaxLevel { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::LevelControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::LevelControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -2437,7 +2703,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::LevelControl::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::LevelControl::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace MaxLevel @@ -2447,14 +2716,14 @@ namespace CurrentFrequency { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::LevelControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::LevelControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -2463,7 +2732,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::LevelControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::LevelControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace CurrentFrequency @@ -2473,14 +2745,14 @@ namespace MinFrequency { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::LevelControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::LevelControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -2489,7 +2761,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::LevelControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::LevelControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace MinFrequency @@ -2499,14 +2774,14 @@ namespace MaxFrequency { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::LevelControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::LevelControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -2515,7 +2790,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::LevelControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::LevelControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace MaxFrequency @@ -2525,14 +2803,14 @@ namespace Options { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::LevelControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::LevelControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -2541,7 +2819,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::LevelControl::Id, Id, (uint8_t *) &value, ZCL_BITMAP8_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::LevelControl::Id, Id, writable, ZCL_BITMAP8_ATTRIBUTE_TYPE); } } // namespace Options @@ -2551,14 +2832,14 @@ namespace OnOffTransitionTime { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::LevelControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::LevelControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -2567,7 +2848,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::LevelControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::LevelControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace OnOffTransitionTime @@ -2577,14 +2861,14 @@ namespace OnLevel { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::LevelControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::LevelControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -2593,7 +2877,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::LevelControl::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::LevelControl::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace OnLevel @@ -2603,14 +2890,14 @@ namespace OnTransitionTime { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::LevelControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::LevelControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -2619,7 +2906,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::LevelControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::LevelControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace OnTransitionTime @@ -2629,14 +2919,14 @@ namespace OffTransitionTime { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::LevelControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::LevelControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -2645,7 +2935,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::LevelControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::LevelControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace OffTransitionTime @@ -2655,14 +2948,14 @@ namespace DefaultMoveRate { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::LevelControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::LevelControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -2671,7 +2964,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::LevelControl::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::LevelControl::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace DefaultMoveRate @@ -2681,14 +2977,14 @@ namespace StartUpCurrentLevel { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::LevelControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::LevelControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -2697,7 +2993,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::LevelControl::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::LevelControl::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace StartUpCurrentLevel @@ -2713,14 +3012,14 @@ namespace AlarmCount { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::Alarms::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Alarms::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -2729,7 +3028,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::Alarms::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::Alarms::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace AlarmCount @@ -2745,14 +3047,14 @@ namespace Time { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::Time::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Time::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) @@ -2761,7 +3063,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::Time::Id, Id, (uint8_t *) &value, ZCL_EPOCH_S_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::Time::Id, Id, writable, ZCL_EPOCH_S_ATTRIBUTE_TYPE); } } // namespace Time @@ -2771,14 +3076,14 @@ namespace TimeStatus { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::Time::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Time::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -2787,7 +3092,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::Time::Id, Id, (uint8_t *) &value, ZCL_BITMAP8_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::Time::Id, Id, writable, ZCL_BITMAP8_ATTRIBUTE_TYPE); } } // namespace TimeStatus @@ -2797,14 +3105,14 @@ namespace TimeZone { EmberAfStatus Get(chip::EndpointId endpoint, int32_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::Time::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Time::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int32_t value) @@ -2813,7 +3121,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, int32_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::Time::Id, Id, (uint8_t *) &value, ZCL_INT32S_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::Time::Id, Id, writable, ZCL_INT32S_ATTRIBUTE_TYPE); } } // namespace TimeZone @@ -2823,14 +3134,14 @@ namespace DstStart { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::Time::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Time::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) @@ -2839,7 +3150,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::Time::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::Time::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } } // namespace DstStart @@ -2849,14 +3163,14 @@ namespace DstEnd { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::Time::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Time::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) @@ -2865,7 +3179,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::Time::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::Time::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } } // namespace DstEnd @@ -2875,14 +3192,14 @@ namespace DstShift { EmberAfStatus Get(chip::EndpointId endpoint, int32_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::Time::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Time::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int32_t value) @@ -2891,7 +3208,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, int32_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::Time::Id, Id, (uint8_t *) &value, ZCL_INT32S_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::Time::Id, Id, writable, ZCL_INT32S_ATTRIBUTE_TYPE); } } // namespace DstShift @@ -2901,14 +3221,14 @@ namespace StandardTime { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::Time::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Time::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) @@ -2917,7 +3237,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::Time::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::Time::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } } // namespace StandardTime @@ -2927,14 +3250,14 @@ namespace LocalTime { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::Time::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Time::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) @@ -2943,7 +3266,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::Time::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::Time::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } } // namespace LocalTime @@ -2953,14 +3279,14 @@ namespace LastSetTime { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::Time::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Time::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) @@ -2969,7 +3295,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::Time::Id, Id, (uint8_t *) &value, ZCL_EPOCH_S_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::Time::Id, Id, writable, ZCL_EPOCH_S_ATTRIBUTE_TYPE); } } // namespace LastSetTime @@ -2979,14 +3308,14 @@ namespace ValidUntilTime { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::Time::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Time::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) @@ -2995,7 +3324,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::Time::Id, Id, (uint8_t *) &value, ZCL_EPOCH_S_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::Time::Id, Id, writable, ZCL_EPOCH_S_ATTRIBUTE_TYPE); } } // namespace ValidUntilTime @@ -3101,14 +3433,14 @@ namespace OutOfService { EmberAfStatus Get(chip::EndpointId endpoint, bool * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::BinaryInputBasic::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BinaryInputBasic::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, bool value) @@ -3117,8 +3449,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, bool value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::BinaryInputBasic::Id, Id, (uint8_t *) &value, - ZCL_BOOLEAN_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::BinaryInputBasic::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE); } } // namespace OutOfService @@ -3128,14 +3462,14 @@ namespace Polarity { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::BinaryInputBasic::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BinaryInputBasic::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -3144,7 +3478,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::BinaryInputBasic::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::BinaryInputBasic::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } } // namespace Polarity @@ -3154,14 +3491,14 @@ namespace PresentValue { EmberAfStatus Get(chip::EndpointId endpoint, bool * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::BinaryInputBasic::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BinaryInputBasic::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, bool value) @@ -3170,8 +3507,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, bool value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::BinaryInputBasic::Id, Id, (uint8_t *) &value, - ZCL_BOOLEAN_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::BinaryInputBasic::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE); } } // namespace PresentValue @@ -3181,14 +3520,14 @@ namespace Reliability { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::BinaryInputBasic::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BinaryInputBasic::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -3197,7 +3536,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::BinaryInputBasic::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::BinaryInputBasic::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } } // namespace Reliability @@ -3207,14 +3549,14 @@ namespace StatusFlags { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::BinaryInputBasic::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BinaryInputBasic::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -3223,8 +3565,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::BinaryInputBasic::Id, Id, (uint8_t *) &value, - ZCL_BITMAP8_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::BinaryInputBasic::Id, Id, writable, ZCL_BITMAP8_ATTRIBUTE_TYPE); } } // namespace StatusFlags @@ -3234,14 +3578,14 @@ namespace ApplicationType { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::BinaryInputBasic::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BinaryInputBasic::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) @@ -3250,7 +3594,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::BinaryInputBasic::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::BinaryInputBasic::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } } // namespace ApplicationType @@ -3266,14 +3613,14 @@ namespace TotalProfileNum { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::PowerProfile::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerProfile::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -3282,7 +3629,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::PowerProfile::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::PowerProfile::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace TotalProfileNum @@ -3292,14 +3642,14 @@ namespace MultipleScheduling { EmberAfStatus Get(chip::EndpointId endpoint, bool * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::PowerProfile::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerProfile::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, bool value) @@ -3308,7 +3658,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, bool value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::PowerProfile::Id, Id, (uint8_t *) &value, ZCL_BOOLEAN_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::PowerProfile::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE); } } // namespace MultipleScheduling @@ -3318,14 +3671,14 @@ namespace EnergyFormatting { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::PowerProfile::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerProfile::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -3334,7 +3687,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::PowerProfile::Id, Id, (uint8_t *) &value, ZCL_BITMAP8_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::PowerProfile::Id, Id, writable, ZCL_BITMAP8_ATTRIBUTE_TYPE); } } // namespace EnergyFormatting @@ -3344,14 +3700,14 @@ namespace EnergyRemote { EmberAfStatus Get(chip::EndpointId endpoint, bool * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::PowerProfile::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerProfile::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, bool value) @@ -3360,7 +3716,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, bool value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::PowerProfile::Id, Id, (uint8_t *) &value, ZCL_BOOLEAN_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::PowerProfile::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE); } } // namespace EnergyRemote @@ -3370,14 +3729,14 @@ namespace ScheduleMode { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::PowerProfile::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerProfile::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -3386,7 +3745,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::PowerProfile::Id, Id, (uint8_t *) &value, ZCL_BITMAP8_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::PowerProfile::Id, Id, writable, ZCL_BITMAP8_ATTRIBUTE_TYPE); } } // namespace ScheduleMode @@ -3402,14 +3764,14 @@ namespace StartTime { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::ApplianceControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ApplianceControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -3418,7 +3780,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ApplianceControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ApplianceControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace StartTime @@ -3428,14 +3793,14 @@ namespace FinishTime { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::ApplianceControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ApplianceControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -3444,7 +3809,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ApplianceControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ApplianceControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace FinishTime @@ -3454,14 +3822,14 @@ namespace RemainingTime { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::ApplianceControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ApplianceControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -3470,7 +3838,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ApplianceControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ApplianceControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace RemainingTime @@ -3492,14 +3863,14 @@ namespace CheckInInterval { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::PollControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PollControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) @@ -3508,7 +3879,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::PollControl::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::PollControl::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } } // namespace CheckInInterval @@ -3518,14 +3892,14 @@ namespace LongPollInterval { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::PollControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PollControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) @@ -3534,7 +3908,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::PollControl::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::PollControl::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } } // namespace LongPollInterval @@ -3544,14 +3921,14 @@ namespace ShortPollInterval { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::PollControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PollControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -3560,7 +3937,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::PollControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::PollControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace ShortPollInterval @@ -3570,14 +3950,14 @@ namespace FastPollTimeout { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::PollControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PollControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -3586,7 +3966,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::PollControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::PollControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace FastPollTimeout @@ -3596,14 +3979,14 @@ namespace CheckInIntervalMin { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::PollControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PollControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) @@ -3612,7 +3995,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::PollControl::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::PollControl::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } } // namespace CheckInIntervalMin @@ -3622,14 +4008,14 @@ namespace LongPollIntervalMin { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::PollControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PollControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) @@ -3638,7 +4024,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::PollControl::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::PollControl::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } } // namespace LongPollIntervalMin @@ -3648,14 +4037,14 @@ namespace FastPollTimeoutMax { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::PollControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PollControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -3664,7 +4053,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::PollControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::PollControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace FastPollTimeoutMax @@ -3716,14 +4108,14 @@ namespace InteractionModelVersion { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::Basic::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Basic::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -3732,7 +4124,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::Basic::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::Basic::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace InteractionModelVersion @@ -3772,14 +4167,14 @@ namespace VendorID { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::Basic::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Basic::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -3788,7 +4183,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::Basic::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::Basic::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace VendorID @@ -3828,14 +4226,14 @@ namespace ProductID { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::Basic::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Basic::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -3844,7 +4242,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::Basic::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::Basic::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace ProductID @@ -3914,14 +4315,14 @@ namespace HardwareVersion { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::Basic::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Basic::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -3930,7 +4331,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::Basic::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::Basic::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace HardwareVersion @@ -3970,14 +4374,14 @@ namespace SoftwareVersion { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::Basic::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Basic::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) @@ -3986,7 +4390,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::Basic::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::Basic::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } } // namespace SoftwareVersion @@ -4176,14 +4583,14 @@ namespace LocalConfigDisabled { EmberAfStatus Get(chip::EndpointId endpoint, bool * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::Basic::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Basic::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, bool value) @@ -4192,7 +4599,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, bool value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::Basic::Id, Id, (uint8_t *) &value, ZCL_BOOLEAN_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::Basic::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE); } } // namespace LocalConfigDisabled @@ -4202,14 +4612,14 @@ namespace Reachable { EmberAfStatus Get(chip::EndpointId endpoint, bool * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::Basic::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Basic::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, bool value) @@ -4218,7 +4628,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, bool value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::Basic::Id, Id, (uint8_t *) &value, ZCL_BOOLEAN_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::Basic::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE); } } // namespace Reachable @@ -4296,14 +4709,15 @@ namespace UpdatePossible { EmberAfStatus Get(chip::EndpointId endpoint, bool * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::OtaSoftwareUpdateRequestor::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::OtaSoftwareUpdateRequestor::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, bool value) @@ -4312,7 +4726,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, bool value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::OtaSoftwareUpdateRequestor::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::OtaSoftwareUpdateRequestor::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE); } @@ -4329,14 +4746,14 @@ namespace Status { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -4345,7 +4762,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } } // namespace Status @@ -4355,14 +4775,14 @@ namespace Order { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -4371,7 +4791,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace Order @@ -4411,14 +4834,14 @@ namespace WiredAssessedInputVoltage { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) @@ -4427,7 +4850,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } } // namespace WiredAssessedInputVoltage @@ -4437,14 +4863,14 @@ namespace WiredAssessedInputFrequency { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -4453,7 +4879,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace WiredAssessedInputFrequency @@ -4463,14 +4892,14 @@ namespace WiredCurrentType { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -4479,7 +4908,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } } // namespace WiredCurrentType @@ -4489,14 +4921,14 @@ namespace WiredAssessedCurrent { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) @@ -4505,7 +4937,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } } // namespace WiredAssessedCurrent @@ -4515,14 +4950,14 @@ namespace WiredNominalVoltage { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) @@ -4531,7 +4966,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } } // namespace WiredNominalVoltage @@ -4541,14 +4979,14 @@ namespace WiredMaximumCurrent { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) @@ -4557,7 +4995,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } } // namespace WiredMaximumCurrent @@ -4567,14 +5008,14 @@ namespace WiredPresent { EmberAfStatus Get(chip::EndpointId endpoint, bool * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, bool value) @@ -4583,7 +5024,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, bool value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) &value, ZCL_BOOLEAN_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE); } } // namespace WiredPresent @@ -4593,14 +5037,14 @@ namespace BatteryVoltage { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) @@ -4609,7 +5053,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } } // namespace BatteryVoltage @@ -4619,14 +5066,14 @@ namespace BatteryPercentRemaining { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -4635,7 +5082,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace BatteryPercentRemaining @@ -4645,14 +5095,14 @@ namespace BatteryTimeRemaining { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) @@ -4661,7 +5111,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } } // namespace BatteryTimeRemaining @@ -4671,14 +5124,14 @@ namespace BatteryChargeLevel { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -4687,7 +5140,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } } // namespace BatteryChargeLevel @@ -4697,14 +5153,14 @@ namespace BatteryReplacementNeeded { EmberAfStatus Get(chip::EndpointId endpoint, bool * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, bool value) @@ -4713,7 +5169,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, bool value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) &value, ZCL_BOOLEAN_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE); } } // namespace BatteryReplacementNeeded @@ -4723,14 +5182,14 @@ namespace BatteryReplaceability { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -4739,7 +5198,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } } // namespace BatteryReplaceability @@ -4749,14 +5211,14 @@ namespace BatteryPresent { EmberAfStatus Get(chip::EndpointId endpoint, bool * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, bool value) @@ -4765,7 +5227,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, bool value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) &value, ZCL_BOOLEAN_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE); } } // namespace BatteryPresent @@ -4805,14 +5270,14 @@ namespace BatteryCommonDesignation { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) @@ -4821,7 +5286,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } } // namespace BatteryCommonDesignation @@ -4891,14 +5359,14 @@ namespace BatteryApprovedChemistry { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) @@ -4907,7 +5375,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } } // namespace BatteryApprovedChemistry @@ -4917,14 +5388,14 @@ namespace BatteryCapacity { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) @@ -4933,7 +5404,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } } // namespace BatteryCapacity @@ -4943,14 +5417,14 @@ namespace BatteryQuantity { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -4959,7 +5433,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace BatteryQuantity @@ -4969,14 +5446,14 @@ namespace BatteryChargeState { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -4985,7 +5462,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } } // namespace BatteryChargeState @@ -4995,14 +5475,14 @@ namespace BatteryTimeToFullCharge { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) @@ -5011,7 +5491,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } } // namespace BatteryTimeToFullCharge @@ -5021,14 +5504,14 @@ namespace BatteryFunctionalWhileCharging { EmberAfStatus Get(chip::EndpointId endpoint, bool * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, bool value) @@ -5037,7 +5520,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, bool value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) &value, ZCL_BOOLEAN_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE); } } // namespace BatteryFunctionalWhileCharging @@ -5047,14 +5533,14 @@ namespace BatteryChargingCurrent { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) @@ -5063,7 +5549,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } } // namespace BatteryChargingCurrent @@ -5079,14 +5568,14 @@ namespace Breadcrumb { EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::GeneralCommissioning::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::GeneralCommissioning::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) @@ -5095,8 +5584,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::GeneralCommissioning::Id, Id, (uint8_t *) &value, - ZCL_INT64U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::GeneralCommissioning::Id, Id, writable, ZCL_INT64U_ATTRIBUTE_TYPE); } } // namespace Breadcrumb @@ -5112,14 +5603,14 @@ namespace RebootCount { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::GeneralDiagnostics::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::GeneralDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -5128,8 +5619,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::GeneralDiagnostics::Id, Id, (uint8_t *) &value, - ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::GeneralDiagnostics::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace RebootCount @@ -5139,14 +5632,14 @@ namespace UpTime { EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::GeneralDiagnostics::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::GeneralDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) @@ -5155,8 +5648,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::GeneralDiagnostics::Id, Id, (uint8_t *) &value, - ZCL_INT64U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::GeneralDiagnostics::Id, Id, writable, ZCL_INT64U_ATTRIBUTE_TYPE); } } // namespace UpTime @@ -5166,14 +5661,14 @@ namespace TotalOperationalHours { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::GeneralDiagnostics::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::GeneralDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) @@ -5182,8 +5677,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::GeneralDiagnostics::Id, Id, (uint8_t *) &value, - ZCL_INT32U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::GeneralDiagnostics::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } } // namespace TotalOperationalHours @@ -5193,14 +5690,14 @@ namespace BootReasons { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::GeneralDiagnostics::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::GeneralDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -5209,8 +5706,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::GeneralDiagnostics::Id, Id, (uint8_t *) &value, - ZCL_ENUM8_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::GeneralDiagnostics::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } } // namespace BootReasons @@ -5226,14 +5725,14 @@ namespace CurrentHeapFree { EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::SoftwareDiagnostics::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::SoftwareDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) @@ -5242,8 +5741,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::SoftwareDiagnostics::Id, Id, (uint8_t *) &value, - ZCL_INT64U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::SoftwareDiagnostics::Id, Id, writable, ZCL_INT64U_ATTRIBUTE_TYPE); } } // namespace CurrentHeapFree @@ -5253,14 +5754,14 @@ namespace CurrentHeapUsed { EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::SoftwareDiagnostics::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::SoftwareDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) @@ -5269,8 +5770,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::SoftwareDiagnostics::Id, Id, (uint8_t *) &value, - ZCL_INT64U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::SoftwareDiagnostics::Id, Id, writable, ZCL_INT64U_ATTRIBUTE_TYPE); } } // namespace CurrentHeapUsed @@ -5280,14 +5783,14 @@ namespace CurrentHeapHighWatermark { EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::SoftwareDiagnostics::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::SoftwareDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) @@ -5296,8 +5799,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::SoftwareDiagnostics::Id, Id, (uint8_t *) &value, - ZCL_INT64U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::SoftwareDiagnostics::Id, Id, writable, ZCL_INT64U_ATTRIBUTE_TYPE); } } // namespace CurrentHeapHighWatermark @@ -5313,14 +5818,14 @@ namespace Channel { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -5329,8 +5834,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, - ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace Channel @@ -5340,14 +5847,14 @@ namespace RoutingRole { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -5356,8 +5863,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, - ZCL_ENUM8_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } } // namespace RoutingRole @@ -5399,14 +5908,14 @@ namespace PanId { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -5415,8 +5924,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, - ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace PanId @@ -5426,14 +5937,14 @@ namespace ExtendedPanId { EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) @@ -5442,8 +5953,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, - ZCL_INT64U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, writable, ZCL_INT64U_ATTRIBUTE_TYPE); } } // namespace ExtendedPanId @@ -5485,14 +5998,14 @@ namespace OverrunCount { EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) @@ -5501,8 +6014,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, - ZCL_INT64U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, writable, ZCL_INT64U_ATTRIBUTE_TYPE); } } // namespace OverrunCount @@ -5512,14 +6027,14 @@ namespace PartitionId { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) @@ -5528,8 +6043,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, - ZCL_INT32U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } } // namespace PartitionId @@ -5539,14 +6056,14 @@ namespace Weighting { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -5555,8 +6072,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, - ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace Weighting @@ -5566,14 +6085,14 @@ namespace DataVersion { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -5582,8 +6101,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, - ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace DataVersion @@ -5593,14 +6114,14 @@ namespace StableDataVersion { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -5609,8 +6130,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, - ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace StableDataVersion @@ -5620,14 +6143,14 @@ namespace LeaderRouterId { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -5636,8 +6159,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, - ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace LeaderRouterId @@ -5647,14 +6172,14 @@ namespace DetachedRoleCount { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -5663,8 +6188,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, - ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace DetachedRoleCount @@ -5674,14 +6201,14 @@ namespace ChildRoleCount { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -5690,8 +6217,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, - ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace ChildRoleCount @@ -5701,14 +6230,14 @@ namespace RouterRoleCount { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -5717,8 +6246,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, - ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace RouterRoleCount @@ -5728,14 +6259,14 @@ namespace LeaderRoleCount { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -5744,8 +6275,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, - ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace LeaderRoleCount @@ -5755,14 +6288,14 @@ namespace AttachAttemptCount { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -5771,8 +6304,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, - ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace AttachAttemptCount @@ -5782,14 +6317,14 @@ namespace PartitionIdChangeCount { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -5798,8 +6333,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, - ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace PartitionIdChangeCount @@ -5809,14 +6346,14 @@ namespace BetterPartitionAttachAttemptCount { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -5825,8 +6362,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, - ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace BetterPartitionAttachAttemptCount @@ -5836,14 +6375,14 @@ namespace ParentChangeCount { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -5852,8 +6391,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, - ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace ParentChangeCount @@ -5863,14 +6404,14 @@ namespace TxTotalCount { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) @@ -5879,8 +6420,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, - ZCL_INT32U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } } // namespace TxTotalCount @@ -5890,14 +6433,14 @@ namespace TxUnicastCount { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) @@ -5906,8 +6449,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, - ZCL_INT32U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } } // namespace TxUnicastCount @@ -5917,14 +6462,14 @@ namespace TxBroadcastCount { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) @@ -5933,8 +6478,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, - ZCL_INT32U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } } // namespace TxBroadcastCount @@ -5944,14 +6491,14 @@ namespace TxAckRequestedCount { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) @@ -5960,8 +6507,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, - ZCL_INT32U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } } // namespace TxAckRequestedCount @@ -5971,14 +6520,14 @@ namespace TxAckedCount { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) @@ -5987,8 +6536,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, - ZCL_INT32U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } } // namespace TxAckedCount @@ -5998,14 +6549,14 @@ namespace TxNoAckRequestedCount { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) @@ -6014,8 +6565,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, - ZCL_INT32U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } } // namespace TxNoAckRequestedCount @@ -6025,14 +6578,14 @@ namespace TxDataCount { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) @@ -6041,8 +6594,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, - ZCL_INT32U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } } // namespace TxDataCount @@ -6052,14 +6607,14 @@ namespace TxDataPollCount { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) @@ -6068,8 +6623,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, - ZCL_INT32U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } } // namespace TxDataPollCount @@ -6079,14 +6636,14 @@ namespace TxBeaconCount { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) @@ -6095,8 +6652,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, - ZCL_INT32U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } } // namespace TxBeaconCount @@ -6106,14 +6665,14 @@ namespace TxBeaconRequestCount { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) @@ -6122,8 +6681,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, - ZCL_INT32U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } } // namespace TxBeaconRequestCount @@ -6133,14 +6694,14 @@ namespace TxOtherCount { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) @@ -6149,8 +6710,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, - ZCL_INT32U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } } // namespace TxOtherCount @@ -6160,14 +6723,14 @@ namespace TxRetryCount { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) @@ -6176,8 +6739,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, - ZCL_INT32U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } } // namespace TxRetryCount @@ -6187,14 +6752,14 @@ namespace TxDirectMaxRetryExpiryCount { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) @@ -6203,8 +6768,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, - ZCL_INT32U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } } // namespace TxDirectMaxRetryExpiryCount @@ -6214,14 +6781,14 @@ namespace TxIndirectMaxRetryExpiryCount { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) @@ -6230,8 +6797,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, - ZCL_INT32U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } } // namespace TxIndirectMaxRetryExpiryCount @@ -6241,14 +6810,14 @@ namespace TxErrCcaCount { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) @@ -6257,8 +6826,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, - ZCL_INT32U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } } // namespace TxErrCcaCount @@ -6268,14 +6839,14 @@ namespace TxErrAbortCount { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) @@ -6284,8 +6855,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, - ZCL_INT32U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } } // namespace TxErrAbortCount @@ -6295,14 +6868,14 @@ namespace TxErrBusyChannelCount { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) @@ -6311,8 +6884,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, - ZCL_INT32U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } } // namespace TxErrBusyChannelCount @@ -6322,14 +6897,14 @@ namespace RxTotalCount { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) @@ -6338,8 +6913,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, - ZCL_INT32U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } } // namespace RxTotalCount @@ -6349,14 +6926,14 @@ namespace RxUnicastCount { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) @@ -6365,8 +6942,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, - ZCL_INT32U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } } // namespace RxUnicastCount @@ -6376,14 +6955,14 @@ namespace RxBroadcastCount { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) @@ -6392,8 +6971,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, - ZCL_INT32U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } } // namespace RxBroadcastCount @@ -6403,14 +6984,14 @@ namespace RxDataCount { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) @@ -6419,8 +7000,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, - ZCL_INT32U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } } // namespace RxDataCount @@ -6430,14 +7013,14 @@ namespace RxDataPollCount { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) @@ -6446,8 +7029,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, - ZCL_INT32U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } } // namespace RxDataPollCount @@ -6457,14 +7042,14 @@ namespace RxBeaconCount { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) @@ -6473,8 +7058,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, - ZCL_INT32U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } } // namespace RxBeaconCount @@ -6484,14 +7071,14 @@ namespace RxBeaconRequestCount { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) @@ -6500,8 +7087,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, - ZCL_INT32U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } } // namespace RxBeaconRequestCount @@ -6511,14 +7100,14 @@ namespace RxOtherCount { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) @@ -6527,8 +7116,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, - ZCL_INT32U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } } // namespace RxOtherCount @@ -6538,14 +7129,14 @@ namespace RxAddressFilteredCount { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) @@ -6554,8 +7145,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, - ZCL_INT32U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } } // namespace RxAddressFilteredCount @@ -6565,14 +7158,14 @@ namespace RxDestAddrFilteredCount { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) @@ -6581,8 +7174,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, - ZCL_INT32U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } } // namespace RxDestAddrFilteredCount @@ -6592,14 +7187,14 @@ namespace RxDuplicatedCount { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) @@ -6608,8 +7203,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, - ZCL_INT32U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } } // namespace RxDuplicatedCount @@ -6619,14 +7216,14 @@ namespace RxErrNoFrameCount { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) @@ -6635,8 +7232,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, - ZCL_INT32U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } } // namespace RxErrNoFrameCount @@ -6646,14 +7245,14 @@ namespace RxErrUnknownNeighborCount { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) @@ -6662,8 +7261,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, - ZCL_INT32U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } } // namespace RxErrUnknownNeighborCount @@ -6673,14 +7274,14 @@ namespace RxErrInvalidSrcAddrCount { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) @@ -6689,8 +7290,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, - ZCL_INT32U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } } // namespace RxErrInvalidSrcAddrCount @@ -6700,14 +7303,14 @@ namespace RxErrSecCount { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) @@ -6716,8 +7319,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, - ZCL_INT32U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } } // namespace RxErrSecCount @@ -6727,14 +7332,14 @@ namespace RxErrFcsCount { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) @@ -6743,8 +7348,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, - ZCL_INT32U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } } // namespace RxErrFcsCount @@ -6754,14 +7361,14 @@ namespace RxErrOtherCount { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) @@ -6770,8 +7377,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, - ZCL_INT32U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } } // namespace RxErrOtherCount @@ -6781,14 +7390,14 @@ namespace ActiveTimestamp { EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) @@ -6797,8 +7406,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, - ZCL_INT64U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, writable, ZCL_INT64U_ATTRIBUTE_TYPE); } } // namespace ActiveTimestamp @@ -6808,14 +7419,14 @@ namespace PendingTimestamp { EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) @@ -6824,8 +7435,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, - ZCL_INT64U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, writable, ZCL_INT64U_ATTRIBUTE_TYPE); } } // namespace PendingTimestamp @@ -6835,14 +7448,14 @@ namespace Delay { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) @@ -6851,8 +7464,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, - ZCL_INT32U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } } // namespace Delay @@ -6932,14 +7547,14 @@ namespace SecurityType { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -6948,8 +7563,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, (uint8_t *) &value, - ZCL_ENUM8_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } } // namespace SecurityType @@ -6959,14 +7576,14 @@ namespace WiFiVersion { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -6975,8 +7592,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, (uint8_t *) &value, - ZCL_ENUM8_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } } // namespace WiFiVersion @@ -6986,14 +7605,14 @@ namespace ChannelNumber { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -7002,8 +7621,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, (uint8_t *) &value, - ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace ChannelNumber @@ -7013,14 +7634,14 @@ namespace Rssi { EmberAfStatus Get(chip::EndpointId endpoint, int8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int8_t value) @@ -7029,8 +7650,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, int8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, (uint8_t *) &value, - ZCL_INT8S_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, writable, ZCL_INT8S_ATTRIBUTE_TYPE); } } // namespace Rssi @@ -7040,14 +7663,14 @@ namespace BeaconLostCount { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) @@ -7056,8 +7679,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, (uint8_t *) &value, - ZCL_INT32U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } } // namespace BeaconLostCount @@ -7067,14 +7692,14 @@ namespace BeaconRxCount { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) @@ -7083,8 +7708,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, (uint8_t *) &value, - ZCL_INT32U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } } // namespace BeaconRxCount @@ -7094,14 +7721,14 @@ namespace PacketMulticastRxCount { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) @@ -7110,8 +7737,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, (uint8_t *) &value, - ZCL_INT32U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } } // namespace PacketMulticastRxCount @@ -7121,14 +7750,14 @@ namespace PacketMulticastTxCount { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) @@ -7137,8 +7766,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, (uint8_t *) &value, - ZCL_INT32U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } } // namespace PacketMulticastTxCount @@ -7148,14 +7779,14 @@ namespace PacketUnicastRxCount { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) @@ -7164,8 +7795,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, (uint8_t *) &value, - ZCL_INT32U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } } // namespace PacketUnicastRxCount @@ -7175,14 +7808,14 @@ namespace PacketUnicastTxCount { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) @@ -7191,8 +7824,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, (uint8_t *) &value, - ZCL_INT32U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } } // namespace PacketUnicastTxCount @@ -7202,14 +7837,14 @@ namespace CurrentMaxRate { EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) @@ -7218,8 +7853,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, (uint8_t *) &value, - ZCL_INT64U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, writable, ZCL_INT64U_ATTRIBUTE_TYPE); } } // namespace CurrentMaxRate @@ -7229,14 +7866,14 @@ namespace OverrunCount { EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) @@ -7245,8 +7882,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, (uint8_t *) &value, - ZCL_INT64U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, writable, ZCL_INT64U_ATTRIBUTE_TYPE); } } // namespace OverrunCount @@ -7262,14 +7901,15 @@ namespace PHYRate { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::EthernetNetworkDiagnostics::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::EthernetNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -7278,8 +7918,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::EthernetNetworkDiagnostics::Id, Id, (uint8_t *) &value, - ZCL_ENUM8_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::EthernetNetworkDiagnostics::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } } // namespace PHYRate @@ -7289,14 +7931,15 @@ namespace FullDuplex { EmberAfStatus Get(chip::EndpointId endpoint, bool * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::EthernetNetworkDiagnostics::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::EthernetNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, bool value) @@ -7305,7 +7948,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, bool value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::EthernetNetworkDiagnostics::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::EthernetNetworkDiagnostics::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE); } @@ -7316,14 +7962,15 @@ namespace PacketRxCount { EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::EthernetNetworkDiagnostics::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::EthernetNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) @@ -7332,8 +7979,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::EthernetNetworkDiagnostics::Id, Id, (uint8_t *) &value, - ZCL_INT64U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::EthernetNetworkDiagnostics::Id, Id, writable, ZCL_INT64U_ATTRIBUTE_TYPE); } } // namespace PacketRxCount @@ -7343,14 +7992,15 @@ namespace PacketTxCount { EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::EthernetNetworkDiagnostics::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::EthernetNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) @@ -7359,8 +8009,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::EthernetNetworkDiagnostics::Id, Id, (uint8_t *) &value, - ZCL_INT64U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::EthernetNetworkDiagnostics::Id, Id, writable, ZCL_INT64U_ATTRIBUTE_TYPE); } } // namespace PacketTxCount @@ -7370,14 +8022,15 @@ namespace TxErrCount { EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::EthernetNetworkDiagnostics::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::EthernetNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) @@ -7386,8 +8039,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::EthernetNetworkDiagnostics::Id, Id, (uint8_t *) &value, - ZCL_INT64U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::EthernetNetworkDiagnostics::Id, Id, writable, ZCL_INT64U_ATTRIBUTE_TYPE); } } // namespace TxErrCount @@ -7397,14 +8052,15 @@ namespace CollisionCount { EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::EthernetNetworkDiagnostics::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::EthernetNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) @@ -7413,8 +8069,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::EthernetNetworkDiagnostics::Id, Id, (uint8_t *) &value, - ZCL_INT64U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::EthernetNetworkDiagnostics::Id, Id, writable, ZCL_INT64U_ATTRIBUTE_TYPE); } } // namespace CollisionCount @@ -7424,14 +8082,15 @@ namespace OverrunCount { EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::EthernetNetworkDiagnostics::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::EthernetNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) @@ -7440,8 +8099,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::EthernetNetworkDiagnostics::Id, Id, (uint8_t *) &value, - ZCL_INT64U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::EthernetNetworkDiagnostics::Id, Id, writable, ZCL_INT64U_ATTRIBUTE_TYPE); } } // namespace OverrunCount @@ -7451,14 +8112,15 @@ namespace CarrierDetect { EmberAfStatus Get(chip::EndpointId endpoint, bool * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::EthernetNetworkDiagnostics::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::EthernetNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, bool value) @@ -7467,7 +8129,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, bool value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::EthernetNetworkDiagnostics::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::EthernetNetworkDiagnostics::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE); } @@ -7478,14 +8143,15 @@ namespace TimeSinceReset { EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::EthernetNetworkDiagnostics::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::EthernetNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) @@ -7494,8 +8160,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::EthernetNetworkDiagnostics::Id, Id, (uint8_t *) &value, - ZCL_INT64U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::EthernetNetworkDiagnostics::Id, Id, writable, ZCL_INT64U_ATTRIBUTE_TYPE); } } // namespace TimeSinceReset @@ -7541,14 +8209,14 @@ namespace VendorID { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BridgedDeviceBasic::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BridgedDeviceBasic::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -7557,8 +8225,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::BridgedDeviceBasic::Id, Id, (uint8_t *) &value, - ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::BridgedDeviceBasic::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace VendorID @@ -7628,14 +8298,14 @@ namespace HardwareVersion { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BridgedDeviceBasic::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BridgedDeviceBasic::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -7644,8 +8314,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::BridgedDeviceBasic::Id, Id, (uint8_t *) &value, - ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::BridgedDeviceBasic::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace HardwareVersion @@ -7685,14 +8357,14 @@ namespace SoftwareVersion { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BridgedDeviceBasic::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BridgedDeviceBasic::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) @@ -7701,8 +8373,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::BridgedDeviceBasic::Id, Id, (uint8_t *) &value, - ZCL_INT32U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::BridgedDeviceBasic::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } } // namespace SoftwareVersion @@ -7893,14 +8567,14 @@ namespace Reachable { EmberAfStatus Get(chip::EndpointId endpoint, bool * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BridgedDeviceBasic::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BridgedDeviceBasic::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, bool value) @@ -7909,8 +8583,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, bool value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::BridgedDeviceBasic::Id, Id, (uint8_t *) &value, - ZCL_BOOLEAN_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::BridgedDeviceBasic::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE); } } // namespace Reachable @@ -7956,14 +8632,14 @@ namespace NumberOfPositions { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::Switch::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Switch::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -7972,7 +8648,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::Switch::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::Switch::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace NumberOfPositions @@ -7982,14 +8661,14 @@ namespace CurrentPosition { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::Switch::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Switch::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -7998,7 +8677,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::Switch::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::Switch::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace CurrentPosition @@ -8008,14 +8690,14 @@ namespace MultiPressMax { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::Switch::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Switch::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -8024,7 +8706,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::Switch::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::Switch::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace MultiPressMax @@ -8040,14 +8725,14 @@ namespace SupportedFabrics { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::OperationalCredentials::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::OperationalCredentials::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -8056,8 +8741,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::OperationalCredentials::Id, Id, (uint8_t *) &value, - ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::OperationalCredentials::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace SupportedFabrics @@ -8067,14 +8754,14 @@ namespace CommissionedFabrics { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::OperationalCredentials::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::OperationalCredentials::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -8083,8 +8770,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::OperationalCredentials::Id, Id, (uint8_t *) &value, - ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::OperationalCredentials::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace CommissionedFabrics @@ -8094,14 +8783,14 @@ namespace CurrentFabricIndex { EmberAfStatus Get(chip::EndpointId endpoint, chip::FabricIndex * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::OperationalCredentials::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::OperationalCredentials::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, chip::FabricIndex value) @@ -8110,8 +8799,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, chip::FabricIndex value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::OperationalCredentials::Id, Id, (uint8_t *) &value, - ZCL_FABRIC_IDX_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::OperationalCredentials::Id, Id, writable, ZCL_FABRIC_IDX_ATTRIBUTE_TYPE); } } // namespace CurrentFabricIndex @@ -8133,14 +8824,14 @@ namespace StateValue { EmberAfStatus Get(chip::EndpointId endpoint, bool * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::BooleanState::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BooleanState::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, bool value) @@ -8149,7 +8840,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, bool value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::BooleanState::Id, Id, (uint8_t *) &value, ZCL_BOOLEAN_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::BooleanState::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE); } } // namespace StateValue @@ -8165,14 +8859,14 @@ namespace CurrentMode { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::ModeSelect::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ModeSelect::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -8181,7 +8875,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ModeSelect::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ModeSelect::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace CurrentMode @@ -8191,14 +8888,14 @@ namespace OnMode { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::ModeSelect::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ModeSelect::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -8207,7 +8904,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ModeSelect::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ModeSelect::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace OnMode @@ -8217,14 +8917,14 @@ namespace StartUpMode { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::ModeSelect::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ModeSelect::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -8233,7 +8933,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ModeSelect::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ModeSelect::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace StartUpMode @@ -8279,14 +8982,14 @@ namespace PhysicalClosedLimit { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ShadeConfiguration::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ShadeConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -8295,8 +8998,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ShadeConfiguration::Id, Id, (uint8_t *) &value, - ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ShadeConfiguration::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace PhysicalClosedLimit @@ -8306,14 +9011,14 @@ namespace MotorStepSize { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ShadeConfiguration::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ShadeConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -8322,8 +9027,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ShadeConfiguration::Id, Id, (uint8_t *) &value, - ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ShadeConfiguration::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace MotorStepSize @@ -8333,14 +9040,14 @@ namespace Status { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ShadeConfiguration::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ShadeConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -8349,8 +9056,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ShadeConfiguration::Id, Id, (uint8_t *) &value, - ZCL_BITMAP8_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ShadeConfiguration::Id, Id, writable, ZCL_BITMAP8_ATTRIBUTE_TYPE); } } // namespace Status @@ -8360,14 +9069,14 @@ namespace ClosedLimit { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ShadeConfiguration::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ShadeConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -8376,8 +9085,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ShadeConfiguration::Id, Id, (uint8_t *) &value, - ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ShadeConfiguration::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace ClosedLimit @@ -8387,14 +9098,14 @@ namespace Mode { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ShadeConfiguration::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ShadeConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -8403,8 +9114,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ShadeConfiguration::Id, Id, (uint8_t *) &value, - ZCL_ENUM8_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ShadeConfiguration::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } } // namespace Mode @@ -8420,14 +9133,14 @@ namespace LockState { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -8436,7 +9149,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } } // namespace LockState @@ -8446,14 +9162,14 @@ namespace LockType { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -8462,7 +9178,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } } // namespace LockType @@ -8472,14 +9191,14 @@ namespace ActuatorEnabled { EmberAfStatus Get(chip::EndpointId endpoint, bool * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, bool value) @@ -8488,7 +9207,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, bool value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &value, ZCL_BOOLEAN_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE); } } // namespace ActuatorEnabled @@ -8498,14 +9220,14 @@ namespace DoorState { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -8514,7 +9236,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } } // namespace DoorState @@ -8524,14 +9249,14 @@ namespace DoorOpenEvents { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) @@ -8540,7 +9265,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } } // namespace DoorOpenEvents @@ -8550,14 +9278,14 @@ namespace DoorClosedEvents { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) @@ -8566,7 +9294,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } } // namespace DoorClosedEvents @@ -8576,14 +9307,14 @@ namespace OpenPeriod { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -8592,7 +9323,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace OpenPeriod @@ -8602,14 +9336,14 @@ namespace NumLockRecordsSupported { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -8618,7 +9352,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace NumLockRecordsSupported @@ -8628,14 +9365,14 @@ namespace NumTotalUsersSupported { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -8644,7 +9381,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace NumTotalUsersSupported @@ -8654,14 +9394,14 @@ namespace NumPinUsersSupported { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -8670,7 +9410,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace NumPinUsersSupported @@ -8680,14 +9423,14 @@ namespace NumRfidUsersSupported { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -8696,7 +9439,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace NumRfidUsersSupported @@ -8706,14 +9452,14 @@ namespace NumWeekdaySchedulesSupportedPerUser { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -8722,7 +9468,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace NumWeekdaySchedulesSupportedPerUser @@ -8732,14 +9481,14 @@ namespace NumYeardaySchedulesSupportedPerUser { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -8748,7 +9497,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace NumYeardaySchedulesSupportedPerUser @@ -8758,14 +9510,14 @@ namespace NumHolidaySchedulesSupportedPerUser { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -8774,7 +9526,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace NumHolidaySchedulesSupportedPerUser @@ -8784,14 +9539,14 @@ namespace MaxPinLength { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -8800,7 +9555,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace MaxPinLength @@ -8810,14 +9568,14 @@ namespace MinPinLength { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -8826,7 +9584,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace MinPinLength @@ -8836,14 +9597,14 @@ namespace MaxRfidCodeLength { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -8852,7 +9613,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace MaxRfidCodeLength @@ -8862,14 +9626,14 @@ namespace MinRfidCodeLength { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -8878,7 +9642,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace MinRfidCodeLength @@ -8888,14 +9655,14 @@ namespace EnableLogging { EmberAfStatus Get(chip::EndpointId endpoint, bool * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, bool value) @@ -8904,7 +9671,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, bool value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &value, ZCL_BOOLEAN_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE); } } // namespace EnableLogging @@ -8944,14 +9714,14 @@ namespace LedSettings { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -8960,7 +9730,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace LedSettings @@ -8970,14 +9743,14 @@ namespace AutoRelockTime { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) @@ -8986,7 +9759,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } } // namespace AutoRelockTime @@ -8996,14 +9772,14 @@ namespace SoundVolume { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -9012,7 +9788,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace SoundVolume @@ -9022,14 +9801,14 @@ namespace OperatingMode { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -9038,7 +9817,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } } // namespace OperatingMode @@ -9048,14 +9830,14 @@ namespace SupportedOperatingModes { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -9064,7 +9846,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &value, ZCL_BITMAP16_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_BITMAP16_ATTRIBUTE_TYPE); } } // namespace SupportedOperatingModes @@ -9074,14 +9859,14 @@ namespace DefaultConfigurationRegister { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -9090,7 +9875,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &value, ZCL_BITMAP16_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_BITMAP16_ATTRIBUTE_TYPE); } } // namespace DefaultConfigurationRegister @@ -9100,14 +9888,14 @@ namespace EnableLocalProgramming { EmberAfStatus Get(chip::EndpointId endpoint, bool * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, bool value) @@ -9116,7 +9904,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, bool value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &value, ZCL_BOOLEAN_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE); } } // namespace EnableLocalProgramming @@ -9126,14 +9917,14 @@ namespace EnableOneTouchLocking { EmberAfStatus Get(chip::EndpointId endpoint, bool * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, bool value) @@ -9142,7 +9933,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, bool value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &value, ZCL_BOOLEAN_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE); } } // namespace EnableOneTouchLocking @@ -9152,14 +9946,14 @@ namespace EnableInsideStatusLed { EmberAfStatus Get(chip::EndpointId endpoint, bool * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, bool value) @@ -9168,7 +9962,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, bool value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &value, ZCL_BOOLEAN_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE); } } // namespace EnableInsideStatusLed @@ -9178,14 +9975,14 @@ namespace EnablePrivacyModeButton { EmberAfStatus Get(chip::EndpointId endpoint, bool * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, bool value) @@ -9194,7 +9991,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, bool value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &value, ZCL_BOOLEAN_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE); } } // namespace EnablePrivacyModeButton @@ -9204,14 +10004,14 @@ namespace WrongCodeEntryLimit { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -9220,7 +10020,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace WrongCodeEntryLimit @@ -9230,14 +10033,14 @@ namespace UserCodeTemporaryDisableTime { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -9246,7 +10049,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace UserCodeTemporaryDisableTime @@ -9256,14 +10062,14 @@ namespace SendPinOverTheAir { EmberAfStatus Get(chip::EndpointId endpoint, bool * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, bool value) @@ -9272,7 +10078,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, bool value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &value, ZCL_BOOLEAN_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE); } } // namespace SendPinOverTheAir @@ -9282,14 +10091,14 @@ namespace RequirePinForRfOperation { EmberAfStatus Get(chip::EndpointId endpoint, bool * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, bool value) @@ -9298,7 +10107,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, bool value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &value, ZCL_BOOLEAN_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE); } } // namespace RequirePinForRfOperation @@ -9308,14 +10120,14 @@ namespace ZigbeeSecurityLevel { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -9324,7 +10136,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } } // namespace ZigbeeSecurityLevel @@ -9334,14 +10149,14 @@ namespace AlarmMask { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -9350,7 +10165,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &value, ZCL_BITMAP16_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_BITMAP16_ATTRIBUTE_TYPE); } } // namespace AlarmMask @@ -9360,14 +10178,14 @@ namespace KeypadOperationEventMask { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -9376,7 +10194,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &value, ZCL_BITMAP16_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_BITMAP16_ATTRIBUTE_TYPE); } } // namespace KeypadOperationEventMask @@ -9386,14 +10207,14 @@ namespace RfOperationEventMask { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -9402,7 +10223,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &value, ZCL_BITMAP16_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_BITMAP16_ATTRIBUTE_TYPE); } } // namespace RfOperationEventMask @@ -9412,14 +10236,14 @@ namespace ManualOperationEventMask { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -9428,7 +10252,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &value, ZCL_BITMAP16_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_BITMAP16_ATTRIBUTE_TYPE); } } // namespace ManualOperationEventMask @@ -9438,14 +10265,14 @@ namespace RfidOperationEventMask { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -9454,7 +10281,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &value, ZCL_BITMAP16_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_BITMAP16_ATTRIBUTE_TYPE); } } // namespace RfidOperationEventMask @@ -9464,14 +10294,14 @@ namespace KeypadProgrammingEventMask { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -9480,7 +10310,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &value, ZCL_BITMAP16_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_BITMAP16_ATTRIBUTE_TYPE); } } // namespace KeypadProgrammingEventMask @@ -9490,14 +10323,14 @@ namespace RfProgrammingEventMask { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -9506,7 +10339,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &value, ZCL_BITMAP16_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_BITMAP16_ATTRIBUTE_TYPE); } } // namespace RfProgrammingEventMask @@ -9516,14 +10352,14 @@ namespace RfidProgrammingEventMask { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -9532,7 +10368,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &value, ZCL_BITMAP16_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_BITMAP16_ATTRIBUTE_TYPE); } } // namespace RfidProgrammingEventMask @@ -9548,14 +10387,14 @@ namespace Type { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -9564,7 +10403,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } } // namespace Type @@ -9574,14 +10416,14 @@ namespace PhysicalClosedLimitLift { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -9590,7 +10432,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace PhysicalClosedLimitLift @@ -9600,14 +10445,14 @@ namespace PhysicalClosedLimitTilt { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -9616,7 +10461,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace PhysicalClosedLimitTilt @@ -9626,14 +10474,14 @@ namespace CurrentPositionLift { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -9642,7 +10490,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace CurrentPositionLift @@ -9652,14 +10503,14 @@ namespace CurrentPositionTilt { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -9668,7 +10519,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace CurrentPositionTilt @@ -9678,14 +10532,14 @@ namespace NumberOfActuationsLift { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -9694,7 +10548,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace NumberOfActuationsLift @@ -9704,14 +10561,14 @@ namespace NumberOfActuationsTilt { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -9720,7 +10577,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace NumberOfActuationsTilt @@ -9730,14 +10590,14 @@ namespace ConfigStatus { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -9746,7 +10606,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) &value, ZCL_BITMAP8_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, writable, ZCL_BITMAP8_ATTRIBUTE_TYPE); } } // namespace ConfigStatus @@ -9756,14 +10619,14 @@ namespace CurrentPositionLiftPercentage { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -9772,7 +10635,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace CurrentPositionLiftPercentage @@ -9782,14 +10648,14 @@ namespace CurrentPositionTiltPercentage { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -9798,7 +10664,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace CurrentPositionTiltPercentage @@ -9808,14 +10677,14 @@ namespace OperationalStatus { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -9824,7 +10693,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) &value, ZCL_BITMAP8_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, writable, ZCL_BITMAP8_ATTRIBUTE_TYPE); } } // namespace OperationalStatus @@ -9834,14 +10706,14 @@ namespace TargetPositionLiftPercent100ths { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -9850,7 +10722,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace TargetPositionLiftPercent100ths @@ -9860,14 +10735,14 @@ namespace TargetPositionTiltPercent100ths { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -9876,7 +10751,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace TargetPositionTiltPercent100ths @@ -9886,14 +10764,14 @@ namespace EndProductType { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -9902,7 +10780,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } } // namespace EndProductType @@ -9912,14 +10793,14 @@ namespace CurrentPositionLiftPercent100ths { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -9928,7 +10809,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace CurrentPositionLiftPercent100ths @@ -9938,14 +10822,14 @@ namespace CurrentPositionTiltPercent100ths { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -9954,7 +10838,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace CurrentPositionTiltPercent100ths @@ -9964,14 +10851,14 @@ namespace InstalledOpenLimitLift { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -9980,7 +10867,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace InstalledOpenLimitLift @@ -9990,14 +10880,14 @@ namespace InstalledClosedLimitLift { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -10006,7 +10896,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace InstalledClosedLimitLift @@ -10016,14 +10909,14 @@ namespace InstalledOpenLimitTilt { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -10032,7 +10925,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace InstalledOpenLimitTilt @@ -10042,14 +10938,14 @@ namespace InstalledClosedLimitTilt { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -10058,7 +10954,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace InstalledClosedLimitTilt @@ -10068,14 +10967,14 @@ namespace VelocityLift { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -10084,7 +10983,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace VelocityLift @@ -10094,14 +10996,14 @@ namespace AccelerationTimeLift { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -10110,7 +11012,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace AccelerationTimeLift @@ -10120,14 +11025,14 @@ namespace DecelerationTimeLift { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -10136,7 +11041,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace DecelerationTimeLift @@ -10146,14 +11054,14 @@ namespace Mode { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -10162,7 +11070,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) &value, ZCL_BITMAP8_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, writable, ZCL_BITMAP8_ATTRIBUTE_TYPE); } } // namespace Mode @@ -10232,14 +11143,14 @@ namespace SafetyStatus { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -10248,7 +11159,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) &value, ZCL_BITMAP16_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, writable, ZCL_BITMAP16_ATTRIBUTE_TYPE); } } // namespace SafetyStatus @@ -10264,14 +11178,14 @@ namespace BarrierMovingState { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -10280,7 +11194,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } } // namespace BarrierMovingState @@ -10290,14 +11207,14 @@ namespace BarrierSafetyStatus { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -10306,7 +11223,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, (uint8_t *) &value, ZCL_BITMAP16_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, writable, ZCL_BITMAP16_ATTRIBUTE_TYPE); } } // namespace BarrierSafetyStatus @@ -10316,14 +11236,14 @@ namespace BarrierCapabilities { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -10332,7 +11252,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, (uint8_t *) &value, ZCL_BITMAP8_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, writable, ZCL_BITMAP8_ATTRIBUTE_TYPE); } } // namespace BarrierCapabilities @@ -10342,14 +11265,14 @@ namespace BarrierOpenEvents { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -10358,7 +11281,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace BarrierOpenEvents @@ -10368,14 +11294,14 @@ namespace BarrierCloseEvents { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -10384,7 +11310,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace BarrierCloseEvents @@ -10394,14 +11323,14 @@ namespace BarrierCommandOpenEvents { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -10410,7 +11339,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace BarrierCommandOpenEvents @@ -10420,14 +11352,14 @@ namespace BarrierCommandCloseEvents { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -10436,7 +11368,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace BarrierCommandCloseEvents @@ -10446,14 +11381,14 @@ namespace BarrierOpenPeriod { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -10462,7 +11397,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace BarrierOpenPeriod @@ -10472,14 +11410,14 @@ namespace BarrierClosePeriod { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -10488,7 +11426,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace BarrierClosePeriod @@ -10498,14 +11439,14 @@ namespace BarrierPosition { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -10514,7 +11455,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace BarrierPosition @@ -10530,14 +11474,15 @@ namespace MaxPressure { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) @@ -10546,7 +11491,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -10557,14 +11505,15 @@ namespace MaxSpeed { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -10573,7 +11522,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -10584,14 +11536,15 @@ namespace MaxFlow { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -10600,7 +11553,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -10611,14 +11567,15 @@ namespace MinConstPressure { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) @@ -10627,7 +11584,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -10638,14 +11598,15 @@ namespace MaxConstPressure { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) @@ -10654,7 +11615,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -10665,14 +11629,15 @@ namespace MinCompPressure { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) @@ -10681,7 +11646,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -10692,14 +11660,15 @@ namespace MaxCompPressure { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) @@ -10708,7 +11677,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -10719,14 +11691,15 @@ namespace MinConstSpeed { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -10735,7 +11708,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -10746,14 +11722,15 @@ namespace MaxConstSpeed { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -10762,7 +11739,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -10773,14 +11753,15 @@ namespace MinConstFlow { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -10789,7 +11770,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -10800,14 +11784,15 @@ namespace MaxConstFlow { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -10816,7 +11801,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -10827,14 +11815,15 @@ namespace MinConstTemp { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) @@ -10843,7 +11832,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -10854,14 +11846,15 @@ namespace MaxConstTemp { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) @@ -10870,7 +11863,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -10881,14 +11877,15 @@ namespace PumpStatus { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -10897,7 +11894,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, writable, ZCL_BITMAP16_ATTRIBUTE_TYPE); } @@ -10908,14 +11908,15 @@ namespace EffectiveOperationMode { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -10924,8 +11925,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) &value, - ZCL_ENUM8_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } } // namespace EffectiveOperationMode @@ -10935,14 +11938,15 @@ namespace EffectiveControlMode { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -10951,8 +11955,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) &value, - ZCL_ENUM8_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } } // namespace EffectiveControlMode @@ -10962,14 +11968,15 @@ namespace Capacity { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) @@ -10978,7 +11985,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -10989,14 +11999,15 @@ namespace Speed { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -11005,25 +12016,91 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace Speed +namespace LifetimeRunningHours { + +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) +{ + NumericAttributeTraits>::StorageType temp; + uint8_t * readable = NumericAttributeTraits>::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits>::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = NumericAttributeTraits>::StorageToWorking(temp); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) +{ + if (!NumericAttributeTraits>::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } + NumericAttributeTraits>::StorageType storageValue; + NumericAttributeTraits>::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits>::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, writable, + ZCL_INT24U_ATTRIBUTE_TYPE); +} + +} // namespace LifetimeRunningHours + +namespace Power { + +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) +{ + NumericAttributeTraits>::StorageType temp; + uint8_t * readable = NumericAttributeTraits>::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits>::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = NumericAttributeTraits>::StorageToWorking(temp); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) +{ + if (!NumericAttributeTraits>::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } + NumericAttributeTraits>::StorageType storageValue; + NumericAttributeTraits>::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits>::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, writable, + ZCL_INT24U_ATTRIBUTE_TYPE); +} + +} // namespace Power + namespace LifetimeEnergyConsumed { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) @@ -11032,7 +12109,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -11043,14 +12123,15 @@ namespace OperationMode { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -11059,8 +12140,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) &value, - ZCL_ENUM8_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } } // namespace OperationMode @@ -11070,14 +12153,15 @@ namespace ControlMode { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -11086,8 +12170,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) &value, - ZCL_ENUM8_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } } // namespace ControlMode @@ -11097,14 +12183,15 @@ namespace AlarmMask { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -11113,7 +12200,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, writable, ZCL_BITMAP16_ATTRIBUTE_TYPE); } @@ -11130,14 +12220,14 @@ namespace LocalTemperature { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) @@ -11146,7 +12236,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } } // namespace LocalTemperature @@ -11156,14 +12249,14 @@ namespace OutdoorTemperature { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) @@ -11172,7 +12265,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } } // namespace OutdoorTemperature @@ -11182,14 +12278,14 @@ namespace Occupancy { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -11198,7 +12294,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_BITMAP8_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_BITMAP8_ATTRIBUTE_TYPE); } } // namespace Occupancy @@ -11208,14 +12307,14 @@ namespace AbsMinHeatSetpointLimit { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) @@ -11224,7 +12323,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } } // namespace AbsMinHeatSetpointLimit @@ -11234,14 +12336,14 @@ namespace AbsMaxHeatSetpointLimit { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) @@ -11250,7 +12352,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } } // namespace AbsMaxHeatSetpointLimit @@ -11260,14 +12365,14 @@ namespace AbsMinCoolSetpointLimit { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) @@ -11276,7 +12381,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } } // namespace AbsMinCoolSetpointLimit @@ -11286,14 +12394,14 @@ namespace AbsMaxCoolSetpointLimit { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) @@ -11302,7 +12410,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } } // namespace AbsMaxCoolSetpointLimit @@ -11312,14 +12423,14 @@ namespace PiCoolingDemand { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -11328,7 +12439,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace PiCoolingDemand @@ -11338,14 +12452,14 @@ namespace PiHeatingDemand { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -11354,7 +12468,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace PiHeatingDemand @@ -11364,14 +12481,14 @@ namespace HvacSystemTypeConfiguration { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -11380,7 +12497,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_BITMAP8_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_BITMAP8_ATTRIBUTE_TYPE); } } // namespace HvacSystemTypeConfiguration @@ -11390,14 +12510,14 @@ namespace LocalTemperatureCalibration { EmberAfStatus Get(chip::EndpointId endpoint, int8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int8_t value) @@ -11406,7 +12526,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, int8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_INT8S_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_INT8S_ATTRIBUTE_TYPE); } } // namespace LocalTemperatureCalibration @@ -11416,14 +12539,14 @@ namespace OccupiedCoolingSetpoint { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) @@ -11432,7 +12555,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } } // namespace OccupiedCoolingSetpoint @@ -11442,14 +12568,14 @@ namespace OccupiedHeatingSetpoint { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) @@ -11458,7 +12584,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } } // namespace OccupiedHeatingSetpoint @@ -11468,14 +12597,14 @@ namespace UnoccupiedCoolingSetpoint { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) @@ -11484,7 +12613,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } } // namespace UnoccupiedCoolingSetpoint @@ -11494,14 +12626,14 @@ namespace UnoccupiedHeatingSetpoint { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) @@ -11510,7 +12642,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } } // namespace UnoccupiedHeatingSetpoint @@ -11520,14 +12655,14 @@ namespace MinHeatSetpointLimit { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) @@ -11536,7 +12671,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } } // namespace MinHeatSetpointLimit @@ -11546,14 +12684,14 @@ namespace MaxHeatSetpointLimit { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) @@ -11562,7 +12700,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } } // namespace MaxHeatSetpointLimit @@ -11572,14 +12713,14 @@ namespace MinCoolSetpointLimit { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) @@ -11588,7 +12729,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } } // namespace MinCoolSetpointLimit @@ -11598,14 +12742,14 @@ namespace MaxCoolSetpointLimit { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) @@ -11614,7 +12758,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } } // namespace MaxCoolSetpointLimit @@ -11624,14 +12771,14 @@ namespace MinSetpointDeadBand { EmberAfStatus Get(chip::EndpointId endpoint, int8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int8_t value) @@ -11640,7 +12787,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, int8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_INT8S_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_INT8S_ATTRIBUTE_TYPE); } } // namespace MinSetpointDeadBand @@ -11650,14 +12800,14 @@ namespace RemoteSensing { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -11666,7 +12816,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_BITMAP8_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_BITMAP8_ATTRIBUTE_TYPE); } } // namespace RemoteSensing @@ -11676,14 +12829,14 @@ namespace ControlSequenceOfOperation { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -11692,7 +12845,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } } // namespace ControlSequenceOfOperation @@ -11702,14 +12858,14 @@ namespace SystemMode { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -11718,7 +12874,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } } // namespace SystemMode @@ -11728,14 +12887,14 @@ namespace AlarmMask { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -11744,7 +12903,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_BITMAP8_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_BITMAP8_ATTRIBUTE_TYPE); } } // namespace AlarmMask @@ -11754,14 +12916,14 @@ namespace ThermostatRunningMode { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -11770,7 +12932,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } } // namespace ThermostatRunningMode @@ -11780,14 +12945,14 @@ namespace StartOfWeek { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -11796,7 +12961,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } } // namespace StartOfWeek @@ -11806,14 +12974,14 @@ namespace NumberOfWeeklyTransitions { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -11822,7 +12990,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace NumberOfWeeklyTransitions @@ -11832,14 +13003,14 @@ namespace NumberOfDailyTransitions { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -11848,7 +13019,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace NumberOfDailyTransitions @@ -11858,14 +13032,14 @@ namespace TemperatureSetpointHold { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -11874,7 +13048,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } } // namespace TemperatureSetpointHold @@ -11884,14 +13061,14 @@ namespace TemperatureSetpointHoldDuration { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -11900,7 +13077,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace TemperatureSetpointHoldDuration @@ -11910,14 +13090,14 @@ namespace ThermostatProgrammingOperationMode { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -11926,7 +13106,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_BITMAP8_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_BITMAP8_ATTRIBUTE_TYPE); } } // namespace ThermostatProgrammingOperationMode @@ -11936,14 +13119,14 @@ namespace HvacRelayState { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -11952,7 +13135,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_BITMAP16_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_BITMAP16_ATTRIBUTE_TYPE); } } // namespace HvacRelayState @@ -11962,14 +13148,14 @@ namespace SetpointChangeSource { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -11978,7 +13164,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } } // namespace SetpointChangeSource @@ -11988,14 +13177,14 @@ namespace SetpointChangeAmount { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) @@ -12004,7 +13193,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } } // namespace SetpointChangeAmount @@ -12014,14 +13206,14 @@ namespace SetpointChangeSourceTimestamp { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) @@ -12030,7 +13222,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_EPOCH_S_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_EPOCH_S_ATTRIBUTE_TYPE); } } // namespace SetpointChangeSourceTimestamp @@ -12040,14 +13235,14 @@ namespace AcType { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -12056,7 +13251,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } } // namespace AcType @@ -12066,14 +13264,14 @@ namespace AcCapacity { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -12082,7 +13280,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace AcCapacity @@ -12092,14 +13293,14 @@ namespace AcRefrigerantType { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -12108,7 +13309,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } } // namespace AcRefrigerantType @@ -12118,14 +13322,14 @@ namespace AcCompressor { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -12134,7 +13338,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } } // namespace AcCompressor @@ -12144,14 +13351,14 @@ namespace AcErrorCode { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) @@ -12160,7 +13367,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_BITMAP32_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } } // namespace AcErrorCode @@ -12170,14 +13380,14 @@ namespace AcLouverPosition { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -12186,7 +13396,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } } // namespace AcLouverPosition @@ -12196,14 +13409,14 @@ namespace AcCoilTemperature { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) @@ -12212,7 +13425,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } } // namespace AcCoilTemperature @@ -12222,14 +13438,14 @@ namespace AcCapacityFormat { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -12238,7 +13454,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } } // namespace AcCapacityFormat @@ -12254,14 +13473,14 @@ namespace FanMode { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::FanControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::FanControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -12270,7 +13489,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::FanControl::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::FanControl::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } } // namespace FanMode @@ -12280,14 +13502,14 @@ namespace FanModeSequence { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::FanControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::FanControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -12296,7 +13518,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::FanControl::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::FanControl::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } } // namespace FanModeSequence @@ -12312,14 +13537,14 @@ namespace RelativeHumidity { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DehumidificationControl::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DehumidificationControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -12328,8 +13553,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::DehumidificationControl::Id, Id, (uint8_t *) &value, - ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::DehumidificationControl::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace RelativeHumidity @@ -12339,14 +13566,14 @@ namespace DehumidificationCooling { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DehumidificationControl::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DehumidificationControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -12355,8 +13582,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::DehumidificationControl::Id, Id, (uint8_t *) &value, - ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::DehumidificationControl::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace DehumidificationCooling @@ -12366,14 +13595,14 @@ namespace RhDehumidificationSetpoint { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DehumidificationControl::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DehumidificationControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -12382,8 +13611,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::DehumidificationControl::Id, Id, (uint8_t *) &value, - ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::DehumidificationControl::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace RhDehumidificationSetpoint @@ -12393,14 +13624,14 @@ namespace RelativeHumidityMode { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DehumidificationControl::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DehumidificationControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -12409,8 +13640,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::DehumidificationControl::Id, Id, (uint8_t *) &value, - ZCL_ENUM8_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::DehumidificationControl::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } } // namespace RelativeHumidityMode @@ -12420,14 +13653,14 @@ namespace DehumidificationLockout { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DehumidificationControl::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DehumidificationControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -12436,8 +13669,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::DehumidificationControl::Id, Id, (uint8_t *) &value, - ZCL_ENUM8_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::DehumidificationControl::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } } // namespace DehumidificationLockout @@ -12447,14 +13682,14 @@ namespace DehumidificationHysteresis { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DehumidificationControl::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DehumidificationControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -12463,8 +13698,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::DehumidificationControl::Id, Id, (uint8_t *) &value, - ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::DehumidificationControl::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace DehumidificationHysteresis @@ -12474,14 +13711,14 @@ namespace DehumidificationMaxCool { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DehumidificationControl::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DehumidificationControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -12490,8 +13727,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::DehumidificationControl::Id, Id, (uint8_t *) &value, - ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::DehumidificationControl::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace DehumidificationMaxCool @@ -12501,14 +13740,14 @@ namespace RelativeHumidityDisplay { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DehumidificationControl::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DehumidificationControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -12517,8 +13756,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::DehumidificationControl::Id, Id, (uint8_t *) &value, - ZCL_ENUM8_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::DehumidificationControl::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } } // namespace RelativeHumidityDisplay @@ -12534,14 +13775,15 @@ namespace TemperatureDisplayMode { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThermostatUserInterfaceConfiguration::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::ThermostatUserInterfaceConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -12550,7 +13792,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ThermostatUserInterfaceConfiguration::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ThermostatUserInterfaceConfiguration::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -12561,14 +13806,15 @@ namespace KeypadLockout { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThermostatUserInterfaceConfiguration::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::ThermostatUserInterfaceConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -12577,7 +13823,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ThermostatUserInterfaceConfiguration::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ThermostatUserInterfaceConfiguration::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -12588,14 +13837,15 @@ namespace ScheduleProgrammingVisibility { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThermostatUserInterfaceConfiguration::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::ThermostatUserInterfaceConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -12604,7 +13854,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ThermostatUserInterfaceConfiguration::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ThermostatUserInterfaceConfiguration::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -12621,14 +13874,14 @@ namespace CurrentHue { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -12637,7 +13890,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace CurrentHue @@ -12647,14 +13903,14 @@ namespace CurrentSaturation { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -12663,7 +13919,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace CurrentSaturation @@ -12673,14 +13932,14 @@ namespace RemainingTime { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -12689,7 +13948,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace RemainingTime @@ -12699,14 +13961,14 @@ namespace CurrentX { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -12715,7 +13977,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace CurrentX @@ -12725,14 +13990,14 @@ namespace CurrentY { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -12741,7 +14006,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace CurrentY @@ -12751,14 +14019,14 @@ namespace DriftCompensation { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -12767,7 +14035,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } } // namespace DriftCompensation @@ -12807,14 +14078,14 @@ namespace ColorTemperature { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -12823,7 +14094,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace ColorTemperature @@ -12833,14 +14107,14 @@ namespace ColorMode { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -12849,7 +14123,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } } // namespace ColorMode @@ -12859,14 +14136,14 @@ namespace ColorControlOptions { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -12875,7 +14152,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_BITMAP8_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_BITMAP8_ATTRIBUTE_TYPE); } } // namespace ColorControlOptions @@ -12885,14 +14165,14 @@ namespace NumberOfPrimaries { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -12901,7 +14181,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace NumberOfPrimaries @@ -12911,14 +14194,14 @@ namespace Primary1X { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -12927,7 +14210,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace Primary1X @@ -12937,14 +14223,14 @@ namespace Primary1Y { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -12953,7 +14239,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace Primary1Y @@ -12963,14 +14252,14 @@ namespace Primary1Intensity { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -12979,7 +14268,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace Primary1Intensity @@ -12989,14 +14281,14 @@ namespace Primary2X { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -13005,7 +14297,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace Primary2X @@ -13015,14 +14310,14 @@ namespace Primary2Y { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -13031,7 +14326,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace Primary2Y @@ -13041,14 +14339,14 @@ namespace Primary2Intensity { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -13057,7 +14355,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace Primary2Intensity @@ -13067,14 +14368,14 @@ namespace Primary3X { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -13083,7 +14384,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace Primary3X @@ -13093,14 +14397,14 @@ namespace Primary3Y { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -13109,7 +14413,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace Primary3Y @@ -13119,14 +14426,14 @@ namespace Primary3Intensity { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -13135,7 +14442,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace Primary3Intensity @@ -13145,14 +14455,14 @@ namespace Primary4X { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -13161,7 +14471,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace Primary4X @@ -13171,14 +14484,14 @@ namespace Primary4Y { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -13187,7 +14500,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace Primary4Y @@ -13197,14 +14513,14 @@ namespace Primary4Intensity { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -13213,7 +14529,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace Primary4Intensity @@ -13223,14 +14542,14 @@ namespace Primary5X { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -13239,7 +14558,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace Primary5X @@ -13249,14 +14571,14 @@ namespace Primary5Y { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -13265,7 +14587,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace Primary5Y @@ -13275,14 +14600,14 @@ namespace Primary5Intensity { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -13291,7 +14616,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace Primary5Intensity @@ -13301,14 +14629,14 @@ namespace Primary6X { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -13317,7 +14645,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace Primary6X @@ -13327,14 +14658,14 @@ namespace Primary6Y { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -13343,7 +14674,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace Primary6Y @@ -13353,14 +14687,14 @@ namespace Primary6Intensity { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -13369,7 +14703,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace Primary6Intensity @@ -13379,14 +14716,14 @@ namespace WhitePointX { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -13395,7 +14732,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace WhitePointX @@ -13405,14 +14745,14 @@ namespace WhitePointY { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -13421,7 +14761,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace WhitePointY @@ -13431,14 +14774,14 @@ namespace ColorPointRX { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -13447,7 +14790,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace ColorPointRX @@ -13457,14 +14803,14 @@ namespace ColorPointRY { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -13473,7 +14819,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace ColorPointRY @@ -13483,14 +14832,14 @@ namespace ColorPointRIntensity { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -13499,7 +14848,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace ColorPointRIntensity @@ -13509,14 +14861,14 @@ namespace ColorPointGX { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -13525,7 +14877,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace ColorPointGX @@ -13535,14 +14890,14 @@ namespace ColorPointGY { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -13551,7 +14906,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace ColorPointGY @@ -13561,14 +14919,14 @@ namespace ColorPointGIntensity { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -13577,7 +14935,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace ColorPointGIntensity @@ -13587,14 +14948,14 @@ namespace ColorPointBX { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -13603,7 +14964,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace ColorPointBX @@ -13613,14 +14977,14 @@ namespace ColorPointBY { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -13629,7 +14993,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace ColorPointBY @@ -13639,14 +15006,14 @@ namespace ColorPointBIntensity { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -13655,7 +15022,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace ColorPointBIntensity @@ -13665,14 +15035,14 @@ namespace EnhancedCurrentHue { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -13681,7 +15051,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace EnhancedCurrentHue @@ -13691,14 +15064,14 @@ namespace EnhancedColorMode { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -13707,7 +15080,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } } // namespace EnhancedColorMode @@ -13717,14 +15093,14 @@ namespace ColorLoopActive { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -13733,7 +15109,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace ColorLoopActive @@ -13743,14 +15122,14 @@ namespace ColorLoopDirection { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -13759,7 +15138,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace ColorLoopDirection @@ -13769,14 +15151,14 @@ namespace ColorLoopTime { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -13785,7 +15167,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace ColorLoopTime @@ -13795,14 +15180,14 @@ namespace ColorLoopStartEnhancedHue { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -13811,7 +15196,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace ColorLoopStartEnhancedHue @@ -13821,14 +15209,14 @@ namespace ColorLoopStoredEnhancedHue { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -13837,7 +15225,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace ColorLoopStoredEnhancedHue @@ -13847,14 +15238,14 @@ namespace ColorCapabilities { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -13863,7 +15254,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_BITMAP16_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_BITMAP16_ATTRIBUTE_TYPE); } } // namespace ColorCapabilities @@ -13873,14 +15267,14 @@ namespace ColorTempPhysicalMin { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -13889,7 +15283,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace ColorTempPhysicalMin @@ -13899,14 +15296,14 @@ namespace ColorTempPhysicalMax { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -13915,7 +15312,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace ColorTempPhysicalMax @@ -13925,14 +15325,14 @@ namespace CoupleColorTempToLevelMinMireds { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -13941,7 +15341,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace CoupleColorTempToLevelMinMireds @@ -13951,14 +15354,14 @@ namespace StartUpColorTemperatureMireds { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -13967,7 +15370,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace StartUpColorTemperatureMireds @@ -13983,14 +15389,14 @@ namespace PhysicalMinLevel { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -13999,8 +15405,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, (uint8_t *) &value, - ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace PhysicalMinLevel @@ -14010,14 +15418,14 @@ namespace PhysicalMaxLevel { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -14026,8 +15434,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, (uint8_t *) &value, - ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace PhysicalMaxLevel @@ -14037,14 +15447,14 @@ namespace BallastStatus { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -14053,8 +15463,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, (uint8_t *) &value, - ZCL_BITMAP8_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, writable, ZCL_BITMAP8_ATTRIBUTE_TYPE); } } // namespace BallastStatus @@ -14064,14 +15476,14 @@ namespace MinLevel { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -14080,8 +15492,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, (uint8_t *) &value, - ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace MinLevel @@ -14091,14 +15505,14 @@ namespace MaxLevel { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -14107,8 +15521,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, (uint8_t *) &value, - ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace MaxLevel @@ -14118,14 +15534,14 @@ namespace PowerOnLevel { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -14134,8 +15550,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, (uint8_t *) &value, - ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace PowerOnLevel @@ -14145,14 +15563,14 @@ namespace PowerOnFadeTime { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -14161,8 +15579,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, (uint8_t *) &value, - ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace PowerOnFadeTime @@ -14172,14 +15592,14 @@ namespace IntrinsicBallastFactor { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -14188,8 +15608,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, (uint8_t *) &value, - ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace IntrinsicBallastFactor @@ -14199,14 +15621,14 @@ namespace BallastFactorAdjustment { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -14215,8 +15637,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, (uint8_t *) &value, - ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace BallastFactorAdjustment @@ -14226,14 +15650,14 @@ namespace LampQuality { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -14242,8 +15666,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, (uint8_t *) &value, - ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace LampQuality @@ -14310,19 +15736,77 @@ EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) } // namespace LampManufacturer +namespace LampRatedHours { + +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) +{ + NumericAttributeTraits>::StorageType temp; + uint8_t * readable = NumericAttributeTraits>::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits>::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = NumericAttributeTraits>::StorageToWorking(temp); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) +{ + if (!NumericAttributeTraits>::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } + NumericAttributeTraits>::StorageType storageValue; + NumericAttributeTraits>::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits>::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, writable, ZCL_INT24U_ATTRIBUTE_TYPE); +} + +} // namespace LampRatedHours + +namespace LampBurnHours { + +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) +{ + NumericAttributeTraits>::StorageType temp; + uint8_t * readable = NumericAttributeTraits>::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits>::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = NumericAttributeTraits>::StorageToWorking(temp); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) +{ + if (!NumericAttributeTraits>::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } + NumericAttributeTraits>::StorageType storageValue; + NumericAttributeTraits>::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits>::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, writable, ZCL_INT24U_ATTRIBUTE_TYPE); +} + +} // namespace LampBurnHours + namespace LampAlarmMode { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -14331,12 +15815,43 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, (uint8_t *) &value, - ZCL_BITMAP8_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, writable, ZCL_BITMAP8_ATTRIBUTE_TYPE); } } // namespace LampAlarmMode +namespace LampBurnHoursTripPoint { + +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) +{ + NumericAttributeTraits>::StorageType temp; + uint8_t * readable = NumericAttributeTraits>::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits>::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = NumericAttributeTraits>::StorageToWorking(temp); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) +{ + if (!NumericAttributeTraits>::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } + NumericAttributeTraits>::StorageType storageValue; + NumericAttributeTraits>::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits>::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, writable, ZCL_INT24U_ATTRIBUTE_TYPE); +} + +} // namespace LampBurnHoursTripPoint + } // namespace Attributes } // namespace BallastConfiguration @@ -14348,8 +15863,8 @@ namespace MeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::IlluminanceMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::IlluminanceMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (NumericAttributeTraits::IsNullValue(temp)) { @@ -14357,7 +15872,7 @@ EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & val } else { - value.SetNonNull() = temp; + value.SetNonNull() = NumericAttributeTraits::StorageToWorking(temp); } return status; } @@ -14367,15 +15882,18 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::IlluminanceMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::IlluminanceMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } EmberAfStatus SetNull(chip::EndpointId endpoint) { - auto value = NumericAttributeTraits::kNullValue; - return emberAfWriteServerAttribute(endpoint, Clusters::IlluminanceMeasurement::Id, Id, reinterpret_cast(&value), - ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType value; + NumericAttributeTraits::SetNull(value); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(value); + return emberAfWriteServerAttribute(endpoint, Clusters::IlluminanceMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value) @@ -14395,8 +15913,8 @@ namespace MinMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::IlluminanceMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::IlluminanceMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (NumericAttributeTraits::IsNullValue(temp)) { @@ -14404,7 +15922,7 @@ EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & val } else { - value.SetNonNull() = temp; + value.SetNonNull() = NumericAttributeTraits::StorageToWorking(temp); } return status; } @@ -14414,15 +15932,18 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::IlluminanceMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::IlluminanceMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } EmberAfStatus SetNull(chip::EndpointId endpoint) { - auto value = NumericAttributeTraits::kNullValue; - return emberAfWriteServerAttribute(endpoint, Clusters::IlluminanceMeasurement::Id, Id, reinterpret_cast(&value), - ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType value; + NumericAttributeTraits::SetNull(value); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(value); + return emberAfWriteServerAttribute(endpoint, Clusters::IlluminanceMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value) @@ -14442,8 +15963,8 @@ namespace MaxMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::IlluminanceMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::IlluminanceMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (NumericAttributeTraits::IsNullValue(temp)) { @@ -14451,7 +15972,7 @@ EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & val } else { - value.SetNonNull() = temp; + value.SetNonNull() = NumericAttributeTraits::StorageToWorking(temp); } return status; } @@ -14461,15 +15982,18 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::IlluminanceMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::IlluminanceMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } EmberAfStatus SetNull(chip::EndpointId endpoint) { - auto value = NumericAttributeTraits::kNullValue; - return emberAfWriteServerAttribute(endpoint, Clusters::IlluminanceMeasurement::Id, Id, reinterpret_cast(&value), - ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType value; + NumericAttributeTraits::SetNull(value); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(value); + return emberAfWriteServerAttribute(endpoint, Clusters::IlluminanceMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value) @@ -14489,14 +16013,14 @@ namespace Tolerance { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::IlluminanceMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::IlluminanceMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -14505,8 +16029,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::IlluminanceMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::IlluminanceMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace Tolerance @@ -14516,8 +16042,8 @@ namespace LightSensorType { EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::IlluminanceMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::IlluminanceMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (NumericAttributeTraits::IsNullValue(temp)) { @@ -14525,7 +16051,7 @@ EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & valu } else { - value.SetNonNull() = temp; + value.SetNonNull() = NumericAttributeTraits::StorageToWorking(temp); } return status; } @@ -14535,15 +16061,18 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::IlluminanceMeasurement::Id, Id, (uint8_t *) &value, - ZCL_ENUM8_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::IlluminanceMeasurement::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } EmberAfStatus SetNull(chip::EndpointId endpoint) { - auto value = NumericAttributeTraits::kNullValue; - return emberAfWriteServerAttribute(endpoint, Clusters::IlluminanceMeasurement::Id, Id, reinterpret_cast(&value), - ZCL_ENUM8_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType value; + NumericAttributeTraits::SetNull(value); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(value); + return emberAfWriteServerAttribute(endpoint, Clusters::IlluminanceMeasurement::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value) @@ -14569,14 +16098,14 @@ namespace MeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TemperatureMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TemperatureMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) @@ -14585,8 +16114,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::TemperatureMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16S_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::TemperatureMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } } // namespace MeasuredValue @@ -14596,14 +16127,14 @@ namespace MinMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TemperatureMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TemperatureMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) @@ -14612,8 +16143,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::TemperatureMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16S_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::TemperatureMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } } // namespace MinMeasuredValue @@ -14623,14 +16156,14 @@ namespace MaxMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TemperatureMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TemperatureMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) @@ -14639,8 +16172,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::TemperatureMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16S_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::TemperatureMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } } // namespace MaxMeasuredValue @@ -14650,14 +16185,14 @@ namespace Tolerance { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TemperatureMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TemperatureMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -14666,8 +16201,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::TemperatureMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::TemperatureMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace Tolerance @@ -14683,14 +16220,14 @@ namespace MeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) @@ -14699,8 +16236,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16S_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } } // namespace MeasuredValue @@ -14710,14 +16249,14 @@ namespace MinMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) @@ -14726,8 +16265,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16S_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } } // namespace MinMeasuredValue @@ -14737,14 +16278,14 @@ namespace MaxMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) @@ -14753,8 +16294,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16S_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } } // namespace MaxMeasuredValue @@ -14764,14 +16307,14 @@ namespace Tolerance { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -14780,8 +16323,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace Tolerance @@ -14791,14 +16336,14 @@ namespace ScaledValue { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) @@ -14807,8 +16352,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16S_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } } // namespace ScaledValue @@ -14818,14 +16365,14 @@ namespace MinScaledValue { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) @@ -14834,8 +16381,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16S_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } } // namespace MinScaledValue @@ -14845,14 +16394,14 @@ namespace MaxScaledValue { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) @@ -14861,8 +16410,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16S_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } } // namespace MaxScaledValue @@ -14872,14 +16423,14 @@ namespace ScaledTolerance { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -14888,8 +16439,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace ScaledTolerance @@ -14899,14 +16452,14 @@ namespace Scale { EmberAfStatus Get(chip::EndpointId endpoint, int8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int8_t value) @@ -14915,8 +16468,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, int8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT8S_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, writable, ZCL_INT8S_ATTRIBUTE_TYPE); } } // namespace Scale @@ -14932,14 +16487,14 @@ namespace MeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::FlowMeasurement::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::FlowMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) @@ -14948,7 +16503,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::FlowMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::FlowMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } } // namespace MeasuredValue @@ -14958,14 +16516,14 @@ namespace MinMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::FlowMeasurement::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::FlowMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) @@ -14974,7 +16532,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::FlowMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::FlowMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } } // namespace MinMeasuredValue @@ -14984,14 +16545,14 @@ namespace MaxMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::FlowMeasurement::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::FlowMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) @@ -15000,7 +16561,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::FlowMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::FlowMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } } // namespace MaxMeasuredValue @@ -15010,14 +16574,14 @@ namespace Tolerance { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::FlowMeasurement::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::FlowMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -15026,7 +16590,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::FlowMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::FlowMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace Tolerance @@ -15042,14 +16609,15 @@ namespace MeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::RelativeHumidityMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::RelativeHumidityMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -15058,7 +16626,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::RelativeHumidityMeasurement::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::RelativeHumidityMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -15069,14 +16640,15 @@ namespace MinMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::RelativeHumidityMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::RelativeHumidityMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -15085,7 +16657,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::RelativeHumidityMeasurement::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::RelativeHumidityMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -15096,14 +16671,15 @@ namespace MaxMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::RelativeHumidityMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::RelativeHumidityMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -15112,7 +16688,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::RelativeHumidityMeasurement::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::RelativeHumidityMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -15123,14 +16702,15 @@ namespace Tolerance { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::RelativeHumidityMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::RelativeHumidityMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -15139,7 +16719,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::RelativeHumidityMeasurement::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::RelativeHumidityMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -15156,14 +16739,14 @@ namespace Occupancy { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -15172,8 +16755,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, (uint8_t *) &value, - ZCL_BITMAP8_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, writable, ZCL_BITMAP8_ATTRIBUTE_TYPE); } } // namespace Occupancy @@ -15183,14 +16768,14 @@ namespace OccupancySensorType { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -15199,7 +16784,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } } // namespace OccupancySensorType @@ -15209,14 +16797,14 @@ namespace OccupancySensorTypeBitmap { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -15225,8 +16813,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, (uint8_t *) &value, - ZCL_BITMAP8_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, writable, ZCL_BITMAP8_ATTRIBUTE_TYPE); } } // namespace OccupancySensorTypeBitmap @@ -15236,14 +16826,14 @@ namespace PirOccupiedToUnoccupiedDelay { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -15252,7 +16842,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace PirOccupiedToUnoccupiedDelay @@ -15262,14 +16855,14 @@ namespace PirUnoccupiedToOccupiedDelay { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -15278,7 +16871,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace PirUnoccupiedToOccupiedDelay @@ -15288,14 +16884,14 @@ namespace PirUnoccupiedToOccupiedThreshold { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -15304,7 +16900,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace PirUnoccupiedToOccupiedThreshold @@ -15314,14 +16913,14 @@ namespace UltrasonicOccupiedToUnoccupiedDelay { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -15330,7 +16929,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace UltrasonicOccupiedToUnoccupiedDelay @@ -15340,14 +16942,14 @@ namespace UltrasonicUnoccupiedToOccupiedDelay { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -15356,7 +16958,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace UltrasonicUnoccupiedToOccupiedDelay @@ -15366,14 +16971,14 @@ namespace UltrasonicUnoccupiedToOccupiedThreshold { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -15382,7 +16987,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace UltrasonicUnoccupiedToOccupiedThreshold @@ -15392,14 +17000,14 @@ namespace PhysicalContactOccupiedToUnoccupiedDelay { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -15408,7 +17016,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace PhysicalContactOccupiedToUnoccupiedDelay @@ -15418,14 +17029,14 @@ namespace PhysicalContactUnoccupiedToOccupiedDelay { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -15434,7 +17045,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace PhysicalContactUnoccupiedToOccupiedDelay @@ -15444,14 +17058,14 @@ namespace PhysicalContactUnoccupiedToOccupiedThreshold { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -15460,7 +17074,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace PhysicalContactUnoccupiedToOccupiedThreshold @@ -15476,14 +17093,15 @@ namespace MeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::CarbonMonoxideConcentrationMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::CarbonMonoxideConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) @@ -15492,7 +17110,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, float value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::CarbonMonoxideConcentrationMeasurement::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::CarbonMonoxideConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -15503,14 +17124,15 @@ namespace MinMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::CarbonMonoxideConcentrationMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::CarbonMonoxideConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) @@ -15519,7 +17141,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, float value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::CarbonMonoxideConcentrationMeasurement::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::CarbonMonoxideConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -15530,14 +17155,15 @@ namespace MaxMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::CarbonMonoxideConcentrationMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::CarbonMonoxideConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) @@ -15546,7 +17172,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, float value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::CarbonMonoxideConcentrationMeasurement::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::CarbonMonoxideConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -15557,14 +17186,15 @@ namespace Tolerance { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::CarbonMonoxideConcentrationMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::CarbonMonoxideConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) @@ -15573,7 +17203,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, float value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::CarbonMonoxideConcentrationMeasurement::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::CarbonMonoxideConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -15590,14 +17223,15 @@ namespace MeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::CarbonDioxideConcentrationMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::CarbonDioxideConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) @@ -15606,7 +17240,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, float value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::CarbonDioxideConcentrationMeasurement::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::CarbonDioxideConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -15617,14 +17254,15 @@ namespace MinMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::CarbonDioxideConcentrationMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::CarbonDioxideConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) @@ -15633,7 +17271,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, float value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::CarbonDioxideConcentrationMeasurement::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::CarbonDioxideConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -15644,14 +17285,15 @@ namespace MaxMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::CarbonDioxideConcentrationMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::CarbonDioxideConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) @@ -15660,7 +17302,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, float value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::CarbonDioxideConcentrationMeasurement::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::CarbonDioxideConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -15671,14 +17316,15 @@ namespace Tolerance { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::CarbonDioxideConcentrationMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::CarbonDioxideConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) @@ -15687,7 +17333,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, float value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::CarbonDioxideConcentrationMeasurement::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::CarbonDioxideConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -15704,14 +17353,15 @@ namespace MeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::EthyleneConcentrationMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::EthyleneConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) @@ -15720,7 +17370,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, float value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::EthyleneConcentrationMeasurement::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::EthyleneConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -15731,14 +17384,15 @@ namespace MinMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::EthyleneConcentrationMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::EthyleneConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) @@ -15747,7 +17401,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, float value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::EthyleneConcentrationMeasurement::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::EthyleneConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -15758,14 +17415,15 @@ namespace MaxMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::EthyleneConcentrationMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::EthyleneConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) @@ -15774,7 +17432,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, float value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::EthyleneConcentrationMeasurement::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::EthyleneConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -15785,14 +17446,15 @@ namespace Tolerance { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::EthyleneConcentrationMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::EthyleneConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) @@ -15801,7 +17463,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, float value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::EthyleneConcentrationMeasurement::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::EthyleneConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -15818,14 +17483,15 @@ namespace MeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::EthyleneOxideConcentrationMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::EthyleneOxideConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) @@ -15834,7 +17500,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, float value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::EthyleneOxideConcentrationMeasurement::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::EthyleneOxideConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -15845,14 +17514,15 @@ namespace MinMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::EthyleneOxideConcentrationMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::EthyleneOxideConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) @@ -15861,7 +17531,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, float value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::EthyleneOxideConcentrationMeasurement::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::EthyleneOxideConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -15872,14 +17545,15 @@ namespace MaxMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::EthyleneOxideConcentrationMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::EthyleneOxideConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) @@ -15888,7 +17562,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, float value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::EthyleneOxideConcentrationMeasurement::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::EthyleneOxideConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -15899,14 +17576,15 @@ namespace Tolerance { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::EthyleneOxideConcentrationMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::EthyleneOxideConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) @@ -15915,7 +17593,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, float value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::EthyleneOxideConcentrationMeasurement::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::EthyleneOxideConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -15932,14 +17613,15 @@ namespace MeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::HydrogenConcentrationMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::HydrogenConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) @@ -15948,7 +17630,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, float value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::HydrogenConcentrationMeasurement::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::HydrogenConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -15959,14 +17644,15 @@ namespace MinMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::HydrogenConcentrationMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::HydrogenConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) @@ -15975,7 +17661,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, float value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::HydrogenConcentrationMeasurement::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::HydrogenConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -15986,14 +17675,15 @@ namespace MaxMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::HydrogenConcentrationMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::HydrogenConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) @@ -16002,7 +17692,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, float value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::HydrogenConcentrationMeasurement::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::HydrogenConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -16013,14 +17706,15 @@ namespace Tolerance { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::HydrogenConcentrationMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::HydrogenConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) @@ -16029,7 +17723,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, float value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::HydrogenConcentrationMeasurement::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::HydrogenConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -16046,14 +17743,15 @@ namespace MeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::HydrogenSulphideConcentrationMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::HydrogenSulphideConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) @@ -16062,7 +17760,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, float value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::HydrogenSulphideConcentrationMeasurement::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::HydrogenSulphideConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -16073,14 +17774,15 @@ namespace MinMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::HydrogenSulphideConcentrationMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::HydrogenSulphideConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) @@ -16089,7 +17791,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, float value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::HydrogenSulphideConcentrationMeasurement::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::HydrogenSulphideConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -16100,14 +17805,15 @@ namespace MaxMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::HydrogenSulphideConcentrationMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::HydrogenSulphideConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) @@ -16116,7 +17822,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, float value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::HydrogenSulphideConcentrationMeasurement::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::HydrogenSulphideConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -16127,14 +17836,15 @@ namespace Tolerance { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::HydrogenSulphideConcentrationMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::HydrogenSulphideConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) @@ -16143,7 +17853,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, float value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::HydrogenSulphideConcentrationMeasurement::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::HydrogenSulphideConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -16160,14 +17873,15 @@ namespace MeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::NitricOxideConcentrationMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::NitricOxideConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) @@ -16176,7 +17890,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, float value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::NitricOxideConcentrationMeasurement::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::NitricOxideConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -16187,14 +17904,15 @@ namespace MinMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::NitricOxideConcentrationMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::NitricOxideConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) @@ -16203,7 +17921,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, float value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::NitricOxideConcentrationMeasurement::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::NitricOxideConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -16214,14 +17935,15 @@ namespace MaxMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::NitricOxideConcentrationMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::NitricOxideConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) @@ -16230,7 +17952,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, float value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::NitricOxideConcentrationMeasurement::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::NitricOxideConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -16241,14 +17966,15 @@ namespace Tolerance { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::NitricOxideConcentrationMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::NitricOxideConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) @@ -16257,7 +17983,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, float value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::NitricOxideConcentrationMeasurement::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::NitricOxideConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -16274,14 +18003,15 @@ namespace MeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::NitrogenDioxideConcentrationMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::NitrogenDioxideConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) @@ -16290,7 +18020,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, float value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::NitrogenDioxideConcentrationMeasurement::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::NitrogenDioxideConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -16301,14 +18034,15 @@ namespace MinMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::NitrogenDioxideConcentrationMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::NitrogenDioxideConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) @@ -16317,7 +18051,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, float value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::NitrogenDioxideConcentrationMeasurement::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::NitrogenDioxideConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -16328,14 +18065,15 @@ namespace MaxMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::NitrogenDioxideConcentrationMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::NitrogenDioxideConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) @@ -16344,7 +18082,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, float value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::NitrogenDioxideConcentrationMeasurement::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::NitrogenDioxideConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -16355,14 +18096,15 @@ namespace Tolerance { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::NitrogenDioxideConcentrationMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::NitrogenDioxideConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) @@ -16371,7 +18113,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, float value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::NitrogenDioxideConcentrationMeasurement::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::NitrogenDioxideConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -16388,14 +18133,15 @@ namespace MeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::OxygenConcentrationMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::OxygenConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) @@ -16404,7 +18150,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, float value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::OxygenConcentrationMeasurement::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::OxygenConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -16415,14 +18164,15 @@ namespace MinMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::OxygenConcentrationMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::OxygenConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) @@ -16431,7 +18181,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, float value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::OxygenConcentrationMeasurement::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::OxygenConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -16442,14 +18195,15 @@ namespace MaxMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::OxygenConcentrationMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::OxygenConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) @@ -16458,7 +18212,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, float value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::OxygenConcentrationMeasurement::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::OxygenConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -16469,14 +18226,15 @@ namespace Tolerance { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::OxygenConcentrationMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::OxygenConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) @@ -16485,7 +18243,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, float value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::OxygenConcentrationMeasurement::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::OxygenConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -16502,14 +18263,15 @@ namespace MeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::OzoneConcentrationMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::OzoneConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) @@ -16518,7 +18280,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, float value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::OzoneConcentrationMeasurement::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::OzoneConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -16529,14 +18294,15 @@ namespace MinMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::OzoneConcentrationMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::OzoneConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) @@ -16545,7 +18311,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, float value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::OzoneConcentrationMeasurement::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::OzoneConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -16556,14 +18325,15 @@ namespace MaxMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::OzoneConcentrationMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::OzoneConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) @@ -16572,7 +18342,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, float value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::OzoneConcentrationMeasurement::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::OzoneConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -16583,14 +18356,15 @@ namespace Tolerance { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::OzoneConcentrationMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::OzoneConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) @@ -16599,7 +18373,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, float value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::OzoneConcentrationMeasurement::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::OzoneConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -16616,14 +18393,15 @@ namespace MeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::SulfurDioxideConcentrationMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::SulfurDioxideConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) @@ -16632,7 +18410,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, float value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::SulfurDioxideConcentrationMeasurement::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::SulfurDioxideConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -16643,14 +18424,15 @@ namespace MinMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::SulfurDioxideConcentrationMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::SulfurDioxideConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) @@ -16659,7 +18441,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, float value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::SulfurDioxideConcentrationMeasurement::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::SulfurDioxideConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -16670,14 +18455,15 @@ namespace MaxMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::SulfurDioxideConcentrationMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::SulfurDioxideConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) @@ -16686,7 +18472,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, float value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::SulfurDioxideConcentrationMeasurement::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::SulfurDioxideConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -16697,14 +18486,15 @@ namespace Tolerance { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::SulfurDioxideConcentrationMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::SulfurDioxideConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) @@ -16713,7 +18503,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, float value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::SulfurDioxideConcentrationMeasurement::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::SulfurDioxideConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -16730,14 +18523,15 @@ namespace MeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DissolvedOxygenConcentrationMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::DissolvedOxygenConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) @@ -16746,7 +18540,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, float value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::DissolvedOxygenConcentrationMeasurement::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::DissolvedOxygenConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -16757,14 +18554,15 @@ namespace MinMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DissolvedOxygenConcentrationMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::DissolvedOxygenConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) @@ -16773,7 +18571,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, float value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::DissolvedOxygenConcentrationMeasurement::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::DissolvedOxygenConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -16784,14 +18585,15 @@ namespace MaxMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DissolvedOxygenConcentrationMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::DissolvedOxygenConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) @@ -16800,7 +18602,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, float value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::DissolvedOxygenConcentrationMeasurement::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::DissolvedOxygenConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -16811,14 +18616,15 @@ namespace Tolerance { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DissolvedOxygenConcentrationMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::DissolvedOxygenConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) @@ -16827,7 +18633,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, float value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::DissolvedOxygenConcentrationMeasurement::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::DissolvedOxygenConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -16844,14 +18653,15 @@ namespace MeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BromateConcentrationMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::BromateConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) @@ -16860,7 +18670,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, float value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::BromateConcentrationMeasurement::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::BromateConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -16871,14 +18684,15 @@ namespace MinMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BromateConcentrationMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::BromateConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) @@ -16887,7 +18701,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, float value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::BromateConcentrationMeasurement::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::BromateConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -16898,14 +18715,15 @@ namespace MaxMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BromateConcentrationMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::BromateConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) @@ -16914,7 +18732,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, float value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::BromateConcentrationMeasurement::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::BromateConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -16925,14 +18746,15 @@ namespace Tolerance { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BromateConcentrationMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::BromateConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) @@ -16941,7 +18763,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, float value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::BromateConcentrationMeasurement::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::BromateConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -16958,14 +18783,15 @@ namespace MeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ChloraminesConcentrationMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::ChloraminesConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) @@ -16974,7 +18800,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, float value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ChloraminesConcentrationMeasurement::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ChloraminesConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -16985,14 +18814,15 @@ namespace MinMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ChloraminesConcentrationMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::ChloraminesConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) @@ -17001,7 +18831,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, float value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ChloraminesConcentrationMeasurement::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ChloraminesConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -17012,14 +18845,15 @@ namespace MaxMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ChloraminesConcentrationMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::ChloraminesConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) @@ -17028,7 +18862,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, float value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ChloraminesConcentrationMeasurement::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ChloraminesConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -17039,14 +18876,15 @@ namespace Tolerance { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ChloraminesConcentrationMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::ChloraminesConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) @@ -17055,7 +18893,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, float value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ChloraminesConcentrationMeasurement::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ChloraminesConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -17072,14 +18913,15 @@ namespace MeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ChlorineConcentrationMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::ChlorineConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) @@ -17088,7 +18930,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, float value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ChlorineConcentrationMeasurement::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ChlorineConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -17099,14 +18944,15 @@ namespace MinMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ChlorineConcentrationMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::ChlorineConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) @@ -17115,7 +18961,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, float value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ChlorineConcentrationMeasurement::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ChlorineConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -17126,14 +18975,15 @@ namespace MaxMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ChlorineConcentrationMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::ChlorineConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) @@ -17142,7 +18992,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, float value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ChlorineConcentrationMeasurement::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ChlorineConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -17153,14 +19006,15 @@ namespace Tolerance { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ChlorineConcentrationMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::ChlorineConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) @@ -17169,7 +19023,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, float value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ChlorineConcentrationMeasurement::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ChlorineConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -17186,14 +19043,15 @@ namespace MeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { NumericAttributeTraits::StorageType temp; + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::FecalColiformAndEColiConcentrationMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) @@ -17202,8 +19060,11 @@ EmberAfStatus Set(chip::EndpointId endpoint, float value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::FecalColiformAndEColiConcentrationMeasurement::Id, Id, - (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::FecalColiformAndEColiConcentrationMeasurement::Id, Id, writable, + ZCL_SINGLE_ATTRIBUTE_TYPE); } } // namespace MeasuredValue @@ -17213,14 +19074,15 @@ namespace MinMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { NumericAttributeTraits::StorageType temp; + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::FecalColiformAndEColiConcentrationMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) @@ -17229,8 +19091,11 @@ EmberAfStatus Set(chip::EndpointId endpoint, float value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::FecalColiformAndEColiConcentrationMeasurement::Id, Id, - (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::FecalColiformAndEColiConcentrationMeasurement::Id, Id, writable, + ZCL_SINGLE_ATTRIBUTE_TYPE); } } // namespace MinMeasuredValue @@ -17240,14 +19105,15 @@ namespace MaxMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { NumericAttributeTraits::StorageType temp; + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::FecalColiformAndEColiConcentrationMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) @@ -17256,8 +19122,11 @@ EmberAfStatus Set(chip::EndpointId endpoint, float value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::FecalColiformAndEColiConcentrationMeasurement::Id, Id, - (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::FecalColiformAndEColiConcentrationMeasurement::Id, Id, writable, + ZCL_SINGLE_ATTRIBUTE_TYPE); } } // namespace MaxMeasuredValue @@ -17267,14 +19136,15 @@ namespace Tolerance { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { NumericAttributeTraits::StorageType temp; + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::FecalColiformAndEColiConcentrationMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) @@ -17283,8 +19153,11 @@ EmberAfStatus Set(chip::EndpointId endpoint, float value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::FecalColiformAndEColiConcentrationMeasurement::Id, Id, - (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::FecalColiformAndEColiConcentrationMeasurement::Id, Id, writable, + ZCL_SINGLE_ATTRIBUTE_TYPE); } } // namespace Tolerance @@ -17300,14 +19173,15 @@ namespace MeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::FluorideConcentrationMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::FluorideConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) @@ -17316,7 +19190,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, float value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::FluorideConcentrationMeasurement::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::FluorideConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -17327,14 +19204,15 @@ namespace MinMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::FluorideConcentrationMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::FluorideConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) @@ -17343,7 +19221,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, float value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::FluorideConcentrationMeasurement::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::FluorideConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -17354,14 +19235,15 @@ namespace MaxMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::FluorideConcentrationMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::FluorideConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) @@ -17370,7 +19252,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, float value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::FluorideConcentrationMeasurement::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::FluorideConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -17381,14 +19266,15 @@ namespace Tolerance { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::FluorideConcentrationMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::FluorideConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) @@ -17397,7 +19283,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, float value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::FluorideConcentrationMeasurement::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::FluorideConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -17414,14 +19303,15 @@ namespace MeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::HaloaceticAcidsConcentrationMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::HaloaceticAcidsConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) @@ -17430,7 +19320,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, float value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::HaloaceticAcidsConcentrationMeasurement::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::HaloaceticAcidsConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -17441,14 +19334,15 @@ namespace MinMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::HaloaceticAcidsConcentrationMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::HaloaceticAcidsConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) @@ -17457,7 +19351,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, float value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::HaloaceticAcidsConcentrationMeasurement::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::HaloaceticAcidsConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -17468,14 +19365,15 @@ namespace MaxMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::HaloaceticAcidsConcentrationMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::HaloaceticAcidsConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) @@ -17484,7 +19382,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, float value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::HaloaceticAcidsConcentrationMeasurement::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::HaloaceticAcidsConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -17495,14 +19396,15 @@ namespace Tolerance { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::HaloaceticAcidsConcentrationMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::HaloaceticAcidsConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) @@ -17511,7 +19413,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, float value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::HaloaceticAcidsConcentrationMeasurement::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::HaloaceticAcidsConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -17528,14 +19433,15 @@ namespace MeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { NumericAttributeTraits::StorageType temp; + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TotalTrihalomethanesConcentrationMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) @@ -17544,7 +19450,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, float value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::TotalTrihalomethanesConcentrationMeasurement::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::TotalTrihalomethanesConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -17555,14 +19464,15 @@ namespace MinMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { NumericAttributeTraits::StorageType temp; + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TotalTrihalomethanesConcentrationMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) @@ -17571,7 +19481,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, float value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::TotalTrihalomethanesConcentrationMeasurement::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::TotalTrihalomethanesConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -17582,14 +19495,15 @@ namespace MaxMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { NumericAttributeTraits::StorageType temp; + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TotalTrihalomethanesConcentrationMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) @@ -17598,7 +19512,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, float value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::TotalTrihalomethanesConcentrationMeasurement::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::TotalTrihalomethanesConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -17609,14 +19526,15 @@ namespace Tolerance { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { NumericAttributeTraits::StorageType temp; + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TotalTrihalomethanesConcentrationMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) @@ -17625,7 +19543,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, float value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::TotalTrihalomethanesConcentrationMeasurement::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::TotalTrihalomethanesConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -17642,14 +19563,15 @@ namespace MeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { NumericAttributeTraits::StorageType temp; + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TotalColiformBacteriaConcentrationMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) @@ -17658,8 +19580,11 @@ EmberAfStatus Set(chip::EndpointId endpoint, float value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::TotalColiformBacteriaConcentrationMeasurement::Id, Id, - (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::TotalColiformBacteriaConcentrationMeasurement::Id, Id, writable, + ZCL_SINGLE_ATTRIBUTE_TYPE); } } // namespace MeasuredValue @@ -17669,14 +19594,15 @@ namespace MinMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { NumericAttributeTraits::StorageType temp; + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TotalColiformBacteriaConcentrationMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) @@ -17685,8 +19611,11 @@ EmberAfStatus Set(chip::EndpointId endpoint, float value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::TotalColiformBacteriaConcentrationMeasurement::Id, Id, - (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::TotalColiformBacteriaConcentrationMeasurement::Id, Id, writable, + ZCL_SINGLE_ATTRIBUTE_TYPE); } } // namespace MinMeasuredValue @@ -17696,14 +19625,15 @@ namespace MaxMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { NumericAttributeTraits::StorageType temp; + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TotalColiformBacteriaConcentrationMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) @@ -17712,8 +19642,11 @@ EmberAfStatus Set(chip::EndpointId endpoint, float value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::TotalColiformBacteriaConcentrationMeasurement::Id, Id, - (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::TotalColiformBacteriaConcentrationMeasurement::Id, Id, writable, + ZCL_SINGLE_ATTRIBUTE_TYPE); } } // namespace MaxMeasuredValue @@ -17723,14 +19656,15 @@ namespace Tolerance { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { NumericAttributeTraits::StorageType temp; + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TotalColiformBacteriaConcentrationMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) @@ -17739,8 +19673,11 @@ EmberAfStatus Set(chip::EndpointId endpoint, float value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::TotalColiformBacteriaConcentrationMeasurement::Id, Id, - (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::TotalColiformBacteriaConcentrationMeasurement::Id, Id, writable, + ZCL_SINGLE_ATTRIBUTE_TYPE); } } // namespace Tolerance @@ -17756,14 +19693,15 @@ namespace MeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TurbidityConcentrationMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::TurbidityConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) @@ -17772,7 +19710,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, float value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::TurbidityConcentrationMeasurement::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::TurbidityConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -17783,14 +19724,15 @@ namespace MinMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TurbidityConcentrationMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::TurbidityConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) @@ -17799,7 +19741,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, float value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::TurbidityConcentrationMeasurement::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::TurbidityConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -17810,14 +19755,15 @@ namespace MaxMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TurbidityConcentrationMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::TurbidityConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) @@ -17826,7 +19772,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, float value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::TurbidityConcentrationMeasurement::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::TurbidityConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -17837,14 +19786,15 @@ namespace Tolerance { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TurbidityConcentrationMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::TurbidityConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) @@ -17853,7 +19803,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, float value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::TurbidityConcentrationMeasurement::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::TurbidityConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -17870,14 +19823,15 @@ namespace MeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::CopperConcentrationMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::CopperConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) @@ -17886,7 +19840,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, float value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::CopperConcentrationMeasurement::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::CopperConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -17897,14 +19854,15 @@ namespace MinMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::CopperConcentrationMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::CopperConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) @@ -17913,7 +19871,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, float value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::CopperConcentrationMeasurement::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::CopperConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -17924,14 +19885,15 @@ namespace MaxMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::CopperConcentrationMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::CopperConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) @@ -17940,7 +19902,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, float value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::CopperConcentrationMeasurement::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::CopperConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -17951,14 +19916,15 @@ namespace Tolerance { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::CopperConcentrationMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::CopperConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) @@ -17967,7 +19933,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, float value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::CopperConcentrationMeasurement::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::CopperConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -17984,14 +19953,15 @@ namespace MeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::LeadConcentrationMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::LeadConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) @@ -18000,7 +19970,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, float value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::LeadConcentrationMeasurement::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::LeadConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -18011,14 +19984,15 @@ namespace MinMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::LeadConcentrationMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::LeadConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) @@ -18027,7 +20001,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, float value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::LeadConcentrationMeasurement::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::LeadConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -18038,14 +20015,15 @@ namespace MaxMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::LeadConcentrationMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::LeadConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) @@ -18054,7 +20032,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, float value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::LeadConcentrationMeasurement::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::LeadConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -18065,14 +20046,15 @@ namespace Tolerance { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::LeadConcentrationMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::LeadConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) @@ -18081,7 +20063,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, float value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::LeadConcentrationMeasurement::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::LeadConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -18098,14 +20083,15 @@ namespace MeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ManganeseConcentrationMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::ManganeseConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) @@ -18114,7 +20100,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, float value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ManganeseConcentrationMeasurement::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ManganeseConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -18125,14 +20114,15 @@ namespace MinMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ManganeseConcentrationMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::ManganeseConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) @@ -18141,7 +20131,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, float value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ManganeseConcentrationMeasurement::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ManganeseConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -18152,14 +20145,15 @@ namespace MaxMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ManganeseConcentrationMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::ManganeseConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) @@ -18168,7 +20162,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, float value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ManganeseConcentrationMeasurement::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ManganeseConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -18179,14 +20176,15 @@ namespace Tolerance { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ManganeseConcentrationMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::ManganeseConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) @@ -18195,7 +20193,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, float value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ManganeseConcentrationMeasurement::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ManganeseConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -18212,14 +20213,15 @@ namespace MeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::SulfateConcentrationMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::SulfateConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) @@ -18228,7 +20230,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, float value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::SulfateConcentrationMeasurement::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::SulfateConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -18239,14 +20244,15 @@ namespace MinMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::SulfateConcentrationMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::SulfateConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) @@ -18255,7 +20261,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, float value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::SulfateConcentrationMeasurement::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::SulfateConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -18266,14 +20275,15 @@ namespace MaxMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::SulfateConcentrationMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::SulfateConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) @@ -18282,7 +20292,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, float value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::SulfateConcentrationMeasurement::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::SulfateConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -18293,14 +20306,15 @@ namespace Tolerance { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::SulfateConcentrationMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::SulfateConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) @@ -18309,7 +20323,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, float value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::SulfateConcentrationMeasurement::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::SulfateConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -18326,14 +20343,15 @@ namespace MeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { NumericAttributeTraits::StorageType temp; + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BromodichloromethaneConcentrationMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) @@ -18342,7 +20360,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, float value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::BromodichloromethaneConcentrationMeasurement::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::BromodichloromethaneConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -18353,14 +20374,15 @@ namespace MinMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { NumericAttributeTraits::StorageType temp; + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BromodichloromethaneConcentrationMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) @@ -18369,7 +20391,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, float value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::BromodichloromethaneConcentrationMeasurement::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::BromodichloromethaneConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -18380,14 +20405,15 @@ namespace MaxMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { NumericAttributeTraits::StorageType temp; + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BromodichloromethaneConcentrationMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) @@ -18396,7 +20422,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, float value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::BromodichloromethaneConcentrationMeasurement::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::BromodichloromethaneConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -18407,14 +20436,15 @@ namespace Tolerance { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { NumericAttributeTraits::StorageType temp; + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BromodichloromethaneConcentrationMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) @@ -18423,7 +20453,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, float value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::BromodichloromethaneConcentrationMeasurement::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::BromodichloromethaneConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -18440,14 +20473,15 @@ namespace MeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BromoformConcentrationMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::BromoformConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) @@ -18456,7 +20490,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, float value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::BromoformConcentrationMeasurement::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::BromoformConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -18467,14 +20504,15 @@ namespace MinMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BromoformConcentrationMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::BromoformConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) @@ -18483,7 +20521,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, float value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::BromoformConcentrationMeasurement::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::BromoformConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -18494,14 +20535,15 @@ namespace MaxMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BromoformConcentrationMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::BromoformConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) @@ -18510,7 +20552,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, float value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::BromoformConcentrationMeasurement::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::BromoformConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -18521,14 +20566,15 @@ namespace Tolerance { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BromoformConcentrationMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::BromoformConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) @@ -18537,7 +20583,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, float value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::BromoformConcentrationMeasurement::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::BromoformConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -18554,14 +20603,15 @@ namespace MeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { NumericAttributeTraits::StorageType temp; + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ChlorodibromomethaneConcentrationMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) @@ -18570,7 +20620,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, float value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ChlorodibromomethaneConcentrationMeasurement::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ChlorodibromomethaneConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -18581,14 +20634,15 @@ namespace MinMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { NumericAttributeTraits::StorageType temp; + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ChlorodibromomethaneConcentrationMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) @@ -18597,7 +20651,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, float value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ChlorodibromomethaneConcentrationMeasurement::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ChlorodibromomethaneConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -18608,14 +20665,15 @@ namespace MaxMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { NumericAttributeTraits::StorageType temp; + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ChlorodibromomethaneConcentrationMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) @@ -18624,7 +20682,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, float value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ChlorodibromomethaneConcentrationMeasurement::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ChlorodibromomethaneConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -18635,14 +20696,15 @@ namespace Tolerance { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { NumericAttributeTraits::StorageType temp; + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ChlorodibromomethaneConcentrationMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) @@ -18651,7 +20713,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, float value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ChlorodibromomethaneConcentrationMeasurement::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ChlorodibromomethaneConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -18668,14 +20733,15 @@ namespace MeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ChloroformConcentrationMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::ChloroformConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) @@ -18684,7 +20750,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, float value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ChloroformConcentrationMeasurement::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ChloroformConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -18695,14 +20764,15 @@ namespace MinMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ChloroformConcentrationMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::ChloroformConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) @@ -18711,7 +20781,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, float value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ChloroformConcentrationMeasurement::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ChloroformConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -18722,14 +20795,15 @@ namespace MaxMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ChloroformConcentrationMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::ChloroformConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) @@ -18738,7 +20812,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, float value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ChloroformConcentrationMeasurement::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ChloroformConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -18749,14 +20826,15 @@ namespace Tolerance { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ChloroformConcentrationMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::ChloroformConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) @@ -18765,7 +20843,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, float value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ChloroformConcentrationMeasurement::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ChloroformConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -18782,14 +20863,15 @@ namespace MeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::SodiumConcentrationMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::SodiumConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) @@ -18798,7 +20880,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, float value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::SodiumConcentrationMeasurement::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::SodiumConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -18809,14 +20894,15 @@ namespace MinMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::SodiumConcentrationMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::SodiumConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) @@ -18825,7 +20911,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, float value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::SodiumConcentrationMeasurement::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::SodiumConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -18836,14 +20925,15 @@ namespace MaxMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::SodiumConcentrationMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::SodiumConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) @@ -18852,7 +20942,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, float value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::SodiumConcentrationMeasurement::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::SodiumConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -18863,14 +20956,15 @@ namespace Tolerance { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::SodiumConcentrationMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::SodiumConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) @@ -18879,7 +20973,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, float value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::SodiumConcentrationMeasurement::Id, Id, (uint8_t *) &value, + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::SodiumConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -18896,14 +20993,14 @@ namespace ZoneState { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::IasZone::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::IasZone::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -18912,7 +21009,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::IasZone::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::IasZone::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } } // namespace ZoneState @@ -18922,14 +21022,14 @@ namespace ZoneType { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::IasZone::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::IasZone::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -18938,7 +21038,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::IasZone::Id, Id, (uint8_t *) &value, ZCL_ENUM16_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::IasZone::Id, Id, writable, ZCL_ENUM16_ATTRIBUTE_TYPE); } } // namespace ZoneType @@ -18948,14 +21051,14 @@ namespace ZoneStatus { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::IasZone::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::IasZone::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -18964,7 +21067,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::IasZone::Id, Id, (uint8_t *) &value, ZCL_BITMAP16_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::IasZone::Id, Id, writable, ZCL_BITMAP16_ATTRIBUTE_TYPE); } } // namespace ZoneStatus @@ -18974,14 +21080,14 @@ namespace IasCieAddress { EmberAfStatus Get(chip::EndpointId endpoint, chip::NodeId * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::IasZone::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::IasZone::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, chip::NodeId value) @@ -18990,7 +21096,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, chip::NodeId value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::IasZone::Id, Id, (uint8_t *) &value, ZCL_NODE_ID_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::IasZone::Id, Id, writable, ZCL_NODE_ID_ATTRIBUTE_TYPE); } } // namespace IasCieAddress @@ -19000,14 +21109,14 @@ namespace ZoneId { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::IasZone::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::IasZone::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -19016,7 +21125,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::IasZone::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::IasZone::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace ZoneId @@ -19026,14 +21138,14 @@ namespace NumberOfZoneSensitivityLevelsSupported { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::IasZone::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::IasZone::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -19042,7 +21154,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::IasZone::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::IasZone::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace NumberOfZoneSensitivityLevelsSupported @@ -19052,14 +21167,14 @@ namespace CurrentZoneSensitivityLevel { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::IasZone::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::IasZone::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -19068,7 +21183,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::IasZone::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::IasZone::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace CurrentZoneSensitivityLevel @@ -19084,14 +21202,14 @@ namespace MaxDuration { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::IasWd::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::IasWd::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -19100,7 +21218,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::IasWd::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::IasWd::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace MaxDuration @@ -19218,14 +21339,14 @@ namespace CurrentNavigatorTarget { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::TargetNavigator::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TargetNavigator::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -19234,7 +21355,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::TargetNavigator::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::TargetNavigator::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace CurrentNavigatorTarget @@ -19250,14 +21374,14 @@ namespace PlaybackState { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::MediaPlayback::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::MediaPlayback::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -19266,7 +21390,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::MediaPlayback::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::MediaPlayback::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } } // namespace PlaybackState @@ -19276,14 +21403,14 @@ namespace StartTime { EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::MediaPlayback::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::MediaPlayback::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) @@ -19292,7 +21419,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::MediaPlayback::Id, Id, (uint8_t *) &value, ZCL_INT64U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::MediaPlayback::Id, Id, writable, ZCL_INT64U_ATTRIBUTE_TYPE); } } // namespace StartTime @@ -19302,14 +21432,14 @@ namespace Duration { EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::MediaPlayback::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::MediaPlayback::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) @@ -19318,7 +21448,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::MediaPlayback::Id, Id, (uint8_t *) &value, ZCL_INT64U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::MediaPlayback::Id, Id, writable, ZCL_INT64U_ATTRIBUTE_TYPE); } } // namespace Duration @@ -19328,14 +21461,14 @@ namespace PositionUpdatedAt { EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::MediaPlayback::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::MediaPlayback::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) @@ -19344,7 +21477,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::MediaPlayback::Id, Id, (uint8_t *) &value, ZCL_INT64U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::MediaPlayback::Id, Id, writable, ZCL_INT64U_ATTRIBUTE_TYPE); } } // namespace PositionUpdatedAt @@ -19354,14 +21490,14 @@ namespace Position { EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::MediaPlayback::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::MediaPlayback::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) @@ -19370,7 +21506,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::MediaPlayback::Id, Id, (uint8_t *) &value, ZCL_INT64U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::MediaPlayback::Id, Id, writable, ZCL_INT64U_ATTRIBUTE_TYPE); } } // namespace Position @@ -19380,14 +21519,14 @@ namespace PlaybackSpeed { EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::MediaPlayback::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::MediaPlayback::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) @@ -19396,7 +21535,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::MediaPlayback::Id, Id, (uint8_t *) &value, ZCL_INT64U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::MediaPlayback::Id, Id, writable, ZCL_INT64U_ATTRIBUTE_TYPE); } } // namespace PlaybackSpeed @@ -19406,14 +21548,14 @@ namespace SeekRangeEnd { EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::MediaPlayback::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::MediaPlayback::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) @@ -19422,7 +21564,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::MediaPlayback::Id, Id, (uint8_t *) &value, ZCL_INT64U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::MediaPlayback::Id, Id, writable, ZCL_INT64U_ATTRIBUTE_TYPE); } } // namespace SeekRangeEnd @@ -19432,14 +21577,14 @@ namespace SeekRangeStart { EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::MediaPlayback::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::MediaPlayback::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) @@ -19448,7 +21593,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::MediaPlayback::Id, Id, (uint8_t *) &value, ZCL_INT64U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::MediaPlayback::Id, Id, writable, ZCL_INT64U_ATTRIBUTE_TYPE); } } // namespace SeekRangeStart @@ -19464,14 +21612,14 @@ namespace CurrentMediaInput { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::MediaInput::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::MediaInput::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -19480,7 +21628,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::MediaInput::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::MediaInput::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace CurrentMediaInput @@ -19502,14 +21653,14 @@ namespace CurrentAudioOutput { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::AudioOutput::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::AudioOutput::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -19518,7 +21669,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::AudioOutput::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::AudioOutput::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace CurrentAudioOutput @@ -19534,14 +21688,14 @@ namespace CatalogVendorId { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ApplicationLauncher::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ApplicationLauncher::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -19550,8 +21704,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ApplicationLauncher::Id, Id, (uint8_t *) &value, - ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ApplicationLauncher::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace CatalogVendorId @@ -19561,14 +21717,14 @@ namespace ApplicationId { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ApplicationLauncher::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ApplicationLauncher::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -19577,8 +21733,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ApplicationLauncher::Id, Id, (uint8_t *) &value, - ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ApplicationLauncher::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace ApplicationId @@ -19624,14 +21782,14 @@ namespace VendorId { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -19640,7 +21798,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace VendorId @@ -19680,14 +21841,14 @@ namespace ProductId { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -19696,7 +21857,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace ProductId @@ -19736,14 +21900,14 @@ namespace CatalogVendorId { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -19752,7 +21916,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace CatalogVendorId @@ -19762,14 +21929,14 @@ namespace ApplicationStatus { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -19778,7 +21945,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } } // namespace ApplicationStatus @@ -19794,14 +21964,14 @@ namespace Boolean { EmberAfStatus Get(chip::EndpointId endpoint, bool * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, bool value) @@ -19810,7 +21980,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, bool value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) &value, ZCL_BOOLEAN_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE); } } // namespace Boolean @@ -19820,14 +21993,14 @@ namespace Bitmap8 { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -19836,7 +22009,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) &value, ZCL_BITMAP8_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_BITMAP8_ATTRIBUTE_TYPE); } } // namespace Bitmap8 @@ -19846,14 +22022,14 @@ namespace Bitmap16 { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -19862,7 +22038,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) &value, ZCL_BITMAP16_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_BITMAP16_ATTRIBUTE_TYPE); } } // namespace Bitmap16 @@ -19872,14 +22051,14 @@ namespace Bitmap32 { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) @@ -19888,7 +22067,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) &value, ZCL_BITMAP32_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } } // namespace Bitmap32 @@ -19898,14 +22080,14 @@ namespace Bitmap64 { EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) @@ -19914,7 +22096,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) &value, ZCL_BITMAP64_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_BITMAP64_ATTRIBUTE_TYPE); } } // namespace Bitmap64 @@ -19924,14 +22109,14 @@ namespace Int8u { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -19940,7 +22125,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace Int8u @@ -19950,14 +22138,14 @@ namespace Int16u { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -19966,7 +22154,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace Int16u @@ -19976,14 +22167,14 @@ namespace Int32u { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) @@ -19992,7 +22183,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } } // namespace Int32u @@ -20002,14 +22196,14 @@ namespace Int64u { EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) @@ -20018,7 +22212,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) &value, ZCL_INT64U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_INT64U_ATTRIBUTE_TYPE); } } // namespace Int64u @@ -20028,14 +22225,14 @@ namespace Int8s { EmberAfStatus Get(chip::EndpointId endpoint, int8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int8_t value) @@ -20044,7 +22241,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, int8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) &value, ZCL_INT8S_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_INT8S_ATTRIBUTE_TYPE); } } // namespace Int8s @@ -20054,14 +22254,14 @@ namespace Int16s { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) @@ -20070,7 +22270,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } } // namespace Int16s @@ -20080,14 +22283,14 @@ namespace Int32s { EmberAfStatus Get(chip::EndpointId endpoint, int32_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int32_t value) @@ -20096,7 +22299,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, int32_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) &value, ZCL_INT32S_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_INT32S_ATTRIBUTE_TYPE); } } // namespace Int32s @@ -20106,14 +22312,14 @@ namespace Int64s { EmberAfStatus Get(chip::EndpointId endpoint, int64_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int64_t value) @@ -20122,7 +22328,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, int64_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) &value, ZCL_INT64S_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_INT64S_ATTRIBUTE_TYPE); } } // namespace Int64s @@ -20132,14 +22341,14 @@ namespace Enum8 { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -20148,7 +22357,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } } // namespace Enum8 @@ -20158,14 +22370,14 @@ namespace Enum16 { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -20174,7 +22386,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) &value, ZCL_ENUM16_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_ENUM16_ATTRIBUTE_TYPE); } } // namespace Enum16 @@ -20304,14 +22519,14 @@ namespace EpochUs { EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) @@ -20320,7 +22535,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) &value, ZCL_EPOCH_US_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_EPOCH_US_ATTRIBUTE_TYPE); } } // namespace EpochUs @@ -20330,14 +22548,14 @@ namespace EpochS { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) @@ -20346,7 +22564,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) &value, ZCL_EPOCH_S_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_EPOCH_S_ATTRIBUTE_TYPE); } } // namespace EpochS @@ -20356,14 +22577,14 @@ namespace VendorId { EmberAfStatus Get(chip::EndpointId endpoint, chip::VendorId * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, chip::VendorId value) @@ -20372,7 +22593,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, chip::VendorId value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) &value, ZCL_VENDOR_ID_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_VENDOR_ID_ATTRIBUTE_TYPE); } } // namespace VendorId @@ -20382,14 +22606,14 @@ namespace Unsupported { EmberAfStatus Get(chip::EndpointId endpoint, bool * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, bool value) @@ -20398,7 +22622,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, bool value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) &value, ZCL_BOOLEAN_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE); } } // namespace Unsupported @@ -20408,8 +22635,8 @@ namespace NullableBoolean { EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (NumericAttributeTraits::IsNullValue(temp)) { @@ -20417,7 +22644,7 @@ EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) } else { - value.SetNonNull() = temp; + value.SetNonNull() = NumericAttributeTraits::StorageToWorking(temp); } return status; } @@ -20427,14 +22654,18 @@ EmberAfStatus Set(chip::EndpointId endpoint, bool value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) &value, ZCL_BOOLEAN_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE); } EmberAfStatus SetNull(chip::EndpointId endpoint) { - auto value = NumericAttributeTraits::kNullValue; - return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, reinterpret_cast(&value), - ZCL_BOOLEAN_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType value; + NumericAttributeTraits::SetNull(value); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(value); + return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE); } EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value) @@ -20454,8 +22685,8 @@ namespace NullableBitmap8 { EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (NumericAttributeTraits::IsNullValue(temp)) { @@ -20463,7 +22694,7 @@ EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & valu } else { - value.SetNonNull() = temp; + value.SetNonNull() = NumericAttributeTraits::StorageToWorking(temp); } return status; } @@ -20473,14 +22704,18 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) &value, ZCL_BITMAP8_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_BITMAP8_ATTRIBUTE_TYPE); } EmberAfStatus SetNull(chip::EndpointId endpoint) { - auto value = NumericAttributeTraits::kNullValue; - return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, reinterpret_cast(&value), - ZCL_BITMAP8_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType value; + NumericAttributeTraits::SetNull(value); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(value); + return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_BITMAP8_ATTRIBUTE_TYPE); } EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value) @@ -20500,8 +22735,8 @@ namespace NullableBitmap16 { EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (NumericAttributeTraits::IsNullValue(temp)) { @@ -20509,7 +22744,7 @@ EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & val } else { - value.SetNonNull() = temp; + value.SetNonNull() = NumericAttributeTraits::StorageToWorking(temp); } return status; } @@ -20519,14 +22754,18 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) &value, ZCL_BITMAP16_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_BITMAP16_ATTRIBUTE_TYPE); } EmberAfStatus SetNull(chip::EndpointId endpoint) { - auto value = NumericAttributeTraits::kNullValue; - return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, reinterpret_cast(&value), - ZCL_BITMAP16_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType value; + NumericAttributeTraits::SetNull(value); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(value); + return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_BITMAP16_ATTRIBUTE_TYPE); } EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value) @@ -20546,8 +22785,8 @@ namespace NullableBitmap32 { EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (NumericAttributeTraits::IsNullValue(temp)) { @@ -20555,7 +22794,7 @@ EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & val } else { - value.SetNonNull() = temp; + value.SetNonNull() = NumericAttributeTraits::StorageToWorking(temp); } return status; } @@ -20565,14 +22804,18 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) &value, ZCL_BITMAP32_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } EmberAfStatus SetNull(chip::EndpointId endpoint) { - auto value = NumericAttributeTraits::kNullValue; - return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, reinterpret_cast(&value), - ZCL_BITMAP32_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType value; + NumericAttributeTraits::SetNull(value); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(value); + return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value) @@ -20592,8 +22835,8 @@ namespace NullableBitmap64 { EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (NumericAttributeTraits::IsNullValue(temp)) { @@ -20601,7 +22844,7 @@ EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & val } else { - value.SetNonNull() = temp; + value.SetNonNull() = NumericAttributeTraits::StorageToWorking(temp); } return status; } @@ -20611,14 +22854,18 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) &value, ZCL_BITMAP64_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_BITMAP64_ATTRIBUTE_TYPE); } EmberAfStatus SetNull(chip::EndpointId endpoint) { - auto value = NumericAttributeTraits::kNullValue; - return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, reinterpret_cast(&value), - ZCL_BITMAP64_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType value; + NumericAttributeTraits::SetNull(value); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(value); + return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_BITMAP64_ATTRIBUTE_TYPE); } EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value) @@ -20638,8 +22885,8 @@ namespace NullableInt8u { EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (NumericAttributeTraits::IsNullValue(temp)) { @@ -20647,7 +22894,7 @@ EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & valu } else { - value.SetNonNull() = temp; + value.SetNonNull() = NumericAttributeTraits::StorageToWorking(temp); } return status; } @@ -20657,14 +22904,18 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } EmberAfStatus SetNull(chip::EndpointId endpoint) { - auto value = NumericAttributeTraits::kNullValue; - return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, reinterpret_cast(&value), - ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType value; + NumericAttributeTraits::SetNull(value); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(value); + return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value) @@ -20684,8 +22935,8 @@ namespace NullableInt16u { EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (NumericAttributeTraits::IsNullValue(temp)) { @@ -20693,7 +22944,7 @@ EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & val } else { - value.SetNonNull() = temp; + value.SetNonNull() = NumericAttributeTraits::StorageToWorking(temp); } return status; } @@ -20703,14 +22954,18 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } EmberAfStatus SetNull(chip::EndpointId endpoint) { - auto value = NumericAttributeTraits::kNullValue; - return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, reinterpret_cast(&value), - ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType value; + NumericAttributeTraits::SetNull(value); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(value); + return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value) @@ -20730,8 +22985,8 @@ namespace NullableInt32u { EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (NumericAttributeTraits::IsNullValue(temp)) { @@ -20739,7 +22994,7 @@ EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & val } else { - value.SetNonNull() = temp; + value.SetNonNull() = NumericAttributeTraits::StorageToWorking(temp); } return status; } @@ -20749,14 +23004,18 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } EmberAfStatus SetNull(chip::EndpointId endpoint) { - auto value = NumericAttributeTraits::kNullValue; - return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, reinterpret_cast(&value), - ZCL_INT32U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType value; + NumericAttributeTraits::SetNull(value); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(value); + return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value) @@ -20776,8 +23035,8 @@ namespace NullableInt64u { EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (NumericAttributeTraits::IsNullValue(temp)) { @@ -20785,7 +23044,7 @@ EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & val } else { - value.SetNonNull() = temp; + value.SetNonNull() = NumericAttributeTraits::StorageToWorking(temp); } return status; } @@ -20795,14 +23054,18 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) &value, ZCL_INT64U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_INT64U_ATTRIBUTE_TYPE); } EmberAfStatus SetNull(chip::EndpointId endpoint) { - auto value = NumericAttributeTraits::kNullValue; - return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, reinterpret_cast(&value), - ZCL_INT64U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType value; + NumericAttributeTraits::SetNull(value); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(value); + return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_INT64U_ATTRIBUTE_TYPE); } EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value) @@ -20822,8 +23085,8 @@ namespace NullableInt8s { EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (NumericAttributeTraits::IsNullValue(temp)) { @@ -20831,7 +23094,7 @@ EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value } else { - value.SetNonNull() = temp; + value.SetNonNull() = NumericAttributeTraits::StorageToWorking(temp); } return status; } @@ -20841,14 +23104,18 @@ EmberAfStatus Set(chip::EndpointId endpoint, int8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) &value, ZCL_INT8S_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_INT8S_ATTRIBUTE_TYPE); } EmberAfStatus SetNull(chip::EndpointId endpoint) { - auto value = NumericAttributeTraits::kNullValue; - return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, reinterpret_cast(&value), - ZCL_INT8S_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType value; + NumericAttributeTraits::SetNull(value); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(value); + return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_INT8S_ATTRIBUTE_TYPE); } EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value) @@ -20868,8 +23135,8 @@ namespace NullableInt16s { EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (NumericAttributeTraits::IsNullValue(temp)) { @@ -20877,7 +23144,7 @@ EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & valu } else { - value.SetNonNull() = temp; + value.SetNonNull() = NumericAttributeTraits::StorageToWorking(temp); } return status; } @@ -20887,14 +23154,18 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } EmberAfStatus SetNull(chip::EndpointId endpoint) { - auto value = NumericAttributeTraits::kNullValue; - return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, reinterpret_cast(&value), - ZCL_INT16S_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType value; + NumericAttributeTraits::SetNull(value); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(value); + return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value) @@ -20914,8 +23185,8 @@ namespace NullableInt32s { EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (NumericAttributeTraits::IsNullValue(temp)) { @@ -20923,7 +23194,7 @@ EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & valu } else { - value.SetNonNull() = temp; + value.SetNonNull() = NumericAttributeTraits::StorageToWorking(temp); } return status; } @@ -20933,14 +23204,18 @@ EmberAfStatus Set(chip::EndpointId endpoint, int32_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) &value, ZCL_INT32S_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_INT32S_ATTRIBUTE_TYPE); } EmberAfStatus SetNull(chip::EndpointId endpoint) { - auto value = NumericAttributeTraits::kNullValue; - return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, reinterpret_cast(&value), - ZCL_INT32S_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType value; + NumericAttributeTraits::SetNull(value); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(value); + return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_INT32S_ATTRIBUTE_TYPE); } EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value) @@ -20960,8 +23235,8 @@ namespace NullableInt64s { EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (NumericAttributeTraits::IsNullValue(temp)) { @@ -20969,7 +23244,7 @@ EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & valu } else { - value.SetNonNull() = temp; + value.SetNonNull() = NumericAttributeTraits::StorageToWorking(temp); } return status; } @@ -20979,14 +23254,18 @@ EmberAfStatus Set(chip::EndpointId endpoint, int64_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) &value, ZCL_INT64S_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_INT64S_ATTRIBUTE_TYPE); } EmberAfStatus SetNull(chip::EndpointId endpoint) { - auto value = NumericAttributeTraits::kNullValue; - return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, reinterpret_cast(&value), - ZCL_INT64S_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType value; + NumericAttributeTraits::SetNull(value); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(value); + return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_INT64S_ATTRIBUTE_TYPE); } EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value) @@ -21006,8 +23285,8 @@ namespace NullableEnum8 { EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (NumericAttributeTraits::IsNullValue(temp)) { @@ -21015,7 +23294,7 @@ EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & valu } else { - value.SetNonNull() = temp; + value.SetNonNull() = NumericAttributeTraits::StorageToWorking(temp); } return status; } @@ -21025,14 +23304,18 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } EmberAfStatus SetNull(chip::EndpointId endpoint) { - auto value = NumericAttributeTraits::kNullValue; - return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, reinterpret_cast(&value), - ZCL_ENUM8_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType value; + NumericAttributeTraits::SetNull(value); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(value); + return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value) @@ -21052,8 +23335,8 @@ namespace NullableEnum16 { EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (NumericAttributeTraits::IsNullValue(temp)) { @@ -21061,7 +23344,7 @@ EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & val } else { - value.SetNonNull() = temp; + value.SetNonNull() = NumericAttributeTraits::StorageToWorking(temp); } return status; } @@ -21071,14 +23354,18 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) &value, ZCL_ENUM16_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_ENUM16_ATTRIBUTE_TYPE); } EmberAfStatus SetNull(chip::EndpointId endpoint) { - auto value = NumericAttributeTraits::kNullValue; - return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, reinterpret_cast(&value), - ZCL_ENUM16_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType value; + NumericAttributeTraits::SetNull(value); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(value); + return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_ENUM16_ATTRIBUTE_TYPE); } EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value) @@ -21195,6 +23482,35 @@ EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable>::StorageType temp; + uint8_t * readable = NumericAttributeTraits>::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ApplianceIdentification::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits>::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = NumericAttributeTraits>::StorageToWorking(temp); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) +{ + if (!NumericAttributeTraits>::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } + NumericAttributeTraits>::StorageType storageValue; + NumericAttributeTraits>::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits>::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ApplianceIdentification::Id, Id, writable, ZCL_INT56U_ATTRIBUTE_TYPE); +} + +} // namespace BasicIdentification + namespace CompanyName { EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) @@ -21232,14 +23548,14 @@ namespace CompanyId { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ApplianceIdentification::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ApplianceIdentification::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -21248,8 +23564,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ApplianceIdentification::Id, Id, (uint8_t *) &value, - ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ApplianceIdentification::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace CompanyId @@ -21291,14 +23609,14 @@ namespace BrandId { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ApplianceIdentification::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ApplianceIdentification::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -21307,8 +23625,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ApplianceIdentification::Id, Id, (uint8_t *) &value, - ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ApplianceIdentification::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace BrandId @@ -21478,14 +23798,14 @@ namespace ProductTypeId { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ApplianceIdentification::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ApplianceIdentification::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -21494,8 +23814,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ApplianceIdentification::Id, Id, (uint8_t *) &value, - ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ApplianceIdentification::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace ProductTypeId @@ -21505,14 +23827,14 @@ namespace CecedSpecificationVersion { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ApplianceIdentification::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ApplianceIdentification::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -21521,8 +23843,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ApplianceIdentification::Id, Id, (uint8_t *) &value, - ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ApplianceIdentification::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace CecedSpecificationVersion @@ -21569,14 +23893,14 @@ namespace MeterTypeId { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::MeterIdentification::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::MeterIdentification::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -21585,8 +23909,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::MeterIdentification::Id, Id, (uint8_t *) &value, - ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::MeterIdentification::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace MeterTypeId @@ -21596,14 +23922,14 @@ namespace DataQualityId { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::MeterIdentification::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::MeterIdentification::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -21612,8 +23938,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::MeterIdentification::Id, Id, (uint8_t *) &value, - ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::MeterIdentification::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace DataQualityId @@ -21835,6 +24163,64 @@ EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) } // namespace Pod +namespace AvailablePower { + +EmberAfStatus Get(chip::EndpointId endpoint, int32_t * value) +{ + NumericAttributeTraits>::StorageType temp; + uint8_t * readable = NumericAttributeTraits>::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::MeterIdentification::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits>::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = NumericAttributeTraits>::StorageToWorking(temp); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, int32_t value) +{ + if (!NumericAttributeTraits>::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } + NumericAttributeTraits>::StorageType storageValue; + NumericAttributeTraits>::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits>::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::MeterIdentification::Id, Id, writable, ZCL_INT24S_ATTRIBUTE_TYPE); +} + +} // namespace AvailablePower + +namespace PowerThreshold { + +EmberAfStatus Get(chip::EndpointId endpoint, int32_t * value) +{ + NumericAttributeTraits>::StorageType temp; + uint8_t * readable = NumericAttributeTraits>::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::MeterIdentification::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits>::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = NumericAttributeTraits>::StorageToWorking(temp); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, int32_t value) +{ + if (!NumericAttributeTraits>::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } + NumericAttributeTraits>::StorageType storageValue; + NumericAttributeTraits>::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits>::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::MeterIdentification::Id, Id, writable, ZCL_INT24S_ATTRIBUTE_TYPE); +} + +} // namespace PowerThreshold + } // namespace Attributes } // namespace MeterIdentification @@ -21846,14 +24232,14 @@ namespace LogMaxSize { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ApplianceStatistics::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ApplianceStatistics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) @@ -21862,8 +24248,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ApplianceStatistics::Id, Id, (uint8_t *) &value, - ZCL_INT32U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ApplianceStatistics::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } } // namespace LogMaxSize @@ -21873,14 +24261,14 @@ namespace LogQueueMaxSize { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ApplianceStatistics::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ApplianceStatistics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -21889,8 +24277,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ApplianceStatistics::Id, Id, (uint8_t *) &value, - ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ApplianceStatistics::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace LogQueueMaxSize @@ -21906,14 +24296,14 @@ namespace MeasurementType { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) @@ -21922,8 +24312,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_BITMAP32_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } } // namespace MeasurementType @@ -21933,14 +24325,14 @@ namespace DcVoltage { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) @@ -21949,8 +24341,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16S_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } } // namespace DcVoltage @@ -21960,14 +24354,14 @@ namespace DcVoltageMin { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) @@ -21976,8 +24370,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16S_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } } // namespace DcVoltageMin @@ -21987,14 +24383,14 @@ namespace DcVoltageMax { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) @@ -22003,8 +24399,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16S_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } } // namespace DcVoltageMax @@ -22014,14 +24412,14 @@ namespace DcCurrent { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) @@ -22030,8 +24428,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16S_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } } // namespace DcCurrent @@ -22041,14 +24441,14 @@ namespace DcCurrentMin { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) @@ -22057,8 +24457,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16S_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } } // namespace DcCurrentMin @@ -22068,14 +24470,14 @@ namespace DcCurrentMax { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) @@ -22084,8 +24486,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16S_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } } // namespace DcCurrentMax @@ -22095,14 +24499,14 @@ namespace DcPower { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) @@ -22111,8 +24515,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16S_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } } // namespace DcPower @@ -22122,14 +24528,14 @@ namespace DcPowerMin { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) @@ -22138,8 +24544,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16S_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } } // namespace DcPowerMin @@ -22149,14 +24557,14 @@ namespace DcPowerMax { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) @@ -22165,8 +24573,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16S_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } } // namespace DcPowerMax @@ -22176,14 +24586,14 @@ namespace DcVoltageMultiplier { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -22192,8 +24602,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace DcVoltageMultiplier @@ -22203,14 +24615,14 @@ namespace DcVoltageDivisor { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -22219,8 +24631,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace DcVoltageDivisor @@ -22230,14 +24644,14 @@ namespace DcCurrentMultiplier { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -22246,8 +24660,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace DcCurrentMultiplier @@ -22257,14 +24673,14 @@ namespace DcCurrentDivisor { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -22273,8 +24689,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace DcCurrentDivisor @@ -22284,14 +24702,14 @@ namespace DcPowerMultiplier { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -22300,8 +24718,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace DcPowerMultiplier @@ -22311,14 +24731,14 @@ namespace DcPowerDivisor { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -22327,8 +24747,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace DcPowerDivisor @@ -22338,14 +24760,14 @@ namespace AcFrequency { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -22354,8 +24776,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace AcFrequency @@ -22365,14 +24789,14 @@ namespace AcFrequencyMin { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -22381,8 +24805,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace AcFrequencyMin @@ -22392,14 +24818,14 @@ namespace AcFrequencyMax { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -22408,8 +24834,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace AcFrequencyMax @@ -22419,14 +24847,14 @@ namespace NeutralCurrent { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -22435,8 +24863,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace NeutralCurrent @@ -22446,14 +24876,14 @@ namespace TotalActivePower { EmberAfStatus Get(chip::EndpointId endpoint, int32_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int32_t value) @@ -22462,8 +24892,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, int32_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT32S_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT32S_ATTRIBUTE_TYPE); } } // namespace TotalActivePower @@ -22473,14 +24905,14 @@ namespace TotalReactivePower { EmberAfStatus Get(chip::EndpointId endpoint, int32_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int32_t value) @@ -22489,8 +24921,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, int32_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT32S_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT32S_ATTRIBUTE_TYPE); } } // namespace TotalReactivePower @@ -22500,14 +24934,14 @@ namespace TotalApparentPower { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) @@ -22516,8 +24950,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT32U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } } // namespace TotalApparentPower @@ -22527,14 +24963,14 @@ namespace Measured1stHarmonicCurrent { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) @@ -22543,8 +24979,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16S_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } } // namespace Measured1stHarmonicCurrent @@ -22554,14 +24992,14 @@ namespace Measured3rdHarmonicCurrent { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) @@ -22570,8 +25008,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16S_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } } // namespace Measured3rdHarmonicCurrent @@ -22581,14 +25021,14 @@ namespace Measured5thHarmonicCurrent { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) @@ -22597,8 +25037,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16S_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } } // namespace Measured5thHarmonicCurrent @@ -22608,14 +25050,14 @@ namespace Measured7thHarmonicCurrent { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) @@ -22624,8 +25066,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16S_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } } // namespace Measured7thHarmonicCurrent @@ -22635,14 +25079,14 @@ namespace Measured9thHarmonicCurrent { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) @@ -22651,8 +25095,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16S_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } } // namespace Measured9thHarmonicCurrent @@ -22662,14 +25108,14 @@ namespace Measured11thHarmonicCurrent { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) @@ -22678,8 +25124,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16S_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } } // namespace Measured11thHarmonicCurrent @@ -22689,14 +25137,14 @@ namespace MeasuredPhase1stHarmonicCurrent { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) @@ -22705,8 +25153,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16S_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } } // namespace MeasuredPhase1stHarmonicCurrent @@ -22716,14 +25166,14 @@ namespace MeasuredPhase3rdHarmonicCurrent { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) @@ -22732,8 +25182,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16S_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } } // namespace MeasuredPhase3rdHarmonicCurrent @@ -22743,14 +25195,14 @@ namespace MeasuredPhase5thHarmonicCurrent { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) @@ -22759,8 +25211,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16S_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } } // namespace MeasuredPhase5thHarmonicCurrent @@ -22770,14 +25224,14 @@ namespace MeasuredPhase7thHarmonicCurrent { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) @@ -22786,8 +25240,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16S_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } } // namespace MeasuredPhase7thHarmonicCurrent @@ -22797,14 +25253,14 @@ namespace MeasuredPhase9thHarmonicCurrent { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) @@ -22813,8 +25269,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16S_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } } // namespace MeasuredPhase9thHarmonicCurrent @@ -22824,14 +25282,14 @@ namespace MeasuredPhase11thHarmonicCurrent { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) @@ -22840,8 +25298,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16S_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } } // namespace MeasuredPhase11thHarmonicCurrent @@ -22851,14 +25311,14 @@ namespace AcFrequencyMultiplier { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -22867,8 +25327,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace AcFrequencyMultiplier @@ -22878,14 +25340,14 @@ namespace AcFrequencyDivisor { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -22894,8 +25356,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace AcFrequencyDivisor @@ -22905,14 +25369,14 @@ namespace PowerMultiplier { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) @@ -22921,8 +25385,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT32U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } } // namespace PowerMultiplier @@ -22932,14 +25398,14 @@ namespace PowerDivisor { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) @@ -22948,8 +25414,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT32U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } } // namespace PowerDivisor @@ -22959,14 +25427,14 @@ namespace HarmonicCurrentMultiplier { EmberAfStatus Get(chip::EndpointId endpoint, int8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int8_t value) @@ -22975,8 +25443,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, int8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT8S_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT8S_ATTRIBUTE_TYPE); } } // namespace HarmonicCurrentMultiplier @@ -22986,14 +25456,14 @@ namespace PhaseHarmonicCurrentMultiplier { EmberAfStatus Get(chip::EndpointId endpoint, int8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int8_t value) @@ -23002,8 +25472,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, int8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT8S_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT8S_ATTRIBUTE_TYPE); } } // namespace PhaseHarmonicCurrentMultiplier @@ -23013,14 +25485,14 @@ namespace InstantaneousVoltage { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) @@ -23029,8 +25501,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16S_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } } // namespace InstantaneousVoltage @@ -23040,14 +25514,14 @@ namespace InstantaneousLineCurrent { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -23056,8 +25530,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace InstantaneousLineCurrent @@ -23067,14 +25543,14 @@ namespace InstantaneousActiveCurrent { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) @@ -23083,8 +25559,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16S_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } } // namespace InstantaneousActiveCurrent @@ -23094,14 +25572,14 @@ namespace InstantaneousReactiveCurrent { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) @@ -23110,8 +25588,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16S_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } } // namespace InstantaneousReactiveCurrent @@ -23121,14 +25601,14 @@ namespace InstantaneousPower { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) @@ -23137,8 +25617,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16S_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } } // namespace InstantaneousPower @@ -23148,14 +25630,14 @@ namespace RmsVoltage { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -23164,8 +25646,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace RmsVoltage @@ -23175,14 +25659,14 @@ namespace RmsVoltageMin { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -23191,8 +25675,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace RmsVoltageMin @@ -23202,14 +25688,14 @@ namespace RmsVoltageMax { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -23218,8 +25704,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace RmsVoltageMax @@ -23229,14 +25717,14 @@ namespace RmsCurrent { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -23245,8 +25733,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace RmsCurrent @@ -23256,14 +25746,14 @@ namespace RmsCurrentMin { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -23272,8 +25762,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace RmsCurrentMin @@ -23283,14 +25775,14 @@ namespace RmsCurrentMax { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -23299,8 +25791,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace RmsCurrentMax @@ -23310,14 +25804,14 @@ namespace ActivePower { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) @@ -23326,8 +25820,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16S_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } } // namespace ActivePower @@ -23337,14 +25833,14 @@ namespace ActivePowerMin { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) @@ -23353,8 +25849,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16S_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } } // namespace ActivePowerMin @@ -23364,14 +25862,14 @@ namespace ActivePowerMax { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) @@ -23380,8 +25878,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16S_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } } // namespace ActivePowerMax @@ -23391,14 +25891,14 @@ namespace ReactivePower { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) @@ -23407,8 +25907,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16S_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } } // namespace ReactivePower @@ -23418,14 +25920,14 @@ namespace ApparentPower { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -23434,8 +25936,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace ApparentPower @@ -23445,14 +25949,14 @@ namespace PowerFactor { EmberAfStatus Get(chip::EndpointId endpoint, int8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int8_t value) @@ -23461,8 +25965,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, int8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT8S_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT8S_ATTRIBUTE_TYPE); } } // namespace PowerFactor @@ -23472,14 +25978,14 @@ namespace AverageRmsVoltageMeasurementPeriod { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -23488,8 +25994,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace AverageRmsVoltageMeasurementPeriod @@ -23499,14 +26007,14 @@ namespace AverageRmsUnderVoltageCounter { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -23515,8 +26023,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace AverageRmsUnderVoltageCounter @@ -23526,14 +26036,14 @@ namespace RmsExtremeOverVoltagePeriod { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -23542,8 +26052,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace RmsExtremeOverVoltagePeriod @@ -23553,14 +26065,14 @@ namespace RmsExtremeUnderVoltagePeriod { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -23569,8 +26081,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace RmsExtremeUnderVoltagePeriod @@ -23580,14 +26094,14 @@ namespace RmsVoltageSagPeriod { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -23596,8 +26110,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace RmsVoltageSagPeriod @@ -23607,14 +26123,14 @@ namespace RmsVoltageSwellPeriod { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -23623,8 +26139,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace RmsVoltageSwellPeriod @@ -23634,14 +26152,14 @@ namespace AcVoltageMultiplier { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -23650,8 +26168,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace AcVoltageMultiplier @@ -23661,14 +26181,14 @@ namespace AcVoltageDivisor { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -23677,8 +26197,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace AcVoltageDivisor @@ -23688,14 +26210,14 @@ namespace AcCurrentMultiplier { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -23704,8 +26226,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace AcCurrentMultiplier @@ -23715,14 +26239,14 @@ namespace AcCurrentDivisor { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -23731,8 +26255,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace AcCurrentDivisor @@ -23742,14 +26268,14 @@ namespace AcPowerMultiplier { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -23758,8 +26284,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace AcPowerMultiplier @@ -23769,14 +26297,14 @@ namespace AcPowerDivisor { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -23785,8 +26313,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace AcPowerDivisor @@ -23796,14 +26326,14 @@ namespace OverloadAlarmsMask { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -23812,8 +26342,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_BITMAP8_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_BITMAP8_ATTRIBUTE_TYPE); } } // namespace OverloadAlarmsMask @@ -23823,14 +26355,14 @@ namespace VoltageOverload { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) @@ -23839,8 +26371,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16S_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } } // namespace VoltageOverload @@ -23850,14 +26384,14 @@ namespace CurrentOverload { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) @@ -23866,8 +26400,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16S_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } } // namespace CurrentOverload @@ -23877,14 +26413,14 @@ namespace AcOverloadAlarmsMask { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -23893,8 +26429,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_BITMAP16_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_BITMAP16_ATTRIBUTE_TYPE); } } // namespace AcOverloadAlarmsMask @@ -23904,14 +26442,14 @@ namespace AcVoltageOverload { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) @@ -23920,8 +26458,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16S_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } } // namespace AcVoltageOverload @@ -23931,14 +26471,14 @@ namespace AcCurrentOverload { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) @@ -23947,8 +26487,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16S_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } } // namespace AcCurrentOverload @@ -23958,14 +26500,14 @@ namespace AcActivePowerOverload { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) @@ -23974,8 +26516,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16S_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } } // namespace AcActivePowerOverload @@ -23985,14 +26529,14 @@ namespace AcReactivePowerOverload { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) @@ -24001,8 +26545,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16S_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } } // namespace AcReactivePowerOverload @@ -24012,14 +26558,14 @@ namespace AverageRmsOverVoltage { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) @@ -24028,8 +26574,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16S_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } } // namespace AverageRmsOverVoltage @@ -24039,14 +26587,14 @@ namespace AverageRmsUnderVoltage { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) @@ -24055,8 +26603,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16S_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } } // namespace AverageRmsUnderVoltage @@ -24066,14 +26616,14 @@ namespace RmsExtremeOverVoltage { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) @@ -24082,8 +26632,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16S_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } } // namespace RmsExtremeOverVoltage @@ -24093,14 +26645,14 @@ namespace RmsExtremeUnderVoltage { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) @@ -24109,8 +26661,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16S_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } } // namespace RmsExtremeUnderVoltage @@ -24120,14 +26674,14 @@ namespace RmsVoltageSag { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) @@ -24136,8 +26690,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16S_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } } // namespace RmsVoltageSag @@ -24147,14 +26703,14 @@ namespace RmsVoltageSwell { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) @@ -24163,8 +26719,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16S_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } } // namespace RmsVoltageSwell @@ -24174,14 +26732,14 @@ namespace LineCurrentPhaseB { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -24190,8 +26748,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace LineCurrentPhaseB @@ -24201,14 +26761,14 @@ namespace ActiveCurrentPhaseB { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) @@ -24217,8 +26777,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16S_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } } // namespace ActiveCurrentPhaseB @@ -24228,14 +26790,14 @@ namespace ReactiveCurrentPhaseB { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) @@ -24244,8 +26806,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16S_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } } // namespace ReactiveCurrentPhaseB @@ -24255,14 +26819,14 @@ namespace RmsVoltagePhaseB { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -24271,8 +26835,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace RmsVoltagePhaseB @@ -24282,14 +26848,14 @@ namespace RmsVoltageMinPhaseB { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -24298,8 +26864,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace RmsVoltageMinPhaseB @@ -24309,14 +26877,14 @@ namespace RmsVoltageMaxPhaseB { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -24325,8 +26893,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace RmsVoltageMaxPhaseB @@ -24336,14 +26906,14 @@ namespace RmsCurrentPhaseB { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -24352,8 +26922,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace RmsCurrentPhaseB @@ -24363,14 +26935,14 @@ namespace RmsCurrentMinPhaseB { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -24379,8 +26951,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace RmsCurrentMinPhaseB @@ -24390,14 +26964,14 @@ namespace RmsCurrentMaxPhaseB { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -24406,8 +26980,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace RmsCurrentMaxPhaseB @@ -24417,14 +26993,14 @@ namespace ActivePowerPhaseB { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) @@ -24433,8 +27009,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16S_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } } // namespace ActivePowerPhaseB @@ -24444,14 +27022,14 @@ namespace ActivePowerMinPhaseB { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) @@ -24460,8 +27038,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16S_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } } // namespace ActivePowerMinPhaseB @@ -24471,14 +27051,14 @@ namespace ActivePowerMaxPhaseB { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) @@ -24487,8 +27067,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16S_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } } // namespace ActivePowerMaxPhaseB @@ -24498,14 +27080,14 @@ namespace ReactivePowerPhaseB { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) @@ -24514,8 +27096,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16S_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } } // namespace ReactivePowerPhaseB @@ -24525,14 +27109,14 @@ namespace ApparentPowerPhaseB { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -24541,8 +27125,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace ApparentPowerPhaseB @@ -24552,14 +27138,14 @@ namespace PowerFactorPhaseB { EmberAfStatus Get(chip::EndpointId endpoint, int8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int8_t value) @@ -24568,8 +27154,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, int8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT8S_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT8S_ATTRIBUTE_TYPE); } } // namespace PowerFactorPhaseB @@ -24579,14 +27167,14 @@ namespace AverageRmsVoltageMeasurementPeriodPhaseB { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -24595,8 +27183,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace AverageRmsVoltageMeasurementPeriodPhaseB @@ -24606,14 +27196,14 @@ namespace AverageRmsOverVoltageCounterPhaseB { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -24622,8 +27212,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace AverageRmsOverVoltageCounterPhaseB @@ -24633,14 +27225,14 @@ namespace AverageRmsUnderVoltageCounterPhaseB { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -24649,8 +27241,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace AverageRmsUnderVoltageCounterPhaseB @@ -24660,14 +27254,14 @@ namespace RmsExtremeOverVoltagePeriodPhaseB { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -24676,8 +27270,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace RmsExtremeOverVoltagePeriodPhaseB @@ -24687,14 +27283,14 @@ namespace RmsExtremeUnderVoltagePeriodPhaseB { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -24703,8 +27299,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace RmsExtremeUnderVoltagePeriodPhaseB @@ -24714,14 +27312,14 @@ namespace RmsVoltageSagPeriodPhaseB { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -24730,8 +27328,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace RmsVoltageSagPeriodPhaseB @@ -24741,14 +27341,14 @@ namespace RmsVoltageSwellPeriodPhaseB { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -24757,8 +27357,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace RmsVoltageSwellPeriodPhaseB @@ -24768,14 +27370,14 @@ namespace LineCurrentPhaseC { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -24784,8 +27386,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace LineCurrentPhaseC @@ -24795,14 +27399,14 @@ namespace ActiveCurrentPhaseC { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) @@ -24811,8 +27415,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16S_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } } // namespace ActiveCurrentPhaseC @@ -24822,14 +27428,14 @@ namespace ReactiveCurrentPhaseC { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) @@ -24838,8 +27444,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16S_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } } // namespace ReactiveCurrentPhaseC @@ -24849,14 +27457,14 @@ namespace RmsVoltagePhaseC { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -24865,8 +27473,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace RmsVoltagePhaseC @@ -24876,14 +27486,14 @@ namespace RmsVoltageMinPhaseC { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -24892,8 +27502,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace RmsVoltageMinPhaseC @@ -24903,14 +27515,14 @@ namespace RmsVoltageMaxPhaseC { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -24919,8 +27531,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace RmsVoltageMaxPhaseC @@ -24930,14 +27544,14 @@ namespace RmsCurrentPhaseC { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -24946,8 +27560,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace RmsCurrentPhaseC @@ -24957,14 +27573,14 @@ namespace RmsCurrentMinPhaseC { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -24973,8 +27589,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace RmsCurrentMinPhaseC @@ -24984,14 +27602,14 @@ namespace RmsCurrentMaxPhaseC { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -25000,8 +27618,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace RmsCurrentMaxPhaseC @@ -25011,14 +27631,14 @@ namespace ActivePowerPhaseC { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) @@ -25027,8 +27647,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16S_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } } // namespace ActivePowerPhaseC @@ -25038,14 +27660,14 @@ namespace ActivePowerMinPhaseC { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) @@ -25054,8 +27676,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16S_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } } // namespace ActivePowerMinPhaseC @@ -25065,14 +27689,14 @@ namespace ActivePowerMaxPhaseC { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) @@ -25081,8 +27705,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16S_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } } // namespace ActivePowerMaxPhaseC @@ -25092,14 +27718,14 @@ namespace ReactivePowerPhaseC { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) @@ -25108,8 +27734,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16S_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } } // namespace ReactivePowerPhaseC @@ -25119,14 +27747,14 @@ namespace ApparentPowerPhaseC { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -25135,8 +27763,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace ApparentPowerPhaseC @@ -25146,14 +27776,14 @@ namespace PowerFactorPhaseC { EmberAfStatus Get(chip::EndpointId endpoint, int8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int8_t value) @@ -25162,8 +27792,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, int8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT8S_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT8S_ATTRIBUTE_TYPE); } } // namespace PowerFactorPhaseC @@ -25173,14 +27805,14 @@ namespace AverageRmsVoltageMeasurementPeriodPhaseC { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -25189,8 +27821,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace AverageRmsVoltageMeasurementPeriodPhaseC @@ -25200,14 +27834,14 @@ namespace AverageRmsOverVoltageCounterPhaseC { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -25216,8 +27850,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace AverageRmsOverVoltageCounterPhaseC @@ -25227,14 +27863,14 @@ namespace AverageRmsUnderVoltageCounterPhaseC { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -25243,8 +27879,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace AverageRmsUnderVoltageCounterPhaseC @@ -25254,14 +27892,14 @@ namespace RmsExtremeOverVoltagePeriodPhaseC { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -25270,8 +27908,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace RmsExtremeOverVoltagePeriodPhaseC @@ -25281,14 +27921,14 @@ namespace RmsExtremeUnderVoltagePeriodPhaseC { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -25297,8 +27937,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace RmsExtremeUnderVoltagePeriodPhaseC @@ -25308,14 +27950,14 @@ namespace RmsVoltageSagPeriodPhaseC { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -25324,8 +27966,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace RmsVoltageSagPeriodPhaseC @@ -25335,14 +27979,14 @@ namespace RmsVoltageSwellPeriodPhaseC { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -25351,8 +27995,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, - ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace RmsVoltageSwellPeriodPhaseC @@ -25374,14 +28020,14 @@ namespace EmberSampleAttribute { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::SampleMfgSpecificCluster::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::SampleMfgSpecificCluster::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -25390,8 +28036,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::SampleMfgSpecificCluster::Id, Id, (uint8_t *) &value, - ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::SampleMfgSpecificCluster::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace EmberSampleAttribute @@ -25401,14 +28049,14 @@ namespace EmberSampleAttribute2 { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::SampleMfgSpecificCluster::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::SampleMfgSpecificCluster::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) @@ -25417,8 +28065,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::SampleMfgSpecificCluster::Id, Id, (uint8_t *) &value, - ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::SampleMfgSpecificCluster::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace EmberSampleAttribute2 @@ -25434,14 +28084,15 @@ namespace EmberSampleAttribute3 { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::SampleMfgSpecificCluster2::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::SampleMfgSpecificCluster2::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -25450,8 +28101,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::SampleMfgSpecificCluster2::Id, Id, (uint8_t *) &value, - ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::SampleMfgSpecificCluster2::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace EmberSampleAttribute3 @@ -25461,14 +28114,15 @@ namespace EmberSampleAttribute4 { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { NumericAttributeTraits::StorageType temp; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::SampleMfgSpecificCluster2::Id, Id, - reinterpret_cast(&temp), sizeof(temp)); + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::SampleMfgSpecificCluster2::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = temp; + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) @@ -25477,8 +28131,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - return emberAfWriteServerAttribute(endpoint, Clusters::SampleMfgSpecificCluster2::Id, Id, (uint8_t *) &value, - ZCL_INT16U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::SampleMfgSpecificCluster2::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace EmberSampleAttribute4 diff --git a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h index 69ad13d896393c..e0de3908aa65ed 100644 --- a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h +++ b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h @@ -361,6 +361,16 @@ EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value); // int16s EmberAfStatus Set(chip::EndpointId endpoint, int16_t value); } // namespace HighTempThreshold +namespace LowTempDwellTripPoint { +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // int24u +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); +} // namespace LowTempDwellTripPoint + +namespace HighTempDwellTripPoint { +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // int24u +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); +} // namespace HighTempDwellTripPoint + } // namespace Attributes } // namespace DeviceTemperatureConfiguration @@ -2245,6 +2255,16 @@ EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace Speed +namespace LifetimeRunningHours { +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // int24u +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); +} // namespace LifetimeRunningHours + +namespace Power { +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // int24u +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); +} // namespace Power + namespace LifetimeEnergyConsumed { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // int32u EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); @@ -2901,11 +2921,26 @@ EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value); // ch EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value); } // namespace LampManufacturer +namespace LampRatedHours { +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // int24u +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); +} // namespace LampRatedHours + +namespace LampBurnHours { +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // int24u +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); +} // namespace LampBurnHours + namespace LampAlarmMode { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // bitmap8 EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace LampAlarmMode +namespace LampBurnHoursTripPoint { +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // int24u +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); +} // namespace LampBurnHoursTripPoint + } // namespace Attributes } // namespace BallastConfiguration @@ -4387,6 +4422,11 @@ EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::NullableCancel(), onFailureCallback->Cancel()); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnInt32uAttributeResponse, this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); +}; + +class WritePumpConfigurationAndControlLifetimeRunningHours : public ModelCommand +{ +public: + WritePumpConfigurationAndControlLifetimeRunningHours() : ModelCommand("write") + { + AddArgument("attr-name", "lifetime-running-hours"); + AddArgument("attr-value", 0, UINT32_MAX, &mValue); + ModelCommand::AddArguments(); + } + + ~WritePumpConfigurationAndControlLifetimeRunningHours() + { + delete onSuccessCallback; + delete onFailureCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0200) command (0x01) on endpoint %" PRIu8, endpointId); + + chip::Controller::PumpConfigurationAndControlCluster cluster; + cluster.Associate(device, endpointId); + return cluster.WriteAttributeLifetimeRunningHours(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnDefaultSuccessResponse, this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); + uint32_t mValue; +}; + +class ReportPumpConfigurationAndControlLifetimeRunningHours : public ModelCommand +{ +public: + ReportPumpConfigurationAndControlLifetimeRunningHours() : ModelCommand("report") + { + AddArgument("attr-name", "lifetime-running-hours"); + AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); + AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); + AddArgument("wait", 0, 1, &mWait); + ModelCommand::AddArguments(); + } + + ~ReportPumpConfigurationAndControlLifetimeRunningHours() + { + delete onSuccessCallback; + delete onSuccessCallbackWithoutExit; + delete onFailureCallback; + delete onReportCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0200) command (0x06) on endpoint %" PRIu8, endpointId); + + chip::Controller::PumpConfigurationAndControlCluster cluster; + cluster.Associate(device, endpointId); + + ReturnErrorOnFailure(cluster.ReportAttributeLifetimeRunningHours(onReportCallback->Cancel())); + + chip::Callback::Cancelable * successCallback = mWait ? onSuccessCallbackWithoutExit->Cancel() : onSuccessCallback->Cancel(); + return cluster.SubscribeAttributeLifetimeRunningHours(successCallback, onFailureCallback->Cancel(), mMinInterval, + mMaxInterval); + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnDefaultSuccessResponse, this); + chip::Callback::Callback * onSuccessCallbackWithoutExit = + new chip::Callback::Callback(OnDefaultSuccessResponseWithoutExit, this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); + chip::Callback::Callback * onReportCallback = + new chip::Callback::Callback(OnInt32uAttributeReport, this); + uint16_t mMinInterval; + uint16_t mMaxInterval; + bool mWait; +}; + +/* + * Attribute Power + */ +class ReadPumpConfigurationAndControlPower : public ModelCommand +{ +public: + ReadPumpConfigurationAndControlPower() : ModelCommand("read") + { + AddArgument("attr-name", "power"); + ModelCommand::AddArguments(); + } + + ~ReadPumpConfigurationAndControlPower() + { + delete onSuccessCallback; + delete onFailureCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0200) command (0x00) on endpoint %" PRIu8, endpointId); + + chip::Controller::PumpConfigurationAndControlCluster cluster; + cluster.Associate(device, endpointId); + return cluster.ReadAttributePower(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnInt32uAttributeResponse, this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); +}; + +class WritePumpConfigurationAndControlPower : public ModelCommand +{ +public: + WritePumpConfigurationAndControlPower() : ModelCommand("write") + { + AddArgument("attr-name", "power"); + AddArgument("attr-value", 0, UINT32_MAX, &mValue); + ModelCommand::AddArguments(); + } + + ~WritePumpConfigurationAndControlPower() + { + delete onSuccessCallback; + delete onFailureCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0200) command (0x01) on endpoint %" PRIu8, endpointId); + + chip::Controller::PumpConfigurationAndControlCluster cluster; + cluster.Associate(device, endpointId); + return cluster.WriteAttributePower(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnDefaultSuccessResponse, this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); + uint32_t mValue; +}; + +class ReportPumpConfigurationAndControlPower : public ModelCommand +{ +public: + ReportPumpConfigurationAndControlPower() : ModelCommand("report") + { + AddArgument("attr-name", "power"); + AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); + AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); + AddArgument("wait", 0, 1, &mWait); + ModelCommand::AddArguments(); + } + + ~ReportPumpConfigurationAndControlPower() + { + delete onSuccessCallback; + delete onSuccessCallbackWithoutExit; + delete onFailureCallback; + delete onReportCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0200) command (0x06) on endpoint %" PRIu8, endpointId); + + chip::Controller::PumpConfigurationAndControlCluster cluster; + cluster.Associate(device, endpointId); + + ReturnErrorOnFailure(cluster.ReportAttributePower(onReportCallback->Cancel())); + + chip::Callback::Cancelable * successCallback = mWait ? onSuccessCallbackWithoutExit->Cancel() : onSuccessCallback->Cancel(); + return cluster.SubscribeAttributePower(successCallback, onFailureCallback->Cancel(), mMinInterval, mMaxInterval); + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnDefaultSuccessResponse, this); + chip::Callback::Callback * onSuccessCallbackWithoutExit = + new chip::Callback::Callback(OnDefaultSuccessResponseWithoutExit, this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); + chip::Callback::Callback * onReportCallback = + new chip::Callback::Callback(OnInt32uAttributeReport, this); + uint16_t mMinInterval; + uint16_t mMaxInterval; + bool mWait; +}; + /* * Attribute LifetimeEnergyConsumed */ @@ -52461,6 +52702,12 @@ void registerClusterPumpConfigurationAndControl(Commands & commands) make_unique(), // make_unique(), // make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // make_unique(), // make_unique(), // make_unique(), // diff --git a/zzz_generated/chip-tool/zap-generated/reporting/Commands.h b/zzz_generated/chip-tool/zap-generated/reporting/Commands.h index d702ec986fc221..f631efd875c792 100644 --- a/zzz_generated/chip-tool/zap-generated/reporting/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/reporting/Commands.h @@ -274,6 +274,8 @@ class Listen : public ReportingCommand delete onReportPumpConfigurationAndControlEffectiveControlModeCallback; delete onReportPumpConfigurationAndControlCapacityCallback; delete onReportPumpConfigurationAndControlSpeedCallback; + delete onReportPumpConfigurationAndControlLifetimeRunningHoursCallback; + delete onReportPumpConfigurationAndControlPowerCallback; delete onReportPumpConfigurationAndControlLifetimeEnergyConsumedCallback; delete onReportPumpConfigurationAndControlOperationModeCallback; delete onReportPumpConfigurationAndControlControlModeCallback; @@ -1087,6 +1089,12 @@ class Listen : public ReportingCommand callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0200, 0x0014, onReportPumpConfigurationAndControlSpeedCallback->Cancel(), BasicAttributeFilter); + callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0200, 0x0015, + onReportPumpConfigurationAndControlLifetimeRunningHoursCallback->Cancel(), + BasicAttributeFilter); + callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0200, 0x0016, + onReportPumpConfigurationAndControlPowerCallback->Cancel(), + BasicAttributeFilter); callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0200, 0x0017, onReportPumpConfigurationAndControlLifetimeEnergyConsumedCallback->Cancel(), BasicAttributeFilter); @@ -2124,6 +2132,10 @@ class Listen : public ReportingCommand new chip::Callback::Callback(OnInt16sAttributeResponse, this); chip::Callback::Callback * onReportPumpConfigurationAndControlSpeedCallback = new chip::Callback::Callback(OnInt16uAttributeResponse, this); + chip::Callback::Callback * onReportPumpConfigurationAndControlLifetimeRunningHoursCallback = + new chip::Callback::Callback(OnInt32uAttributeResponse, this); + chip::Callback::Callback * onReportPumpConfigurationAndControlPowerCallback = + new chip::Callback::Callback(OnInt32uAttributeResponse, this); chip::Callback::Callback * onReportPumpConfigurationAndControlLifetimeEnergyConsumedCallback = new chip::Callback::Callback(OnInt32uAttributeResponse, this); chip::Callback::Callback * onReportPumpConfigurationAndControlOperationModeCallback = diff --git a/zzz_generated/controller-clusters/zap-generated/CHIPClusters.cpp b/zzz_generated/controller-clusters/zap-generated/CHIPClusters.cpp index 1d5ac2ffcfdcc8..7d1cdffe12727f 100644 --- a/zzz_generated/controller-clusters/zap-generated/CHIPClusters.cpp +++ b/zzz_generated/controller-clusters/zap-generated/CHIPClusters.cpp @@ -13602,6 +13602,86 @@ CHIP_ERROR PumpConfigurationAndControlCluster::ReportAttributeSpeed(Callback::Ca BasicAttributeFilter); } +CHIP_ERROR PumpConfigurationAndControlCluster::ReadAttributeLifetimeRunningHours(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + app::AttributePathParams attributePath; + attributePath.mEndpointId = mEndpoint; + attributePath.mClusterId = mClusterId; + attributePath.mAttributeId = 0x00000015; + return mDevice->SendReadAttributeRequest(attributePath, onSuccessCallback, onFailureCallback, + BasicAttributeFilter); +} + +CHIP_ERROR PumpConfigurationAndControlCluster::WriteAttributeLifetimeRunningHours(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, + uint32_t value) +{ + app::WriteClientHandle handle; + ReturnErrorOnFailure( + app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); + ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( + chip::app::AttributePathParams(mEndpoint, mClusterId, PumpConfigurationAndControl::Attributes::LifetimeRunningHours::Id), + value)); + return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR PumpConfigurationAndControlCluster::SubscribeAttributeLifetimeRunningHours(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, + uint16_t minInterval, uint16_t maxInterval) +{ + chip::app::AttributePathParams attributePath; + attributePath.mEndpointId = mEndpoint; + attributePath.mClusterId = mClusterId; + attributePath.mAttributeId = PumpConfigurationAndControl::Attributes::LifetimeRunningHours::Id; + return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR PumpConfigurationAndControlCluster::ReportAttributeLifetimeRunningHours(Callback::Cancelable * onReportCallback) +{ + return RequestAttributeReporting(PumpConfigurationAndControl::Attributes::LifetimeRunningHours::Id, onReportCallback, + BasicAttributeFilter); +} + +CHIP_ERROR PumpConfigurationAndControlCluster::ReadAttributePower(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + app::AttributePathParams attributePath; + attributePath.mEndpointId = mEndpoint; + attributePath.mClusterId = mClusterId; + attributePath.mAttributeId = 0x00000016; + return mDevice->SendReadAttributeRequest(attributePath, onSuccessCallback, onFailureCallback, + BasicAttributeFilter); +} + +CHIP_ERROR PumpConfigurationAndControlCluster::WriteAttributePower(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, uint32_t value) +{ + app::WriteClientHandle handle; + ReturnErrorOnFailure( + app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); + ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( + chip::app::AttributePathParams(mEndpoint, mClusterId, PumpConfigurationAndControl::Attributes::Power::Id), value)); + return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR PumpConfigurationAndControlCluster::SubscribeAttributePower(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, + uint16_t minInterval, uint16_t maxInterval) +{ + chip::app::AttributePathParams attributePath; + attributePath.mEndpointId = mEndpoint; + attributePath.mClusterId = mClusterId; + attributePath.mAttributeId = PumpConfigurationAndControl::Attributes::Power::Id; + return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR PumpConfigurationAndControlCluster::ReportAttributePower(Callback::Cancelable * onReportCallback) +{ + return RequestAttributeReporting(PumpConfigurationAndControl::Attributes::Power::Id, onReportCallback, + BasicAttributeFilter); +} + CHIP_ERROR PumpConfigurationAndControlCluster::ReadAttributeLifetimeEnergyConsumed(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback) { diff --git a/zzz_generated/controller-clusters/zap-generated/CHIPClusters.h b/zzz_generated/controller-clusters/zap-generated/CHIPClusters.h index 20e224d54467c4..fa9a41465844d6 100644 --- a/zzz_generated/controller-clusters/zap-generated/CHIPClusters.h +++ b/zzz_generated/controller-clusters/zap-generated/CHIPClusters.h @@ -1869,6 +1869,9 @@ class DLL_EXPORT PumpConfigurationAndControlCluster : public ClusterBase Callback::Cancelable * onFailureCallback); CHIP_ERROR ReadAttributeCapacity(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); CHIP_ERROR ReadAttributeSpeed(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR ReadAttributeLifetimeRunningHours(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback); + CHIP_ERROR ReadAttributePower(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); CHIP_ERROR ReadAttributeLifetimeEnergyConsumed(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); CHIP_ERROR ReadAttributeOperationMode(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); @@ -1876,6 +1879,10 @@ class DLL_EXPORT PumpConfigurationAndControlCluster : public ClusterBase CHIP_ERROR ReadAttributeAlarmMask(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); CHIP_ERROR ReadAttributeFeatureMap(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); CHIP_ERROR ReadAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR WriteAttributeLifetimeRunningHours(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, uint32_t value); + CHIP_ERROR WriteAttributePower(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint32_t value); CHIP_ERROR WriteAttributeOperationMode(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, uint8_t value); CHIP_ERROR WriteAttributeControlMode(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, @@ -1938,6 +1945,13 @@ class DLL_EXPORT PumpConfigurationAndControlCluster : public ClusterBase CHIP_ERROR SubscribeAttributeSpeed(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, uint16_t minInterval, uint16_t maxInterval); CHIP_ERROR ReportAttributeSpeed(Callback::Cancelable * onReportCallback); + CHIP_ERROR SubscribeAttributeLifetimeRunningHours(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, uint16_t minInterval, + uint16_t maxInterval); + CHIP_ERROR ReportAttributeLifetimeRunningHours(Callback::Cancelable * onReportCallback); + CHIP_ERROR SubscribeAttributePower(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint16_t minInterval, uint16_t maxInterval); + CHIP_ERROR ReportAttributePower(Callback::Cancelable * onReportCallback); CHIP_ERROR SubscribeAttributeLifetimeEnergyConsumed(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, uint16_t minInterval, uint16_t maxInterval);