Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 8e9adf0

Browse files
committedSep 17, 2024·
Resolve PR comments for dishwasher
1 parent b1f29a4 commit 8e9adf0

6 files changed

+16
-15
lines changed
 

‎examples/chef/common/chef-dishwasher-alarm-delegate-impl.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
*
3-
* Copyright (c) 2023 Project CHIP Authors
3+
* Copyright (c) 2024 Project CHIP Authors
44
* All rights reserved.
55
*
66
* Licensed under the Apache License, Version 2.0 (the "License");

‎examples/chef/common/chef-dishwasher-mode-delegate-impl.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
*
3-
* Copyright (c) 2023 Project CHIP Authors
3+
* Copyright (c) 2024 Project CHIP Authors
44
* All rights reserved.
55
*
66
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -107,7 +107,7 @@ chip::Protocols::InteractionModel::Status chefDishwasherModeWriteCallback(chip::
107107
ret = gDishwasherModeInstance->UpdateCurrentMode(m);
108108
if (chip::Protocols::InteractionModel::Status::Success != ret)
109109
{
110-
ChipLogError(DeviceLayer, "Invalid Attribute Update status: %d", static_cast<int>(ret));
110+
ChipLogError(DeviceLayer, "Invalid Attribute Write to CurrentMode : %d", static_cast<int>(ret));
111111
}
112112
}
113113
break;
@@ -124,7 +124,7 @@ chip::Protocols::InteractionModel::Status chefDishwasherModeReadCallback(chip::E
124124
const EmberAfAttributeMetadata * attributeMetadata,
125125
uint8_t * buffer, uint16_t maxReadLength)
126126
{
127-
VerifyOrReturnValue(maxReadLength > 0, chip::Protocols::InteractionModel::Status::ResourceExhausted);
127+
VerifyOrReturnValue(maxReadLength == 1 , chip::Protocols::InteractionModel::Status::ResourceExhausted);
128128
buffer[0] = gDishwasherModeInstance->GetCurrentMode();
129129

130130
chip::Protocols::InteractionModel::Status ret = chip::Protocols::InteractionModel::Status::Success;

‎examples/chef/common/chef-dishwasher-mode-delegate-impl.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
*
3-
* Copyright (c) 2023 Project CHIP Authors
3+
* Copyright (c) 2024 Project CHIP Authors
44
* All rights reserved.
55
*
66
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -87,4 +87,4 @@ chip::Protocols::InteractionModel::Status chefDishwasherModeWriteCallback(chip::
8787
chip::Protocols::InteractionModel::Status chefDishwasherModeReadCallback(chip::EndpointId endpoint, chip::ClusterId clusterId,
8888
const EmberAfAttributeMetadata * attributeMetadata,
8989
uint8_t * buffer, uint16_t maxReadLength);
90-
#endif
90+
#endif // MATTER_DM_PLUGIN_DISHWASHER_MODE_SERVER

‎examples/chef/common/chef-operational-state-delegate-impl.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2023 Project CHIP Authors
2+
* Copyright (c) 2024 Project CHIP Authors
33
* All rights reserved.
44
*
55
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -238,6 +238,7 @@ chip::Protocols::InteractionModel::Status chefOperationalStateWriteCallback(chip
238238
{
239239
gOperationalStateDelegate->mCountDownTime.SetNonNull(
240240
static_cast<uint32_t>(gOperationalStateDelegate->kExampleCountDown));
241+
(void) DeviceLayer::SystemLayer().StartTimer(System::Clock::Seconds16(1), onOperationalStateTimerTick, gOperationalStateDelegate);
241242
}
242243

243244
if (CHIP_NO_ERROR == err)
@@ -302,4 +303,4 @@ void emberAfOperationalStateClusterInitCallback(chip::EndpointId endpointId)
302303
gOperationalStateInstance->Init();
303304
}
304305

305-
#endif
306+
#endif // MATTER_DM_PLUGIN_OPERATIONAL_STATE_SERVER

‎examples/chef/common/chef-operational-state-delegate-impl.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
*
3-
* Copyright (c) 2023 Project CHIP Authors
3+
* Copyright (c) 2024 Project CHIP Authors
44
* All rights reserved.
55
*
66
* Licensed under the Apache License, Version 2.0 (the "License");

‎examples/chef/common/stubs.cpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@
3232

3333
#ifdef MATTER_DM_PLUGIN_DISHWASHER_MODE_SERVER
3434
#include "chef-dishwasher-mode-delegate-impl.h"
35-
#endif
35+
#endif // MATTER_DM_PLUGIN_DISHWASHER_MODE_SERVER
3636

3737
#ifdef MATTER_DM_PLUGIN_OPERATIONAL_STATE_SERVER
3838
#include "chef-operational-state-delegate-impl.h"
39-
#endif
39+
#endif // MATTER_DM_PLUGIN_OPERATIONAL_STATE_SERVER
4040

4141
using chip::app::DataModel::Nullable;
4242

@@ -96,11 +96,11 @@ Protocols::InteractionModel::Status emberAfExternalAttributeReadCallback(Endpoin
9696
#ifdef MATTER_DM_PLUGIN_DISHWASHER_MODE_SERVER
9797
case chip::app::Clusters::DishwasherMode::Id:
9898
return chefDishwasherModeReadCallback(endpoint, clusterId, attributeMetadata, buffer, maxReadLength);
99-
#endif
99+
#endif // MATTER_DM_PLUGIN_DISHWASHER_MODE_SERVER
100100
#ifdef MATTER_DM_PLUGIN_OPERATIONAL_STATE_SERVER
101101
case chip::app::Clusters::OperationalState::Id:
102102
return chefOperationalStateReadCallback(endpoint, clusterId, attributeMetadata, buffer, maxReadLength);
103-
#endif
103+
#endif // MATTER_DM_PLUGIN_OPERATIONAL_STATE_SERVER
104104
default:
105105
break;
106106
}
@@ -169,11 +169,11 @@ Protocols::InteractionModel::Status emberAfExternalAttributeWriteCallback(Endpoi
169169
#ifdef MATTER_DM_PLUGIN_DISHWASHER_MODE_SERVER
170170
case chip::app::Clusters::DishwasherMode::Id:
171171
return chefDishwasherModeWriteCallback(endpoint, clusterId, attributeMetadata, buffer);
172-
#endif
172+
#endif // MATTER_DM_PLUGIN_DISHWASHER_MODE_SERVER
173173
#ifdef MATTER_DM_PLUGIN_OPERATIONAL_STATE_SERVER
174174
case chip::app::Clusters::OperationalState::Id:
175175
return chefOperationalStateWriteCallback(endpoint, clusterId, attributeMetadata, buffer);
176-
#endif
176+
#endif // MATTER_DM_PLUGIN_OPERATIONAL_STATE_SERVER
177177
default:
178178
break;
179179
}

0 commit comments

Comments
 (0)