Skip to content

Commit 27a59d2

Browse files
authored
[camera-controller] Cleanup RPC dead code (project-chip#37966)
1 parent e2d3ea5 commit 27a59d2

File tree

1 file changed

+0
-38
lines changed

1 file changed

+0
-38
lines changed

examples/camera-controller/commands/interactive/InteractiveCommands.cpp

-38
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,6 @@
2929
#include <thread>
3030
#include <vector>
3131

32-
#if defined(PW_RPC_ENABLED)
33-
#include <rpc/RpcClient.h>
34-
#include <rpc/RpcServer.h>
35-
#endif
36-
3732
using namespace chip;
3833

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

45-
#if defined(PW_RPC_ENABLED)
46-
constexpr uint16_t kRetryIntervalS = 3;
47-
#endif
48-
4940
// File pointer for the log file
5041
FILE * sLogFile = nullptr;
5142

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

117-
#if defined(PW_RPC_ENABLED)
118-
void AttemptRpcClientConnect(System::Layer * systemLayer, void * appState)
119-
{
120-
if (admin::StartRpcClient() == CHIP_NO_ERROR)
121-
{
122-
// print to console
123-
fprintf(stderr, "Connected to Fabric-Bridge\n");
124-
}
125-
else
126-
{
127-
// print to console
128-
fprintf(stderr, "Failed to connect to Fabric-Bridge, retry in %d seconds....\n", kRetryIntervalS);
129-
systemLayer->StartTimer(System::Clock::Seconds16(kRetryIntervalS), AttemptRpcClientConnect, nullptr);
130-
}
131-
}
132-
133-
void ExecuteDeferredConnect(intptr_t ignored)
134-
{
135-
AttemptRpcClientConnect(&DeviceLayer::SystemLayer(), nullptr);
136-
}
137-
#endif
138-
139108
} // namespace
140109

141110
char * InteractiveStartCommand::GetCommand(char * command)
@@ -198,13 +167,6 @@ CHIP_ERROR InteractiveStartCommand::RunCommand()
198167
Logging::SetLogRedirectCallback(LoggingCallback);
199168
}
200169

201-
#if defined(PW_RPC_ENABLED)
202-
admin::SetRpcRemoteServerPort(mFabricBridgeServerPort.Value());
203-
admin::InitRpcServer(mLocalServerPort.Value());
204-
ChipLogProgress(NotSpecified, "PW_RPC initialized.");
205-
DeviceLayer::PlatformMgr().ScheduleWork(ExecuteDeferredConnect, 0);
206-
#endif
207-
208170
std::thread readCommands(ReadCommandThread);
209171
readCommands.detach();
210172

0 commit comments

Comments
 (0)