From dfbe55d204c4f534ed986e656af0944d7850d347 Mon Sep 17 00:00:00 2001 From: Justin Wood Date: Mon, 18 Jul 2022 13:31:33 -0700 Subject: [PATCH] Move NamedPipeCommands class to platform/linux (#20815) (#20881) * Move NamedPipeCommands class to platform/linux * Address review comments Co-authored-by: Yufeng Wang --- examples/all-clusters-app/linux/BUILD.gn | 1 - examples/platform/linux/BUILD.gn | 2 ++ .../{all-clusters-app => platform}/linux/NamedPipeCommands.cpp | 2 +- .../{all-clusters-app => platform}/linux/NamedPipeCommands.h | 0 4 files changed, 3 insertions(+), 2 deletions(-) rename examples/{all-clusters-app => platform}/linux/NamedPipeCommands.cpp (96%) rename examples/{all-clusters-app => platform}/linux/NamedPipeCommands.h (100%) diff --git a/examples/all-clusters-app/linux/BUILD.gn b/examples/all-clusters-app/linux/BUILD.gn index f09889e8870ffb..a53f45d11006d6 100644 --- a/examples/all-clusters-app/linux/BUILD.gn +++ b/examples/all-clusters-app/linux/BUILD.gn @@ -26,7 +26,6 @@ source_set("chip-all-clusters-common") { "${chip_root}/examples/all-clusters-app/all-clusters-common/src/static-supported-modes-manager.cpp", "AllClustersCommandDelegate.cpp", "AppOptions.cpp", - "NamedPipeCommands.cpp", "include/tv-callbacks.cpp", "include/tv-callbacks.h", "main-common.cpp", diff --git a/examples/platform/linux/BUILD.gn b/examples/platform/linux/BUILD.gn index 1a2f35921095a0..605c19860db9b1 100644 --- a/examples/platform/linux/BUILD.gn +++ b/examples/platform/linux/BUILD.gn @@ -43,6 +43,8 @@ source_set("app-main") { "ControllerShellCommands.h", "LinuxCommissionableDataProvider.cpp", "LinuxCommissionableDataProvider.h", + "NamedPipeCommands.cpp", + "NamedPipeCommands.h", "Options.cpp", "Options.h", "testing/CustomCSRResponse.cpp", diff --git a/examples/all-clusters-app/linux/NamedPipeCommands.cpp b/examples/platform/linux/NamedPipeCommands.cpp similarity index 96% rename from examples/all-clusters-app/linux/NamedPipeCommands.cpp rename to examples/platform/linux/NamedPipeCommands.cpp index a7f1de478d75fd..63bad2eb072ccd 100644 --- a/examples/all-clusters-app/linux/NamedPipeCommands.cpp +++ b/examples/platform/linux/NamedPipeCommands.cpp @@ -79,7 +79,7 @@ void * NamedPipeCommands::EventCommandListenerTask(void * arg) ssize_t readBytes = read(fd, readbuf, kChipEventCmdBufSize); readbuf[readBytes - 1] = '\0'; - ChipLogProgress(NotSpecified, "Received payload: \"%s\" and length is %ld\n", readbuf, readBytes); + ChipLogProgress(NotSpecified, "Received payload: \"%s\"", readbuf); // Process the received command request from event fifo self->mDelegate->OnEventCommandReceived(readbuf); diff --git a/examples/all-clusters-app/linux/NamedPipeCommands.h b/examples/platform/linux/NamedPipeCommands.h similarity index 100% rename from examples/all-clusters-app/linux/NamedPipeCommands.h rename to examples/platform/linux/NamedPipeCommands.h