From fea65386e8cdf9f51e56d9f4b29ea1cd16904edf Mon Sep 17 00:00:00 2001 From: yangjiaxuan <171295266@qq.com> Date: Tue, 5 Dec 2023 11:33:27 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=EF=BC=9A=E5=9C=A8=E5=8F=96?= =?UTF-8?q?=E5=9B=BE=E8=BF=87=E7=A8=8B=E4=B8=AD=EF=BC=8C=E5=A6=82=E6=9E=9C?= =?UTF-8?q?usb=E6=96=AD=E5=BC=80=E5=88=99=E5=81=9C=E6=AD=A2=E6=89=AB?= =?UTF-8?q?=E6=8F=8F=E5=B9=B6=E5=A2=9E=E5=8A=A0=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hgdriver/hgdev/hg_scanner_239.cpp | 5 +++++ hgdriver/hgdev/hg_scanner_300.cpp | 5 +++++ hgdriver/hgdev/hg_scanner_306.cpp | 5 +++++ 3 files changed, 15 insertions(+) diff --git a/hgdriver/hgdev/hg_scanner_239.cpp b/hgdriver/hgdev/hg_scanner_239.cpp index dad08fe..b9a0635 100644 --- a/hgdriver/hgdev/hg_scanner_239.cpp +++ b/hgdriver/hgdev/hg_scanner_239.cpp @@ -1538,6 +1538,11 @@ void hg_scanner_239::thread_get_dves_image(void) // error handling ... VLOG_MINI_4(LOG_LEVEL_DEBUG_INFO, "Read HGEIntInfo: From = %d, Code = %d, Img_Index = %d, status = %s\n", info->From, info->Code, info->Img_Index, hg_scanner_err_description(status_)); } + + if (SCANNER_ERR_DEVICE_NOT_FOUND == ret) + { + break; + } } this_thread::sleep_for(chrono::milliseconds(10)); // stop 通过int端点返回 如果不反回则是固件问题,软件不做处理 diff --git a/hgdriver/hgdev/hg_scanner_300.cpp b/hgdriver/hgdev/hg_scanner_300.cpp index b9620c1..41d660a 100644 --- a/hgdriver/hgdev/hg_scanner_300.cpp +++ b/hgdriver/hgdev/hg_scanner_300.cpp @@ -305,6 +305,11 @@ void hg_scanner_300::thread_handle_usb_read(void) } } this_thread::sleep_for(chrono::milliseconds(10)); + + if (SCANNER_ERR_DEVICE_NOT_FOUND == ret) + { + break; + } } VLOG_MINI_2(LOG_LEVEL_DEBUG_INFO, "USB thread exit with code: %s, status = %s\n", hg_scanner_err_name(ret), hg_scanner_err_description(status_)); } diff --git a/hgdriver/hgdev/hg_scanner_306.cpp b/hgdriver/hgdev/hg_scanner_306.cpp index 64645a6..0b00047 100644 --- a/hgdriver/hgdev/hg_scanner_306.cpp +++ b/hgdriver/hgdev/hg_scanner_306.cpp @@ -256,6 +256,11 @@ void hg_scanner_306::thread_handle_usb_read(void) } } this_thread::sleep_for(chrono::milliseconds(10)); + + if (SCANNER_ERR_DEVICE_NOT_FOUND == ret) + { + break; + } } VLOG_MINI_2(LOG_LEVEL_DEBUG_INFO, "USB thread exit with code: %s, status = %s\n", hg_scanner_err_name(ret), hg_scanner_err_description(status_)); }