Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Silabs] Adds refrigerator app matter shell support for change door state #36548

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

shgutte
Copy link
Contributor

@shgutte shgutte commented Nov 19, 2024

Problem: Unable to test the test case TC-REFALM-2.2 due to the lack of functionality to open and close the refrigerator door.
Solution: Added support in the Matter shell to modify the door state.
Tested On: SiWx917 device with test case TEFALM-2.2.

Copy link

Review changes with  SemanticDiff

@shgutte shgutte marked this pull request as ready for review November 19, 2024 06:47
@shgutte shgutte requested a review from a team as a code owner November 19, 2024 06:47
@lboue
Copy link
Contributor

lboue commented Nov 19, 2024

@shgutte You'll have to reformat your code. 1 test is failing.

@lboue
Copy link
Contributor

lboue commented Nov 19, 2024

Building this PR for BRD2703A fails

./scripts/examples/gn_silabs_example.sh ./examples/refrigerator-app/silabs/ ./out/refrigerator-app-shell BRD2703A chip_build_libshell=true

Build error

In file included from ../../../examples/refrigerator-app/silabs/third_party/connectedhomeip/src/lib/support/CodeUtils.h:34,
                 from ../../../examples/refrigerator-app/silabs/third_party/connectedhomeip/src/lib/core/Optional.h:32,
                 from ../../../examples/refrigerator-app/silabs/third_party/connectedhomeip/src/app/ConcreteAttributePath.h:23,
                 from ../../../examples/refrigerator-app/silabs/third_party/connectedhomeip/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h:26,
                 from ../../../examples/refrigerator-app/silabs/third_party/connectedhomeip/src/app/clusters/refrigerator-alarm-server/refrigerator-alarm-server.h:20,
                 from ../../../examples/refrigerator-app/silabs/include/EventHandlerLibShell.h:19,
                 from ../../../examples/refrigerator-app/silabs/src/EventHandlerLibShell.cpp:18:
../../../examples/refrigerator-app/silabs/src/EventHandlerLibShell.cpp: In function 'CHIP_ERROR RefrigeratorDoorEventHandler(int, char**)':
../../../examples/refrigerator-app/silabs/src/EventHandlerLibShell.cpp:109:26: error: format '%d' expects argument of type 'int', but argument 4 has type 'chip::app::Cluster                s::RefrigeratorAlarm::AlarmBitmap' [-Werror=format=]
  109 |     ChipLogProgress(Zcl, "Setting event for the door state %d", data->doorState);
      |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ~~~~~~~~~~~~~~~
      |                                                                       |
      |                                                                       chip::app::Clusters::RefrigeratorAlarm::AlarmBitmap
