From d0469b4a53b9ae81472f20cd86dc3120b66d4cb1 Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Fri, 28 Feb 2020 17:11:31 +0100 Subject: [PATCH] BSB: Bug fixes --- bsb/firmware/main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bsb/firmware/main.c b/bsb/firmware/main.c index 31a64a6..61716b0 100644 --- a/bsb/firmware/main.c +++ b/bsb/firmware/main.c @@ -432,7 +432,7 @@ static void bsb_send(byte *buf, uint len) static bool bsb_is_reply_for(byte *reply, byte *req) { // Check source and destination address if (reply[BF_DEST] != BSB_ADDR_GATEWAY || - reply[BF_SRC] != req[BF_DEST] ^ 0x80) + reply[BF_SRC] != (req[BF_DEST] ^ 0x80)) return 0; // Extract body of request and reply @@ -445,6 +445,8 @@ static bool bsb_is_reply_for(byte *reply, byte *req) { rq_len -= BF_BODY + 2; rp_len -= BF_BODY + 2; + // debug_printf("BSB: Matching reply op=%u/len=%u for op=%u/len=%u\n", reply[BF_OP], rp_len, req[BF_OP], rq_len); + switch (req[BF_OP]) { case BSB_OP_QUERY: switch (reply[BF_OP]) { -- 2.39.2