diff --git a/build/erpc_core.o b/build/erpc_core.o index f4f1516..4ef1d04 100644 Binary files a/build/erpc_core.o and b/build/erpc_core.o differ diff --git a/build/port_self.o b/build/port_self.o index 37fbaef..3ffa0f2 100644 Binary files a/build/port_self.o and b/build/port_self.o differ diff --git a/erpc_core.c b/erpc_core.c index 93145f1..4a708ab 100644 --- a/erpc_core.c +++ b/erpc_core.c @@ -187,6 +187,7 @@ u32 erpc_send_base(erpc_hw_cfg_t *hw_cfg, u8 dest_id, u16 port, u8 package_type, { if (wait_time == 0) { + printf("send timeout,state:%d\n", hw_cfg->send_cache[cache_ord].state); ret = ERPC_ERR_SEND_TIMEOUT; break; } diff --git a/port_self.c b/port_self.c index 802063c..cc3b1bc 100644 --- a/port_self.c +++ b/port_self.c @@ -32,6 +32,8 @@ u32 hello_cat(u8 hw, u8 src_id, u8 dest_id, u16 port, u8 *data, u16 len) return 0; } + + u32 hello_dog(u8 hw, u8 src_id, u8 dest_id, u16 port, u8 *data, u16 len) { ERPC_DEBUG("Hello Dog!\n"); @@ -136,8 +138,16 @@ DWORD WINAPI test_task(LPVOID lpParam) ERPC_DEBUG("[test_task]send ret:%d\n", ret); ret = erpc_send(self_hw_cfg.ord, self_hw_cfg.local_id, 0x02, NULL, 0); ERPC_DEBUG("[test_task]send ret:%d\n", ret); - ret = erpc_send_wait_reply(self_hw_cfg.ord, self_hw_cfg.local_id, 0x03, NULL, 0, data, NULL, 1000); + u16 reply_len = 30; + u8 data[reply_len]; + ret = erpc_send_wait_reply(self_hw_cfg.ord, self_hw_cfg.local_id, 0x03, NULL, 0, data, &reply_len, 1000); ERPC_DEBUG("[test_task]send ret:%d\n", ret); + for (int i = 0; i < reply_len; i++) + { + ERPC_DEBUG("%c", data[i]); + } + ERPC_DEBUG("\n"); + UNUSED(ret); sys_sleep(1000); } @@ -156,7 +166,7 @@ int main(int argc, char *argv[]) ERPC_DEBUG("erpc_cmd_config ret:%d\n", ret); erpc_sleep_tick = sys_sleep; - HANDLE threadHandle[3]; + HANDLE threadHandle[4]; deal_lock = CreateMutex(NULL, FALSE, NULL); if (deal_lock == NULL) { @@ -171,13 +181,16 @@ int main(int argc, char *argv[]) } threadHandle[0] = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)send_task, NULL, 0, NULL); threadHandle[1] = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)rev_task, NULL, 0, NULL); - threadHandle[2] = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)test_task, NULL, 0, NULL); + threadHandle[3] = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)rev_task, NULL, 0, NULL); + threadHandle[4] = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)test_task, NULL, 0, NULL); WaitForSingleObject(threadHandle[0], INFINITE); WaitForSingleObject(threadHandle[1], INFINITE); WaitForSingleObject(threadHandle[2], INFINITE); + WaitForSingleObject(threadHandle[3], INFINITE); CloseHandle(threadHandle[0]); CloseHandle(threadHandle[1]); CloseHandle(threadHandle[2]); + CloseHandle(threadHandle[3]); return 0; } \ No newline at end of file diff --git a/port_self.exe b/port_self.exe index bbbc9e8..3e587f7 100644 Binary files a/port_self.exe and b/port_self.exe differ