../../../examples/refrigerator-app/silabs/third_party/connectedhomeip/src/lib/support/logging/TextOnlyLogging.h:469:70: note: in definition of macro 'ChipInternalLogImpl'
  469 |             chip::Logging::Log(chip::Logging::kLogModule_##MOD, CAT, MSG, ##__VA_ARGS__);                                          \
      |                                                                      ^~~
../../../examples/refrigerator-app/silabs/third_party/connectedhomeip/src/lib/support/logging/TextOnlyLogging.h:110:40: note: in expansion of macro 'ChipInternalLog'
  110 | #define ChipLogProgress(MOD, MSG, ...) ChipInternalLog(MOD, PROGRESS, MSG, ##__VA_ARGS__)
      |                                        ^~~~~~~~~~~~~~~
../../../examples/refrigerator-app/silabs/src/EventHandlerLibShell.cpp:109:5: note: in expansion of macro 'ChipLogProgress'
  109 |     ChipLogProgress(Zcl, "Setting event for the door state %d", data->doorState);
      |     ^~~~~~~~~~~~~~~
../../../examples/refrigerator-app/silabs/src/EventHandlerLibShell.cpp:109:61: note: format string is defined here
  109 |     ChipLogProgress(Zcl, "Setting event for the door state %d", data->doorState);
      |                                                            ~^
      |                                                             |
      |                                                             int
../../../examples/refrigerator-app/silabs/src/EventHandlerLibShell.cpp: In function 'void EventWorkerFunction(intptr_t)':
../../../examples/refrigerator-app/silabs/src/EventHandlerLibShell.cpp:158:30: error: format '%d' expects argument of type 'int', but argument 4 has type 'chip::app::Cluster                s::RefrigeratorAlarm::AlarmBitmap' [-Werror=format=]
  158 |         ChipLogProgress(Zcl, "Changing the door state %d", alarmData->doorState);
      |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~  ~~~~~~~~~~~~~~~~~~~~
      |                                                                       |
      |                                                                       chip::app::Clusters::RefrigeratorAlarm::AlarmBitmap
../../../examples/refrigerator-app/silabs/third_party/connectedhomeip/src/lib/support/logging/TextOnlyLogging.h:469:70: note: in definition of macro 'ChipInternalLogImpl'
  469 |             chip::Logging::Log(chip::Logging::kLogModule_##MOD, CAT, MSG, ##__VA_ARGS__);                                          \
      |                                                                      ^~~
../../../examples/refrigerator-app/silabs/third_party/connectedhomeip/src/lib/support/logging/TextOnlyLogging.h:110:40: note: in expansion of macro 'ChipInternalLog'
  110 | #define ChipLogProgress(MOD, MSG, ...) ChipInternalLog(MOD, PROGRESS, MSG, ##__VA_ARGS__)
      |                                        ^~~~~~~~~~~~~~~
../../../examples/refrigerator-app/silabs/src/EventHandlerLibShell.cpp:158:9: note: in expansion of macro 'ChipLogProgress'
  158 |         ChipLogProgress(Zcl, "Changing the door state %d", alarmData->doorState);
      |         ^~~~~~~~~~~~~~~
../../../examples/refrigerator-app/silabs/src/EventHandlerLibShell.cpp:158:56: note: format string is defined here
  158 |         ChipLogProgress(Zcl, "Changing the door state %d", alarmData->doorState);
      |                                                       ~^
      |                                                        |
      |                                                        int
At global scope:
cc1plus: note: unrecognized command-line option '-Wno-unknown-warning-option' may have been intended to silence earlier diagnostics
cc1plus: all warnings being treated as errors
[841/895] c++ obj/third_party/connectedhomeip/examples/platform/silabs/efr32-common.OTAConfig.cpp.o

PR36548_2703.log

@lboue
Copy link
Contributor

lboue commented Nov 20, 2024

Thanks. Building this PR for BRD2703A is OK now:

08:54:32.691 -> matterCli> refrigeratoralarm event
08:54:41.724 ->   help            Usage : refrigeratoralarm event <subcommand>
08:54:41.770 ->   door-state-change Sends door state change event to Refrigerator app
08:54:41.770 -> Done

08:54:41.770 -> matterCli> refrigeratoralarm event door-state-change open
08:54:52.761 -> Done

@shgutte
Copy link
Contributor Author

shgutte commented Nov 22, 2024

Building this PR for BRD2703A fails

./scripts/examples/gn_silabs_example.sh ./examples/refrigerator-app/silabs/ ./out/refrigerator-app-shell BRD2703A chip_build_libshell=true

Build error

In file included from ../../../examples/refrigerator-app/silabs/third_party/connectedhomeip/src/lib/support/CodeUtils.h:34,
                 from ../../../examples/refrigerator-app/silabs/third_party/connectedhomeip/src/lib/core/Optional.h:32,
                 from ../../../examples/refrigerator-app/silabs/third_party/connectedhomeip/src/app/ConcreteAttributePath.h:23,
                 from ../../../examples/refrigerator-app/silabs/third_party/connectedhomeip/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h:26,
                 from ../../../examples/refrigerator-app/silabs/third_party/connectedhomeip/src/app/clusters/refrigerator-alarm-server/refrigerator-alarm-server.h:20,
                 from ../../../examples/refrigerator-app/silabs/include/EventHandlerLibShell.h:19,
                 from ../../../examples/refrigerator-app/silabs/src/EventHandlerLibShell.cpp:18:
../../../examples/refrigerator-app/silabs/src/EventHandlerLibShell.cpp: In function 'CHIP_ERROR RefrigeratorDoorEventHandler(int, char**)':
../../../examples/refrigerator-app/silabs/src/EventHandlerLibShell.cpp:109:26: error: format '%d' expects argument of type 'int', but argument 4 has type 'chip::app::Cluster                s::RefrigeratorAlarm::AlarmBitmap' [-Werror=format=]
  109 |     ChipLogProgress(Zcl, "Setting event for the door state %d", data->doorState);
      |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ~~~~~~~~~~~~~~~
      |                                                                       |
      |                                                                       chip::app::Clusters::RefrigeratorAlarm::AlarmBitmap
../../../examples/refrigerator-app/silabs/third_party/connectedhomeip/src/lib/support/logging/TextOnlyLogging.h:469:70: note: in definition of macro 'ChipInternalLogImpl'
  469 |             chip::Logging::Log(chip::Logging::kLogModule_##MOD, CAT, MSG, ##__VA_ARGS__);                                          \
      |                                                                      ^~~
../../../examples/refrigerator-app/silabs/third_party/connectedhomeip/src/lib/support/logging/TextOnlyLogging.h:110:40: note: in expansion of macro 'ChipInternalLog'
  110 | #define ChipLogProgress(MOD, MSG, ...) ChipInternalLog(MOD, PROGRESS, MSG, ##__VA_ARGS__)
      |                                        ^~~~~~~~~~~~~~~
../../../examples/refrigerator-app/silabs/src/EventHandlerLibShell.cpp:109:5: note: in expansion of macro 'ChipLogProgress'
  109 |     ChipLogProgress(Zcl, "Setting event for the door state %d", data->doorState);
      |     ^~~~~~~~~~~~~~~
../../../examples/refrigerator-app/silabs/src/EventHandlerLibShell.cpp:109:61: note: format string is defined here
  109 |     ChipLogProgress(Zcl, "Setting event for the door state %d", data->doorState);
      |                                                            ~^
      |                                                             |
      |                                                             int
../../../examples/refrigerator-app/silabs/src/EventHandlerLibShell.cpp: In function 'void EventWorkerFunction(intptr_t)':
../../../examples/refrigerator-app/silabs/src/EventHandlerLibShell.cpp:158:30: error: format '%d' expects argument of type 'int', but argument 4 has type 'chip::app::Cluster                s::RefrigeratorAlarm::AlarmBitmap' [-Werror=format=]
  158 |         ChipLogProgress(Zcl, "Changing the door state %d", alarmData->doorState);
      |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~  ~~~~~~~~~~~~~~~~~~~~
      |                                                                       |
      |                                                                       chip::app::Clusters::RefrigeratorAlarm::AlarmBitmap
../../../examples/refrigerator-app/silabs/third_party/connectedhomeip/src/lib/support/logging/TextOnlyLogging.h:469:70: note: in definition of macro 'ChipInternalLogImpl'
  469 |             chip::Logging::Log(chip::Logging::kLogModule_##MOD, CAT, MSG, ##__VA_ARGS__);                                          \
      |                                                                      ^~~
../../../examples/refrigerator-app/silabs/third_party/connectedhomeip/src/lib/support/logging/TextOnlyLogging.h:110:40: note: in expansion of macro 'ChipInternalLog'
  110 | #define ChipLogProgress(MOD, MSG, ...) ChipInternalLog(MOD, PROGRESS, MSG, ##__VA_ARGS__)
      |                                        ^~~~~~~~~~~~~~~
../../../examples/refrigerator-app/silabs/src/EventHandlerLibShell.cpp:158:9: note: in expansion of macro 'ChipLogProgress'
  158 |         ChipLogProgress(Zcl, "Changing the door state %d", alarmData->doorState);
      |         ^~~~~~~~~~~~~~~
../../../examples/refrigerator-app/silabs/src/EventHandlerLibShell.cpp:158:56: note: format string is defined here
  158 |         ChipLogProgress(Zcl, "Changing the door state %d", alarmData->doorState);
      |                                                       ~^
      |                                                        |
      |                                                        int
At global scope:
cc1plus: note: unrecognized command-line option '-Wno-unknown-warning-option' may have been intended to silence earlier diagnostics
cc1plus: all warnings being treated as errors
[841/895] c++ obj/third_party/connectedhomeip/examples/platform/silabs/efr32-common.OTAConfig.cpp.o

PR36548_2703.log

Adds changes to fix this build error

@shgutte
Copy link
Contributor Author

shgutte commented Nov 22, 2024

@shgutte You'll have to reformat your code. 1 test is failing.

Hi @lboue reformated the code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants