From 30ab8dd6436fddf44e70d54f0904bc812a9b3c06 Mon Sep 17 00:00:00 2001 From: Stefan Wahren Date: Thu, 4 Oct 2012 23:20:28 +0200 Subject: [PATCH] handle direction of ACK correctly --- mbus/mbus-protocol.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/mbus/mbus-protocol.c b/mbus/mbus-protocol.c index dee306e..e47f8d2 100755 --- a/mbus/mbus-protocol.c +++ b/mbus/mbus-protocol.c @@ -308,7 +308,14 @@ mbus_frame_direction(mbus_frame *frame) { if (frame) { - return (frame->control & MBUS_CONTROL_MASK_DIR); + if (frame->type == MBUS_FRAME_TYPE_ACK) + { + return MBUS_CONTROL_MASK_DIR_S2M; + } + else + { + return (frame->control & MBUS_CONTROL_MASK_DIR); + } } return -1; }