Remove legacy thread for RPC test (#35909)
diff --git a/examples/fabric-bridge-app/linux/main.cpp b/examples/fabric-bridge-app/linux/main.cpp
index 2a79363..3e93c98 100644
--- a/examples/fabric-bridge-app/linux/main.cpp
+++ b/examples/fabric-bridge-app/linux/main.cpp
@@ -16,10 +16,6 @@
* limitations under the License.
*/
-#include <cstdlib>
-#include <sys/ioctl.h>
-#include <thread>
-
#include <AppMain.h>
#include "BridgedAdministratorCommissioning.h"
@@ -55,8 +51,6 @@
namespace {
-constexpr uint16_t kPollIntervalMs = 100;
-
#if defined(PW_RPC_FABRIC_BRIDGE_SERVICE) && PW_RPC_FABRIC_BRIDGE_SERVICE
constexpr uint16_t kRetryIntervalS = 3;
#endif
@@ -103,33 +97,6 @@
ArgParser::OptionSet sProgramCustomOptions = { HandleCustomOption, sProgramCustomOptionDefs, "GENERAL OPTIONS",
sProgramCustomOptionHelp };
-bool KeyboardHit()
-{
- int bytesWaiting;
- ioctl(0, FIONREAD, &bytesWaiting);
- return bytesWaiting > 0;
-}
-
-void BridgePollingThread()
-{
- while (true)
- {
- if (KeyboardHit())
- {
- int ch = getchar();
- if (ch == 'e')
- {
- ChipLogProgress(NotSpecified, "Exiting.....");
- exit(0);
- }
- continue;
- }
-
- // Sleep to avoid tight loop reading commands
- usleep(kPollIntervalMs * 1000);
- }
-}
-
#if defined(PW_RPC_FABRIC_BRIDGE_SERVICE) && PW_RPC_FABRIC_BRIDGE_SERVICE
void AttemptRpcClientConnect(System::Layer * systemLayer, void * appState)
{
@@ -292,10 +259,6 @@
AttemptRpcClientConnect(&DeviceLayer::SystemLayer(), nullptr);
#endif
- // Start a thread for bridge polling
- std::thread pollingThread(BridgePollingThread);
- pollingThread.detach();
-
BridgeDeviceMgr().Init();
VerifyOrDie(gBridgedAdministratorCommissioning.Init() == CHIP_NO_ERROR);