From 0d1826116c3596ab81348b901bc2be15b978d0af Mon Sep 17 00:00:00 2001 From: Jean-Francois Penven Date: Fri, 12 Jan 2024 22:01:43 +0000 Subject: [PATCH] Pull request #1490: Add missing boards and sample app in CI Merge in WMN_TOOLS/matter from ci_add_sample_app_and_boards to silabs Squashed commit of the following: commit 9ca684e6801158140b6e3f9a1b532d8d86dae354 Author: Junior Martinez <67972863+jmartinez-silabs@users.noreply.github.com> Date: Fri Jan 12 15:43:16 2024 -0500 Fix dishwasher operation-state-degate-impl due to change to the CSA delegate commit a354504499ed4e1b9b4f49d82540ddee4f5c98e0 Author: jepenven-silabs Date: Fri Jan 12 15:05:53 2024 -0500 fis path diswasher commit 9b4555642323e405e0fa65465b2cf8d38c507b7f Author: jepenven-silabs Date: Fri Jan 12 12:01:03 2024 -0500 Add missing boards and sample app in CI --- .../include/operational-state-delegate-impl.h | 18 ++++++++---------- .../src/operational-state-delegate-impl.cpp | 7 +++---- 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/silabs_examples/dishwasher-app/silabs/include/operational-state-delegate-impl.h b/silabs_examples/dishwasher-app/silabs/include/operational-state-delegate-impl.h index 4fe80adccdc005..92dc69e932d220 100644 --- a/silabs_examples/dishwasher-app/silabs/include/operational-state-delegate-impl.h +++ b/silabs_examples/dishwasher-app/silabs/include/operational-state-delegate-impl.h @@ -51,12 +51,16 @@ class OperationalStateDelegate : public Delegate /** * Get the list of supported operational phases. - * Fills in the provided GenericOperationalPhase with the phase at index `index` if there is one, + * Fills in the provided MutableCharSpan with the phase at index `index` if there is one, * or returns CHIP_ERROR_NOT_FOUND if the index is out of range for the list of phases. + * + * If CHIP_ERROR_NOT_FOUND is returned for index 0, that indicates that the PhaseList attribute is null + * (there are no phases defined at all). + * * @param index The index of the phase, with 0 representing the first phase. - * @param operationalPhase The GenericOperationalPhase is filled. + * @param operationalPhase The MutableCharSpan is filled. */ - CHIP_ERROR GetOperationalPhaseAtIndex(size_t index, GenericOperationalPhase & operationalPhase) override; + CHIP_ERROR GetOperationalPhaseAtIndex(size_t index, MutableCharSpan & operationalPhase) override; // command callback /** @@ -103,13 +107,7 @@ class OperationalStateDelegate : public Delegate }; app::DataModel::List mOperationalStateList = Span(rvcOpStateList); - - const GenericOperationalPhase opPhaseList[1] = { - // Phase List is null - GenericOperationalPhase(DataModel::Nullable()), - }; - - Span mOperationalPhaseList = Span(opPhaseList); + const Span mOperationalPhaseList; }; OperationalState::Instance* GetInstance(); diff --git a/silabs_examples/dishwasher-app/silabs/src/operational-state-delegate-impl.cpp b/silabs_examples/dishwasher-app/silabs/src/operational-state-delegate-impl.cpp index 00221a72beaad6..07723470683f01 100644 --- a/silabs_examples/dishwasher-app/silabs/src/operational-state-delegate-impl.cpp +++ b/silabs_examples/dishwasher-app/silabs/src/operational-state-delegate-impl.cpp @@ -35,14 +35,13 @@ CHIP_ERROR OperationalStateDelegate::GetOperationalStateAtIndex(size_t index, Ge return CHIP_NO_ERROR; } -CHIP_ERROR OperationalStateDelegate::GetOperationalPhaseAtIndex(size_t index, GenericOperationalPhase & operationalPhase) +CHIP_ERROR OperationalStateDelegate::GetOperationalPhaseAtIndex(size_t index, MutableCharSpan & operationalPhase) { - if (index > mOperationalPhaseList.size() - 1) + if (index >= mOperationalPhaseList.size()) { return CHIP_ERROR_NOT_FOUND; } - operationalPhase = mOperationalPhaseList[index]; - return CHIP_NO_ERROR; + return CopyCharSpanToMutableCharSpan(mOperationalPhaseList[index], operationalPhase); } void OperationalStateDelegate::HandlePauseStateCallback(GenericOperationalError & err)