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-
3732using namespace chip ;
3833
3934namespace {
@@ -42,10 +37,6 @@ constexpr char kInteractiveModePrompt[] = ">>> ";
4237constexpr char kInteractiveModeHistoryFileName [] = " chip_tool_history" ;
4338constexpr 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
5041FILE * 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
141110char * 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