From 9343d75bea6e012eb0eec43414b5a0f42911ad13 Mon Sep 17 00:00:00 2001 From: 13038267101 Date: Wed, 4 Jan 2023 15:34:54 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E8=BF=9E=E7=BB=AD=E7=9D=A1?= =?UTF-8?q?=E7=9C=A0=E5=AF=BC=E8=87=B4=E5=8D=A1=E6=AD=BB=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hgdriver/hgdev/hg_scanner.cpp | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/hgdriver/hgdev/hg_scanner.cpp b/hgdriver/hgdev/hg_scanner.cpp index 8a281bb..1f5e5d3 100644 --- a/hgdriver/hgdev/hg_scanner.cpp +++ b/hgdriver/hgdev/hg_scanner.cpp @@ -3053,19 +3053,19 @@ int hg_scanner::reset(void) } int hg_scanner::device_io_control(unsigned long code, void* data, unsigned* len) { - SANE_Bool devs_status = false; - int ret = get_scan_is_sleep(devs_status); - if (ret == SCANNER_ERR_OK) - { - if (!devs_status) - { - if (pid_ == 0x239 || pid_ == 0x402) - { - set_notify_sleep(); - } - return SCANNER_ERR_DEVICE_SLEEPING; - } - } + //SANE_Bool devs_status = false; + //int ret = get_scan_is_sleep(devs_status); + //if (ret == SCANNER_ERR_OK) + //{ + // if (!devs_status) + // { + // if (pid_ == 0x239 || pid_ == 0x402) + // { + // set_notify_sleep(); + // } + // return SCANNER_ERR_DEVICE_SLEEPING; + // } + //} if (code == IO_CTRL_CODE_RESTORE_SETTINGS) { int ret = invoke_setting_xxx(&hg_scanner::setting_restore, data); @@ -3447,7 +3447,10 @@ int hg_scanner::device_io_control(unsigned long code, void* data, unsigned* len) } else if (code == IO_CTRL_CODE_GET_VIDPID) { - return get_vid_pid(*((int*)data)); + int num = 0; + int ret = get_vid_pid(num); + (*(int*)data) = num; + return ret; } return SCANNER_ERR_DEVICE_NOT_SUPPORT; }