-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[NXP][rw61x] Diagnostic log, factory data storage, ICD, fixes (#35576)
* [NXP][cli][common] Enabled lwip and ephemeral key CLI addons in Matter shell (cherry picked from commit 01477f70a674691aa3f8957df09955ad94db4372) * [NXP][examples][common]Add diagnostic logs support for thermostat app Signed-off-by: Martin Girardot <[email protected]> (cherry picked from commit 278973079fee7357c0d60b2cf2d10730c82e4497) * [NXP][examples][laundry-washer] Fix Matter 1.3 certifiction TC-TCTL-3.3 case that SupportedTemperatureLevel should not be empty Signed-off-by: Chin-Ran Lo <[email protected]> (cherry picked from commit c46f6ceb2bc2c6708ba62663ab53a86215691052) * [NXP][examples][common] Fix laundry-washer app Identify cluster issue on endepoint 0 Signed-off-by: Chin-Ran Lo <[email protected]> (cherry picked from commit 3f2d5f7cafce98761393f1db17f46c9590bb600a) * [NXP][examples][common] Add laundry wahser mode file Signed-off-by: Martin Girardot <[email protected]> (cherry picked from commit a73da0d7e757b1b908470a3136761de58b9de08a) * [NXP][examples][rw61x] update laundry washer mode file path, add icd support Signed-off-by: Martin Girardot <[email protected]> (cherry picked from commit 1f2b75325595951d389403d82180dd74152a85dc) * [NXP][examples][rw61x] Enable Disgnostic log for thermostat app Signed-off-by: Martin Girardot <[email protected]> (cherry picked from commit c10f479ab9bff6b16a595448c3c03ced17f4d725) * [NXP][examples][rw61x] Update thermostat and laundry washer example for new factory data protection option Signed-off-by: Martin Girardot <[email protected]> * Restyled by clang-format * Restyled by gn * [NXP] fix PR comments: spelling, delete identify on endpoint 0 Signed-off-by: Martin Girardot <[email protected]> --------- Signed-off-by: Martin Girardot <[email protected]> Co-authored-by: Marius Preda <[email protected]> Co-authored-by: Chin-Ran Lo <[email protected]> Co-authored-by: Restyled.io <[email protected]>
- Loading branch information
1 parent
e6a6425
commit 1d6b0a5
Showing
9 changed files
with
181 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
104 changes: 104 additions & 0 deletions
104
examples/laundry-washer-app/nxp/common/main/laundry-washer-mode.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
/* | ||
* | ||
* Copyright (c) 2023 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. | ||
*/ | ||
#include <app-common/zap-generated/attributes/Accessors.h> | ||
#include <laundry-washer-mode.h> | ||
|
||
using namespace chip::app::Clusters; | ||
using namespace chip::app::Clusters::LaundryWasherMode; | ||
using chip::Protocols::InteractionModel::Status; | ||
template <typename T> | ||
using List = chip::app::DataModel::List<T>; | ||
using ModeTagStructType = chip::app::Clusters::detail::Structs::ModeTagStruct::Type; | ||
|
||
static LaundryWasherModeDelegate * gLaundryWasherModeDelegate = nullptr; | ||
static ModeBase::Instance * gLaundryWasherModeInstance = nullptr; | ||
|
||
CHIP_ERROR LaundryWasherModeDelegate::Init() | ||
{ | ||
return CHIP_NO_ERROR; | ||
} | ||
|
||
void LaundryWasherModeDelegate::HandleChangeToMode(uint8_t NewMode, ModeBase::Commands::ChangeToModeResponse::Type & response) | ||
{ | ||
response.status = to_underlying(ModeBase::StatusCode::kSuccess); | ||
} | ||
|
||
CHIP_ERROR LaundryWasherModeDelegate::GetModeLabelByIndex(uint8_t modeIndex, chip::MutableCharSpan & label) | ||
{ | ||
if (modeIndex >= ArraySize(kModeOptions)) | ||
{ | ||
return CHIP_ERROR_PROVIDER_LIST_EXHAUSTED; | ||
} | ||
return chip::CopyCharSpanToMutableCharSpan(kModeOptions[modeIndex].label, label); | ||
} | ||
|
||
CHIP_ERROR LaundryWasherModeDelegate::GetModeValueByIndex(uint8_t modeIndex, uint8_t & value) | ||
{ | ||
if (modeIndex >= ArraySize(kModeOptions)) | ||
{ | ||
return CHIP_ERROR_PROVIDER_LIST_EXHAUSTED; | ||
} | ||
value = kModeOptions[modeIndex].mode; | ||
return CHIP_NO_ERROR; | ||
} | ||
|
||
CHIP_ERROR LaundryWasherModeDelegate::GetModeTagsByIndex(uint8_t modeIndex, List<ModeTagStructType> & tags) | ||
{ | ||
if (modeIndex >= ArraySize(kModeOptions)) | ||
{ | ||
return CHIP_ERROR_PROVIDER_LIST_EXHAUSTED; | ||
} | ||
|
||
if (tags.size() < kModeOptions[modeIndex].modeTags.size()) | ||
{ | ||
return CHIP_ERROR_INVALID_ARGUMENT; | ||
} | ||
|
||
std::copy(kModeOptions[modeIndex].modeTags.begin(), kModeOptions[modeIndex].modeTags.end(), tags.begin()); | ||
tags.reduce_size(kModeOptions[modeIndex].modeTags.size()); | ||
|
||
return CHIP_NO_ERROR; | ||
} | ||
|
||
ModeBase::Instance * LaundryWasherMode::Instance() | ||
{ | ||
return gLaundryWasherModeInstance; | ||
} | ||
|
||
void LaundryWasherMode::Shutdown() | ||
{ | ||
if (gLaundryWasherModeInstance != nullptr) | ||
{ | ||
delete gLaundryWasherModeInstance; | ||
gLaundryWasherModeInstance = nullptr; | ||
} | ||
if (gLaundryWasherModeDelegate != nullptr) | ||
{ | ||
delete gLaundryWasherModeDelegate; | ||
gLaundryWasherModeDelegate = nullptr; | ||
} | ||
} | ||
|
||
void emberAfLaundryWasherModeClusterInitCallback(chip::EndpointId endpointId) | ||
{ | ||
VerifyOrDie(endpointId == 1); // this cluster is only enabled for endpoint 1. | ||
VerifyOrDie(gLaundryWasherModeDelegate == nullptr && gLaundryWasherModeInstance == nullptr); | ||
gLaundryWasherModeDelegate = new LaundryWasherMode::LaundryWasherModeDelegate; | ||
gLaundryWasherModeInstance = new ModeBase::Instance(gLaundryWasherModeDelegate, 0x1, LaundryWasherMode::Id, 0); | ||
gLaundryWasherModeInstance->Init(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters