From f7e238afddd753cb29a0db58207c7213d92bfe49 Mon Sep 17 00:00:00 2001 From: Stefan Wahren Date: Wed, 3 Oct 2012 23:31:37 +0200 Subject: [PATCH] Extend mbus_recv_frame with simple echo cancelation --- mbus/mbus-protocol-aux.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/mbus/mbus-protocol-aux.c b/mbus/mbus-protocol-aux.c index 57758eb..dd6ddb5 100755 --- a/mbus/mbus-protocol-aux.c +++ b/mbus/mbus-protocol-aux.c @@ -1467,6 +1467,13 @@ mbus_recv_frame(mbus_handle * handle, mbus_frame *frame) } result = handle->recv(handle, frame); + + /* frame valid, but wrong direction */ + if (mbus_frame_direction(frame) == MBUS_CONTROL_MASK_DIR_M2S) + { + /* purge echo and retry (echo cancelation) */ + result = handle->recv(handle, frame); + } if (frame != NULL) {