From 5ed712b2f0471d4f1210fc3be6080aeaaf4b126a Mon Sep 17 00:00:00 2001 From: Szczepan Zalega Date: Sat, 20 Feb 2016 15:40:05 +0100 Subject: checking status correctly (in specification hid_get_feature_report returns number of received bytes+1, so its never under 1 when successful) --- device.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/device.cc b/device.cc index e4ec8bd..3aca2b2 100644 --- a/device.cc +++ b/device.cc @@ -56,7 +56,7 @@ CommError Device::recv(void *packet) { status = (CommError)( hid_get_feature_report(mp_devhandle, (unsigned char *)(packet), HID_REPORT_SIZE)); - if (status == CommError::ERR_NO_ERROR || retry_count++ >= m_retry_count) + if ((int)status >0 || retry_count++ >= m_retry_count) break; std::this_thread::sleep_for(m_retry_timeout); } -- cgit v1.2.3