Skip to content

Commit 66cacf0

Browse files
arun-silabsjmartinez-silabsCopilot
authored
Apply suggestions from code review
Co-authored-by: Junior Martinez <[email protected]> Co-authored-by: Copilot <[email protected]>
1 parent 9c7a0d5 commit 66cacf0

File tree

6 files changed

+10
-24
lines changed

6 files changed

+10
-24
lines changed

examples/oven-app/oven-app-common/src/CookSurfaceEndpoint.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,4 @@ CHIP_ERROR CookSurfaceEndpoint::Init()
2727
return CHIP_NO_ERROR;
2828
}
2929

30-
void CookSurfaceEndpoint::HandleOffCommand()
31-
{
32-
// TODO: Implement the logic to handle the "off" command
33-
return;
34-
}
30+
void CookSurfaceEndpoint::HandleOffCommand() {}

examples/oven-app/oven-app-common/src/CookTopEndpoint.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,4 @@ CHIP_ERROR CookTopEndpoint::Init()
2727
return CHIP_NO_ERROR;
2828
}
2929

30-
void CookTopEndpoint::HandleOffCommand()
31-
{
32-
// TODO: Implement the logic to handle the "off" command
33-
return;
34-
}
30+
void CookTopEndpoint::HandleOffCommand() {}

examples/oven-app/oven-app-common/src/OvenEndpoint.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ const detail::Structs::ModeOptionStruct::Type OvenModeDelegate::skModeOptions[kM
8686

8787
CHIP_ERROR OvenModeDelegate::Init()
8888
{
89-
// Set the instance for the mode base delegate
89+
// No initialization required for OvenModeDelegate
9090
return CHIP_NO_ERROR;
9191
}
9292

examples/oven-app/silabs/include/AppConfig.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@
2525

2626
#define APP_TASK_NAME "Oven"
2727

28-
#define BLE_DEV_NAME "Silabs-Oven"
28+
#define BLE_DEV_NAME "SL-" APP_TASK_NAME

examples/oven-app/silabs/include/OvenManager.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,11 @@ class OvenManager
5353
chip::app::Clusters::AppSupportedTemperatureLevelsDelegate mTemperatureControlDelegate;
5454

5555
// Define the endpoint ID for the Oven
56-
static constexpr chip::EndpointId kOvenEndpoint1 = 1;
57-
static constexpr chip::EndpointId kTemperatureControlledCabinetEndpoint2 = 2;
58-
static constexpr chip::EndpointId kCookTopEndpoint3 = 3;
59-
static constexpr chip::EndpointId kCookSurfaceEndpoint4 = 4;
60-
static constexpr chip::EndpointId kCookSurfaceEndpoint5 = 5;
56+
static constexpr chip::EndpointId kOvenEndpoint = 1;
57+
static constexpr chip::EndpointId kTemperatureControlledCabinetEndpoint = 2;
58+
static constexpr chip::EndpointId kCookTopEndpoint = 3;
59+
static constexpr chip::EndpointId kCookSurfaceEndpoint1 = 4;
60+
static constexpr chip::EndpointId kCookSurfaceEndpoint2 = 5;
6161

6262
chip::app::Clusters::Oven::OvenEndpoint mOvenEndpoint1;
6363
chip::app::Clusters::TemperatureControlledCabinet::TemperatureControlledCabinetEndpoint mTemperatureControlledCabinetEndpoint2{

examples/oven-app/silabs/src/AppSupportedTemperatureLevelsDelegate.cpp

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ using namespace chip;
2424
using namespace chip::app::Clusters;
2525
using namespace chip::app::DataModel;
2626

27-
bool AppSupportedTemperatureLevelsDelegate::RegisterSupportedLevels(EndpointId endpoint, const CharSpan * levels,
27+
CHIP_ERROR AppSupportedTemperatureLevelsDelegate::RegisterSupportedLevels(EndpointId endpoint, const CharSpan * levels,
2828
uint8_t levelCount)
2929
{
3030
if (levels == nullptr || levelCount == 0)
@@ -54,7 +54,6 @@ bool AppSupportedTemperatureLevelsDelegate::RegisterSupportedLevels(EndpointId e
5454

5555
uint8_t AppSupportedTemperatureLevelsDelegate::Size()
5656
{
57-
ChipLogProgress(AppServer, "AppSupportedTemperatureLevelsDelegate::Size() called for endpoint %d", mEndpoint);
5857
for (size_t i = 0; i < mRegisteredEndpointCount; ++i)
5958
{
6059
const EndpointPair & endpointPair = supportedOptionsByEndpoints[i];
@@ -70,25 +69,20 @@ uint8_t AppSupportedTemperatureLevelsDelegate::Size()
7069

7170
CHIP_ERROR AppSupportedTemperatureLevelsDelegate::Next(MutableCharSpan & item)
7271
{
73-
ChipLogProgress(AppServer, "AppSupportedTemperatureLevelsDelegate::Next() called for endpoint %d, index %d", mEndpoint, mIndex);
7472
for (size_t i = 0; i < mRegisteredEndpointCount; ++i)
7573
{
7674
const EndpointPair & endpointPair = supportedOptionsByEndpoints[i];
7775
if (endpointPair.mEndpointId == mEndpoint)
7876
{
7977
if (mIndex < endpointPair.mSize)
8078
{
81-
ChipLogProgress(AppServer, "Returning temperature level: %.*s",
82-
static_cast<int>(endpointPair.mTemperatureLevels[mIndex].size()),
83-
endpointPair.mTemperatureLevels[mIndex].data());
8479
CHIP_ERROR err = CopyCharSpanToMutableCharSpan(endpointPair.mTemperatureLevels[mIndex], item);
8580
if (err == CHIP_NO_ERROR)
8681
{
8782
mIndex++;
8883
}
8984
return err;
9085
}
91-
ChipLogProgress(AppServer, "List exhausted at index %d", mIndex);
9286
return CHIP_ERROR_PROVIDER_LIST_EXHAUSTED;
9387
}
9488
}

0 commit comments

Comments
 (0)