diff --git a/scanner/async_scanner.cpp b/scanner/async_scanner.cpp index 8f29269..0157ba5 100644 --- a/scanner/async_scanner.cpp +++ b/scanner/async_scanner.cpp @@ -257,6 +257,11 @@ dyn_mem_ptr async_scanner::handle_set_opt(LPPACK_BASE pack, uint32_t* used, pack cfg_ret->max_size = cfg->max_size; cfg_ret->type = cfg->type; err = cfg_mgr_->update_data(cfg->data + cfg->name_off, cfg_ret->data + cfg_ret->val_off); + if(err == SCANNER_ERR_RELOAD_OPT_PARAM || err == SCANNER_ERR_RELOAD_IMAGE_PARAM || err == SCANNER_ERR_CONFIGURATION_CHANGED) + { + after = err; + err = SCANNER_ERR_OK; + } cfg_ret->after_do = after; cfg_ret->val_size = val_size; BASE_PACKET_REPLY(*pk, pack->cmd + 1, pack->pack_id, err); diff --git a/sdk/base/packet.h b/sdk/base/packet.h index 097339a..16f173a 100644 --- a/sdk/base/packet.h +++ b/sdk/base/packet.h @@ -295,7 +295,7 @@ typedef struct _config_val uint8_t type; // same as SANE_Value_Type uint8_t name_off; // name offset of the option in data, end with '\0' uint8_t val_off; // option value offset in data - uint8_t after_do; // see SANE_INFO_xxx in sane.h + uint16_t after_do; // see SCANNER_ERR_RELOAD_xxx in hgscanner_error.h uint16_t val_size; // real size of value uint16_t max_size; // max size of this option, this value has given in gb_json::size char data[0]; // contains value and name. fetch them according name_off and val_off members. diff --git a/usb/usb_io.cpp b/usb/usb_io.cpp index b3c986c..190b729 100644 --- a/usb/usb_io.cpp +++ b/usb/usb_io.cpp @@ -470,7 +470,8 @@ void async_usb_gadget::thread_read_ep0(void) ret = wait_fd_event(fd); if( !run_ || ret <= 0 ) { - utils::to_log(LOG_LEVEL_ALL, "select EP0(%d) failed: %d(%s)\n", fd, errno, strerror(errno)); + if(run_) + utils::to_log(LOG_LEVEL_ALL, "select EP0(%d) failed: %d(%s)\n", fd, errno, strerror(errno)); break; }