From 22023e34c50fd9b6f8958e80128ad4c89cba94de Mon Sep 17 00:00:00 2001 From: Szczepan Zalega Date: Thu, 28 Jul 2016 14:39:56 +0200 Subject: Correct debug message about wrong crc Signed-off-by: Szczepan Zalega --- include/device_proto.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/include/device_proto.h b/include/device_proto.h index 82606a1..7e2c0d9 100644 --- a/include/device_proto.h +++ b/include/device_proto.h @@ -199,9 +199,10 @@ class Transaction : semantics::non_constructible { status = dev.recv(&resp); dev.set_last_command_status(resp.last_command_status); // FIXME should be handled on device.recv - if (resp.device_status == 0) break; - Log::instance()("Device status is not ready (CRC error?) retrying..", - Loglevel::DEBUG); // FIXME translate device_status to log + + if (resp.device_status == 0 && resp.last_command_crc == outp.crc) break; + Log::instance()("Device is not ready or received packet's last CRC is not equal to sent CRC packet, retrying...", + Loglevel::DEBUG); Log::instance()("Invalid incoming HID packet:", Loglevel::DEBUG_L2); Log::instance()((std::string)(resp), Loglevel::DEBUG_L2); std::this_thread::sleep_for(dev.get_retry_timeout()); -- cgit v1.2.3