From be8567b4caa690d15e51a1305a476dce979dfe05 Mon Sep 17 00:00:00 2001 From: Sergei Lissianoi <54454955+selissia@users.noreply.github.com> Date: Mon, 3 Oct 2022 16:51:28 -0400 Subject: [PATCH] In emberAfEndpointConfigure() change endpoint ID to a uint16_t (#22998) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Test added march 8 (#15957) * Added new manual scripts * Added Auto generated File * [OTA] Fix OTARequestorDriverImpl inclusion (#15981) * Regen to fix CI failures (#15990) * [ota] Store Default OTA Providers in flash (#15970) * [ota] Store Default OTA Providers in flash Store Default OTA Providers in flash each time the attribute is modified and load it back on the application startup. * Restyled by clang-format * Fix build and reduce flash usage Co-authored-by: Restyled.io * Remove merge artifacts * Cast boolean to uint8_t as setOnOffValue expects, fixes GCC 8.3 error * Make endpoint id a uint16_t as per spec * Restyled by clang-format * Update the signature of OnOffServer::setOnOffValue() to avoid casts * Fix printf argument and formatting Co-authored-by: kowsisoundhar12 <57476670+kowsisoundhar12@users.noreply.github.com> Co-authored-by: Carol Yang Co-authored-by: Boris Zbarsky Co-authored-by: Damian Królik <66667989+Damian-Nordic@users.noreply.github.com> Co-authored-by: Restyled.io --- src/app/clusters/on-off-server/on-off-server.cpp | 4 ++-- src/app/clusters/on-off-server/on-off-server.h | 2 +- src/app/util/attribute-storage.cpp | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/app/clusters/on-off-server/on-off-server.cpp b/src/app/clusters/on-off-server/on-off-server.cpp index b24ee63efe9042..97fd873ccae479 100644 --- a/src/app/clusters/on-off-server/on-off-server.cpp +++ b/src/app/clusters/on-off-server/on-off-server.cpp @@ -109,12 +109,12 @@ EmberAfStatus OnOffServer::getOnOffValue(chip::EndpointId endpoint, bool * curre * @param command Ver.: always * @param initiatedByLevelChange Ver.: always */ -EmberAfStatus OnOffServer::setOnOffValue(chip::EndpointId endpoint, uint8_t command, bool initiatedByLevelChange) +EmberAfStatus OnOffServer::setOnOffValue(chip::EndpointId endpoint, chip::CommandId command, bool initiatedByLevelChange) { EmberAfStatus status; bool currentValue, newValue; - emberAfOnOffClusterPrintln("On/Off set value: %x %x", endpoint, command); + emberAfOnOffClusterPrintln("On/Off set value: %x %x", endpoint, static_cast(command)); // read current on/off value status = Attributes::OnOff::Get(endpoint, ¤tValue); diff --git a/src/app/clusters/on-off-server/on-off-server.h b/src/app/clusters/on-off-server/on-off-server.h index 61c95278c58387..71c793691e741b 100644 --- a/src/app/clusters/on-off-server/on-off-server.h +++ b/src/app/clusters/on-off-server/on-off-server.h @@ -59,7 +59,7 @@ class OnOffServer const chip::app::Clusters::OnOff::Commands::OnWithTimedOff::DecodableType & commandData); void updateOnOffTimeCommand(chip::EndpointId endpoint); EmberAfStatus getOnOffValue(chip::EndpointId endpoint, bool * currentOnOffValue); - EmberAfStatus setOnOffValue(chip::EndpointId endpoint, uint8_t command, bool initiatedByLevelChange); + EmberAfStatus setOnOffValue(chip::EndpointId endpoint, chip::CommandId command, bool initiatedByLevelChange); EmberAfStatus getOnOffValueForStartUp(chip::EndpointId endpoint, bool & onOffValueForStartUp); bool HasFeature(chip::EndpointId endpoint, OnOffFeature feature); diff --git a/src/app/util/attribute-storage.cpp b/src/app/util/attribute-storage.cpp index 26740c922ec2bf..709e95c7d6fa22 100644 --- a/src/app/util/attribute-storage.cpp +++ b/src/app/util/attribute-storage.cpp @@ -129,7 +129,7 @@ static uint16_t findClusterEndpointIndex(EndpointId endpoint, ClusterId clusterI // Initial configuration void emberAfEndpointConfigure(void) { - uint8_t ep; + uint16_t ep; #if !defined(EMBER_SCRIPTED_TEST) uint16_t fixedEndpoints[] = FIXED_ENDPOINT_ARRAY;