29
29
#include < thread>
30
30
#include < vector>
31
31
32
- #if defined(PW_RPC_ENABLED)
33
- #include < rpc/RpcClient.h>
34
- #include < rpc/RpcServer.h>
35
- #endif
36
-
37
32
using namespace chip ;
38
33
39
34
namespace {
@@ -42,10 +37,6 @@ constexpr char kInteractiveModePrompt[] = ">>> ";
42
37
constexpr char kInteractiveModeHistoryFileName [] = " chip_tool_history" ;
43
38
constexpr char kInteractiveModeStopCommand [] = " quit()" ;
44
39
45
- #if defined(PW_RPC_ENABLED)
46
- constexpr uint16_t kRetryIntervalS = 3 ;
47
- #endif
48
-
49
40
// File pointer for the log file
50
41
FILE * sLogFile = nullptr ;
51
42
@@ -114,28 +105,6 @@ void ENFORCE_FORMAT(3, 0) LoggingCallback(const char * module, uint8_t category,
114
105
funlockfile (sLogFile );
115
106
}
116
107
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
-
139
108
} // namespace
140
109
141
110
char * InteractiveStartCommand::GetCommand (char * command)
@@ -198,13 +167,6 @@ CHIP_ERROR InteractiveStartCommand::RunCommand()
198
167
Logging::SetLogRedirectCallback (LoggingCallback);
199
168
}
200
169
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
-
208
170
std::thread readCommands (ReadCommandThread);
209
171
readCommands.detach ();
210
172
0 commit comments