From 1db372e7abef198aaef9fa1c9ee1862afa154df1 Mon Sep 17 00:00:00 2001 From: Stefan Wahren Date: Sun, 22 Apr 2012 16:09:38 +0200 Subject: [PATCH] Improved error message in case of unknown Control Code --- mbus/mbus-protocol.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mbus/mbus-protocol.c b/mbus/mbus-protocol.c index a2ef1b0..6a6b7a6 100644 --- a/mbus/mbus-protocol.c +++ b/mbus/mbus-protocol.c @@ -298,7 +298,7 @@ mbus_frame_verify(mbus_frame *frame) (frame->control != MBUS_CONTROL_MASK_REQ_UD2) && (frame->control != MBUS_CONTROL_MASK_REQ_UD2 | MBUS_CONTROL_MASK_FCB)) { - snprintf(error_str, sizeof(error_str), "Unknown Control Code for Short Frame"); + snprintf(error_str, sizeof(error_str), "Unknown Control Code 0x%.2x", frame->control); return -1; } @@ -322,7 +322,7 @@ mbus_frame_verify(mbus_frame *frame) (frame->control != MBUS_CONTROL_MASK_RSP_UD | MBUS_CONTROL_MASK_ACD) && (frame->control != MBUS_CONTROL_MASK_RSP_UD | MBUS_CONTROL_MASK_DFC | MBUS_CONTROL_MASK_ACD)) { - snprintf(error_str, sizeof(error_str), "Unknown Control Code for Long/Control Frame"); + snprintf(error_str, sizeof(error_str), "Unknown Control Code 0x%.2x", frame->control); return -1; }