MCPcopy Create free account
hub / github.com/EmbeddedRPC/erpc / runClient

Function runClient

test/common/unit_test_zephyr_uart_arbitrator_server.cpp:80–122  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

78}
79
80void runClient(void *arg)
81{
82 struct k_poll_event events[1] = {
83 K_POLL_EVENT_INITIALIZER(K_POLL_TYPE_SIGNAL, K_POLL_MODE_NOTIFY_ONLY, &signalClient),
84 };
85 k_poll(events, 1, K_FOREVER);
86
87 // wait until ERPC first (client) app will announce that it is ready.
88 while (waitClient == 0)
89 {
90 Thread::sleep(10000);
91 }
92
93 // wait until ERPC first (client) app will announce ready to quit state
94 while (true)
95 {
96 isTestPassing = testClient();
97 {
98 Thread::sleep(10000);
99 Mutex::Guard lock(waitQuitMutex);
100 if (waitQuit != 0 || isTestPassing != 0 || stopTest != 0)
101 {
102 enableFirstSide();
103 break;
104 }
105 }
106 }
107
108 while (true)
109 {
110 Thread::sleep(100000);
111 Mutex::Guard lock(waitQuitMutex);
112 if (waitQuit != 0)
113 {
114 break;
115 }
116 }
117
118 // send to ERPC first (client) app ready to quit state
119 quitSecondInterfaceServer();
120 increaseWaitQuit();
121 k_thread_suspend(k_current_get());
122}
123
124static void SignalReady(void) {}
125

Callers

nothing calls this directly

Calls 4

enableFirstSideFunction · 0.85
testClientFunction · 0.70
increaseWaitQuitFunction · 0.70

Tested by

no test coverage detected