Skip to content

Commit 18775b8

Browse files
Merge master conflicts
2 parents 2600a51 + e4502c3 commit 18775b8

File tree

153 files changed

+2382
-841
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

153 files changed

+2382
-841
lines changed

examples/air-purifier-app/air-purifier-common/air-purifier-app.zap

+1-1
Original file line numberDiff line numberDiff line change
@@ -7970,7 +7970,7 @@
79707970
"code": 18,
79717971
"mfgCode": null,
79727972
"side": "server",
7973-
"type": "int16s",
7973+
"type": "temperature",
79747974
"included": 1,
79757975
"storageOption": "RAM",
79767976
"singleton": 0,

examples/all-clusters-app/all-clusters-common/all-clusters-app.matter

+3-3
Original file line numberDiff line numberDiff line change
@@ -9168,10 +9168,10 @@ endpoint 1 {
91689168
ram attribute colorLoopStartEnhancedHue default = 0x2300;
91699169
ram attribute colorLoopStoredEnhancedHue default = 0x0000;
91709170
ram attribute colorCapabilities default = 0x1F;
9171-
ram attribute colorTempPhysicalMinMireds default = 0x0000;
9172-
ram attribute colorTempPhysicalMaxMireds default = 0xFEFF;
9171+
ram attribute colorTempPhysicalMinMireds default = 0x009A;
9172+
ram attribute colorTempPhysicalMaxMireds default = 0x01C6;
91739173
ram attribute coupleColorTempToLevelMinMireds;
9174-
persist attribute startUpColorTemperatureMireds;
9174+
persist attribute startUpColorTemperatureMireds default = 0x00FA;
91759175
ram attribute featureMap default = 0x1F;
91769176
ram attribute clusterRevision default = 7;
91779177

examples/all-clusters-app/all-clusters-common/all-clusters-app.zap

+10-10
Original file line numberDiff line numberDiff line change
@@ -13445,7 +13445,7 @@
1344513445
"code": 0,
1344613446
"mfgCode": null,
1344713447
"side": "server",
13448-
"type": "WaterHeaterTypeBitmap",
13448+
"type": "WaterHeaterHeatSourceBitmap",
1344913449
"included": 1,
1345013450
"storageOption": "External",
1345113451
"singleton": 0,
@@ -13461,7 +13461,7 @@
1346113461
"code": 1,
1346213462
"mfgCode": null,
1346313463
"side": "server",
13464-
"type": "WaterHeaterDemandBitmap",
13464+
"type": "WaterHeaterHeatSourceBitmap",
1346513465
"included": 1,
1346613466
"storageOption": "External",
1346713467
"singleton": 0,
@@ -17507,7 +17507,7 @@
1750717507
"code": 5,
1750817508
"mfgCode": null,
1750917509
"side": "server",
17510-
"type": "enum8",
17510+
"type": "DriftCompensationEnum",
1751117511
"included": 1,
1751217512
"storageOption": "RAM",
1751317513
"singleton": 0,
@@ -17555,7 +17555,7 @@
1755517555
"code": 8,
1755617556
"mfgCode": null,
1755717557
"side": "server",
17558-
"type": "enum8",
17558+
"type": "ColorModeEnum",
1755917559
"included": 1,
1756017560
"storageOption": "RAM",
1756117561
"singleton": 0,
@@ -17571,7 +17571,7 @@
1757117571
"code": 15,
1757217572
"mfgCode": null,
1757317573
"side": "server",
17574-
"type": "bitmap8",
17574+
"type": "OptionsBitmap",
1757517575
"included": 1,
1757617576
"storageOption": "RAM",
1757717577
"singleton": 0,
@@ -18083,7 +18083,7 @@
1808318083
"code": 16385,
1808418084
"mfgCode": null,
1808518085
"side": "server",
18086-
"type": "enum8",
18086+
"type": "EnhancedColorModeEnum",
1808718087
"included": 1,
1808818088
"storageOption": "NVM",
1808918089
"singleton": 0,
@@ -18179,7 +18179,7 @@
1817918179
"code": 16394,
1818018180
"mfgCode": null,
1818118181
"side": "server",
18182-
"type": "bitmap16",
18182+
"type": "ColorCapabilitiesBitmap",
1818318183
"included": 1,
1818418184
"storageOption": "RAM",
1818518185
"singleton": 0,
@@ -18200,7 +18200,7 @@
1820018200
"storageOption": "RAM",
1820118201
"singleton": 0,
1820218202
"bounded": 0,
18203-
"defaultValue": "0x0000",
18203+
"defaultValue": "0x009A",
1820418204
"reportable": 1,
1820518205
"minInterval": 0,
1820618206
"maxInterval": 65344,
@@ -18216,7 +18216,7 @@
1821618216
"storageOption": "RAM",
1821718217
"singleton": 0,
1821818218
"bounded": 0,
18219-
"defaultValue": "0xFEFF",
18219+
"defaultValue": "0x01C6",
1822018220
"reportable": 1,
1822118221
"minInterval": 0,
1822218222
"maxInterval": 65344,
@@ -18248,7 +18248,7 @@
1824818248
"storageOption": "NVM",
1824918249
"singleton": 0,
1825018250
"bounded": 0,
18251-
"defaultValue": "",
18251+
"defaultValue": "0x00FA",
1825218252
"reportable": 1,
1825318253
"minInterval": 0,
1825418254
"maxInterval": 65344,

examples/all-clusters-app/esp32/main/CMakeLists.txt

+2
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ set(PRIV_INCLUDE_DIRS_LIST
2222
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/energy-management-app/energy-management-common/device-energy-management/include"
2323
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/energy-management-app/energy-management-common/energy-evse/include"
2424
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/energy-management-app/energy-management-common/energy-reporting/include"
25+
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/energy-management-app/energy-management-common/water-heater/include"
2526
"${CMAKE_CURRENT_LIST_DIR}/include"
2627
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/providers"
2728
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/platform/esp32"
@@ -36,6 +37,7 @@ set(SRC_DIRS_LIST
3637
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/energy-management-app/energy-management-common/device-energy-management/src"
3738
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/energy-management-app/energy-management-common/energy-evse/src"
3839
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/energy-management-app/energy-management-common/energy-reporting/src"
40+
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/energy-management-app/energy-management-common/water-heater/src"
3941
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/providers"
4042
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/platform/esp32/ota"
4143
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/platform/esp32/common"

examples/all-clusters-app/linux/BUILD.gn

+6-5
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,6 @@ if (chip_enable_pw_rpc) {
2929

3030
source_set("chip-all-clusters-common") {
3131
sources = [
32-
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/WhmDelegateImpl.cpp",
33-
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/WhmInstance.cpp",
34-
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/WhmMain.cpp",
35-
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/WhmManufacturer.cpp",
3632
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/air-quality-instance.cpp",
3733
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/binding-handler.cpp",
3834
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/boolcfg-stub.cpp",
@@ -62,7 +58,6 @@ source_set("chip-all-clusters-common") {
6258
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/static-supported-modes-manager.cpp",
6359
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/static-supported-temperature-levels.cpp",
6460
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/tcc-mode.cpp",
65-
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/water-heater-mode.cpp",
6661
"${chip_root}/examples/all-clusters-app/linux/diagnostic-logs-provider-delegate-impl.cpp",
6762
"${chip_root}/examples/energy-management-app/energy-management-common/common/src/EnergyTimeUtils.cpp",
6863
"${chip_root}/examples/energy-management-app/energy-management-common/device-energy-management/src/DeviceEnergyManagementDelegateImpl.cpp",
@@ -75,6 +70,11 @@ source_set("chip-all-clusters-common") {
7570
"${chip_root}/examples/energy-management-app/energy-management-common/energy-evse/src/EnergyEvseTargetsStore.cpp",
7671
"${chip_root}/examples/energy-management-app/energy-management-common/energy-evse/src/energy-evse-mode.cpp",
7772
"${chip_root}/examples/energy-management-app/energy-management-common/energy-reporting/src/ElectricalPowerMeasurementDelegate.cpp",
73+
"${chip_root}/examples/energy-management-app/energy-management-common/water-heater/src/WhmDelegateImpl.cpp",
74+
"${chip_root}/examples/energy-management-app/energy-management-common/water-heater/src/WhmInstance.cpp",
75+
"${chip_root}/examples/energy-management-app/energy-management-common/water-heater/src/WhmMain.cpp",
76+
"${chip_root}/examples/energy-management-app/energy-management-common/water-heater/src/WhmManufacturer.cpp",
77+
"${chip_root}/examples/energy-management-app/energy-management-common/water-heater/src/water-heater-mode.cpp",
7878
"${chip_root}/examples/thermostat/thermostat-common/src/thermostat-delegate-impl.cpp",
7979
"AllClustersCommandDelegate.cpp",
8080
"AllClustersCommandDelegate.h",
@@ -102,6 +102,7 @@ source_set("chip-all-clusters-common") {
102102
"${chip_root}/examples/energy-management-app/energy-management-common/device-energy-management/include",
103103
"${chip_root}/examples/energy-management-app/energy-management-common/energy-evse/include",
104104
"${chip_root}/examples/energy-management-app/energy-management-common/energy-reporting/include",
105+
"${chip_root}/examples/energy-management-app/energy-management-common/water-heater/include",
105106
"${chip_root}/examples/thermostat/thermostat-common/include",
106107
]
107108

examples/all-clusters-app/linux/main-common.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,6 @@ void ApplicationShutdown()
285285
Clusters::WaterHeaterMode::Shutdown();
286286

287287
Clusters::WaterHeaterManagement::WhmApplicationShutdown();
288-
Clusters::WaterHeaterMode::Shutdown();
289288

290289
if (sChipNamedPipeCommands.Stop() != CHIP_NO_ERROR)
291290
{

examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.zap

+11-11
Original file line numberDiff line numberDiff line change
@@ -6932,7 +6932,7 @@
69326932
"code": 18,
69336933
"mfgCode": null,
69346934
"side": "server",
6935-
"type": "int16s",
6935+
"type": "temperature",
69366936
"included": 1,
69376937
"storageOption": "RAM",
69386938
"singleton": 0,
@@ -7202,7 +7202,7 @@
72027202
"code": 8,
72037203
"mfgCode": null,
72047204
"side": "server",
7205-
"type": "enum8",
7205+
"type": "ColorModeEnum",
72067206
"included": 1,
72077207
"storageOption": "RAM",
72087208
"singleton": 0,
@@ -7218,7 +7218,7 @@
72187218
"code": 15,
72197219
"mfgCode": null,
72207220
"side": "server",
7221-
"type": "bitmap8",
7221+
"type": "OptionsBitmap",
72227222
"included": 1,
72237223
"storageOption": "RAM",
72247224
"singleton": 0,
@@ -7250,7 +7250,7 @@
72507250
"code": 16385,
72517251
"mfgCode": null,
72527252
"side": "server",
7253-
"type": "enum8",
7253+
"type": "EnhancedColorModeEnum",
72547254
"included": 1,
72557255
"storageOption": "RAM",
72567256
"singleton": 0,
@@ -7266,7 +7266,7 @@
72667266
"code": 16394,
72677267
"mfgCode": null,
72687268
"side": "server",
7269-
"type": "bitmap16",
7269+
"type": "ColorCapabilitiesBitmap",
72707270
"included": 1,
72717271
"storageOption": "RAM",
72727272
"singleton": 0,
@@ -7995,10 +7995,10 @@
79957995
"side": "server",
79967996
"type": "bitmap32",
79977997
"included": 1,
7998-
"storageOption": "RAM",
7998+
"storageOption": "External",
79997999
"singleton": 0,
80008000
"bounded": 0,
8001-
"defaultValue": "0",
8001+
"defaultValue": null,
80028002
"reportable": 1,
80038003
"minInterval": 1,
80048004
"maxInterval": 65534,
@@ -9965,7 +9965,7 @@
99659965
"storageOption": "External",
99669966
"singleton": 0,
99679967
"bounded": 0,
9968-
"defaultValue": "",
9968+
"defaultValue": null,
99699969
"reportable": 1,
99709970
"minInterval": 1,
99719971
"maxInterval": 65534,
@@ -10541,7 +10541,7 @@
1054110541
"storageOption": "External",
1054210542
"singleton": 0,
1054310543
"bounded": 0,
10544-
"defaultValue": "",
10544+
"defaultValue": null,
1054510545
"reportable": 1,
1054610546
"minInterval": 1,
1054710547
"maxInterval": 65534,
@@ -11917,10 +11917,10 @@
1191711917
"side": "server",
1191811918
"type": "bitmap32",
1191911919
"included": 1,
11920-
"storageOption": "RAM",
11920+
"storageOption": "External",
1192111921
"singleton": 0,
1192211922
"bounded": 0,
11923-
"defaultValue": "0",
11923+
"defaultValue": null,
1192411924
"reportable": 1,
1192511925
"minInterval": 1,
1192611926
"maxInterval": 65534,

examples/chef/common/clusters/media-input/MediaInputManager.cpp

+39-12
Original file line numberDiff line numberDiff line change
@@ -15,27 +15,26 @@
1515
* limitations under the License.
1616
*/
1717

18+
#include <app-common/zap-generated/attributes/Accessors.h>
1819
#include <app/util/config.h>
20+
#include <map>
21+
1922
#ifdef MATTER_DM_PLUGIN_MEDIA_INPUT_SERVER
2023
#include "MediaInputManager.h"
2124

2225
using namespace std;
2326
using namespace chip;
2427
using namespace chip::app::Clusters::MediaInput;
28+
using Protocols::InteractionModel::Status;
2529

26-
MediaInputManager::MediaInputManager()
30+
MediaInputManager::MediaInputManager(chip::EndpointId endpoint) : mEndpoint(endpoint)
2731
{
28-
struct InputData inputData1(1, chip::app::Clusters::MediaInput::InputTypeEnum::kHdmi, "HDMI 1",
29-
"High-Definition Multimedia Interface");
32+
struct InputData inputData1(1, InputTypeEnum::kHdmi, "HDMI 1", "High-Definition Multimedia Interface");
3033
mInputs.push_back(inputData1);
31-
struct InputData inputData2(2, chip::app::Clusters::MediaInput::InputTypeEnum::kHdmi, "HDMI 2",
32-
"High-Definition Multimedia Interface");
34+
struct InputData inputData2(2, InputTypeEnum::kHdmi, "HDMI 2", "High-Definition Multimedia Interface");
3335
mInputs.push_back(inputData2);
34-
struct InputData inputData3(3, chip::app::Clusters::MediaInput::InputTypeEnum::kHdmi, "HDMI 3",
35-
"High-Definition Multimedia Interface");
36+
struct InputData inputData3(3, InputTypeEnum::kHdmi, "HDMI 3", "High-Definition Multimedia Interface");
3637
mInputs.push_back(inputData3);
37-
38-
mCurrentInput = 1;
3938
}
4039

4140
CHIP_ERROR MediaInputManager::HandleGetInputList(chip::app::AttributeValueEncoder & aEncoder)
@@ -51,16 +50,32 @@ CHIP_ERROR MediaInputManager::HandleGetInputList(chip::app::AttributeValueEncode
5150

5251
uint8_t MediaInputManager::HandleGetCurrentInput()
5352
{
54-
return mCurrentInput;
53+
uint8_t currentInput = 1;
54+
Status status = Attributes::CurrentInput::Get(mEndpoint, &currentInput);
55+
if (Status::Success != status)
56+
{
57+
ChipLogError(Zcl, "Unable to get CurrentInput attribute, err:0x%x", to_underlying(status));
58+
}
59+
return currentInput;
5560
}
5661

5762
bool MediaInputManager::HandleSelectInput(const uint8_t index)
5863
{
64+
if (HandleGetCurrentInput() == index)
65+
{
66+
ChipLogProgress(Zcl, "CurrentInput is same as new value: %u", index);
67+
return true;
68+
}
5969
for (auto const & inputData : mInputs)
6070
{
6171
if (inputData.index == index)
6272
{
63-
mCurrentInput = index;
73+
// Sync the CurrentInput to attribute storage while reporting changes
74+
Status status = Attributes::CurrentInput::Set(mEndpoint, index);
75+
if (Status::Success != status)
76+
{
77+
ChipLogError(Zcl, "CurrentInput is not stored successfully, err:0x%x", to_underlying(status));
78+
}
6479
return true;
6580
}
6681
}
@@ -70,11 +85,12 @@ bool MediaInputManager::HandleSelectInput(const uint8_t index)
7085

7186
bool MediaInputManager::HandleShowInputStatus()
7287
{
88+
uint8_t currentInput = HandleGetCurrentInput();
7389
ChipLogProgress(Zcl, " MediaInputManager::HandleShowInputStatus()");
7490
for (auto const & inputData : mInputs)
7591
{
7692
ChipLogProgress(Zcl, " [%d] type=%d selected=%d name=%s desc=%s", inputData.index,
77-
static_cast<uint16_t>(inputData.inputType), (mCurrentInput == inputData.index ? 1 : 0),
93+
static_cast<uint16_t>(inputData.inputType), (currentInput == inputData.index ? 1 : 0),
7894
inputData.name.c_str(), inputData.description.c_str());
7995
}
8096
return true;
@@ -99,4 +115,15 @@ bool MediaInputManager::HandleRenameInput(const uint8_t index, const chip::CharS
99115

100116
return false;
101117
}
118+
119+
static std::map<chip::EndpointId, std::unique_ptr<MediaInputManager>> gMediaInputManagerInstance{};
120+
121+
void emberAfMediaInputClusterInitCallback(EndpointId endpoint)
122+
{
123+
ChipLogProgress(Zcl, "TV Linux App: MediaInput::SetDefaultDelegate, endpoint=%x", endpoint);
124+
125+
gMediaInputManagerInstance[endpoint] = std::make_unique<MediaInputManager>(endpoint);
126+
127+
SetDefaultDelegate(endpoint, gMediaInputManagerInstance[endpoint].get());
128+
}
102129
#endif // MATTER_DM_PLUGIN_MEDIA_INPUT_SERVER

examples/chef/common/clusters/media-input/MediaInputManager.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class MediaInputManager : public chip::app::Clusters::MediaInput::Delegate
2929
using InputInfoType = chip::app::Clusters::MediaInput::Structs::InputInfoStruct::Type;
3030

3131
public:
32-
MediaInputManager();
32+
MediaInputManager(chip::EndpointId endpoint);
3333

3434
CHIP_ERROR HandleGetInputList(chip::app::AttributeValueEncoder & aEncoder) override;
3535
uint8_t HandleGetCurrentInput() override;
@@ -63,7 +63,7 @@ class MediaInputManager : public chip::app::Clusters::MediaInput::Delegate
6363
};
6464

6565
protected:
66-
uint8_t mCurrentInput;
66+
chip::EndpointId mEndpoint;
6767
std::vector<InputData> mInputs;
6868

6969
private:

0 commit comments

Comments
 (0)