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

[camera-controller] Cleanup RPC dead code #37966

Merged
merged 1 commit into from
Mar 11, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,6 @@
#include <thread>
#include <vector>

#if defined(PW_RPC_ENABLED)
#include <rpc/RpcClient.h>
#include <rpc/RpcServer.h>
#endif

using namespace chip;

namespace {
Expand All @@ -42,10 +37,6 @@ constexpr char kInteractiveModePrompt[] = ">>> ";
constexpr char kInteractiveModeHistoryFileName[] = "chip_tool_history";
constexpr char kInteractiveModeStopCommand[] = "quit()";

#if defined(PW_RPC_ENABLED)
constexpr uint16_t kRetryIntervalS = 3;
#endif

// File pointer for the log file
FILE * sLogFile = nullptr;

Expand Down Expand Up @@ -114,28 +105,6 @@ void ENFORCE_FORMAT(3, 0) LoggingCallback(const char * module, uint8_t category,
funlockfile(sLogFile);
}

#if defined(PW_RPC_ENABLED)
void AttemptRpcClientConnect(System::Layer * systemLayer, void * appState)
{
if (admin::StartRpcClient() == CHIP_NO_ERROR)
{
// print to console
fprintf(stderr, "Connected to Fabric-Bridge\n");
}
else
{
// print to console
fprintf(stderr, "Failed to connect to Fabric-Bridge, retry in %d seconds....\n", kRetryIntervalS);
systemLayer->StartTimer(System::Clock::Seconds16(kRetryIntervalS), AttemptRpcClientConnect, nullptr);
}
}

void ExecuteDeferredConnect(intptr_t ignored)
{
AttemptRpcClientConnect(&DeviceLayer::SystemLayer(), nullptr);
}
#endif

} // namespace

char * InteractiveStartCommand::GetCommand(char * command)
Expand Down Expand Up @@ -198,13 +167,6 @@ CHIP_ERROR InteractiveStartCommand::RunCommand()
Logging::SetLogRedirectCallback(LoggingCallback);
}

#if defined(PW_RPC_ENABLED)
admin::SetRpcRemoteServerPort(mFabricBridgeServerPort.Value());
admin::InitRpcServer(mLocalServerPort.Value());
ChipLogProgress(NotSpecified, "PW_RPC initialized.");
DeviceLayer::PlatformMgr().ScheduleWork(ExecuteDeferredConnect, 0);
#endif

std::thread readCommands(ReadCommandThread);
readCommands.detach();

Expand Down
Loading