From daf638558fe7913ab28caac5ac79cf7dbf41b77b Mon Sep 17 00:00:00 2001 From: Balazs Racz Date: Sun, 15 May 2022 12:43:39 +0200 Subject: [PATCH] Updates to send_datagram cmdline utility: - waits for the response datagram whtn eht cmdline swithc says so, even if the remote node does not say so - waits for response datagrams at the odd ID as well, for protocols that use two adjacent IDs. --- applications/send_datagram/main.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/applications/send_datagram/main.cxx b/applications/send_datagram/main.cxx index 1815d32fa..c8c626bff 100644 --- a/applications/send_datagram/main.cxx +++ b/applications/send_datagram/main.cxx @@ -241,6 +241,7 @@ int appl_main(int argc, char *argv[]) } if (wait_for_response) { g_datagram_can.registry()->insert(&g_node, payload[0], &printer); + g_datagram_can.registry()->insert(&g_node, payload[0] ^ 1, &printer); } Buffer *b; mainBufferPool->alloc(&b); @@ -256,11 +257,11 @@ int appl_main(int argc, char *argv[]) fprintf(stderr, "Datagram send result: %04x\n", client->result()); if (!(client->result() & DatagramClient::OK_REPLY_PENDING)) { LOG(INFO, "Target node indicates no response pending."); - } else if (wait_for_response) { - printer.wait(); } if (wait_for_response) { + printer.wait(); g_datagram_can.registry()->erase(&g_node, payload[0], &printer); + g_datagram_can.registry()->erase(&g_node, payload[0] ^ 1, &printer); } }