修改属性设置协议after值定义及设定

This commit is contained in:
gb 2023-12-26 11:30:26 +08:00
parent 742dcd1535
commit 13e06217fe
3 changed files with 8 additions and 2 deletions

View File

@ -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->max_size = cfg->max_size;
cfg_ret->type = cfg->type; cfg_ret->type = cfg->type;
err = cfg_mgr_->update_data(cfg->data + cfg->name_off, cfg_ret->data + cfg_ret->val_off); 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->after_do = after;
cfg_ret->val_size = val_size; cfg_ret->val_size = val_size;
BASE_PACKET_REPLY(*pk, pack->cmd + 1, pack->pack_id, err); BASE_PACKET_REPLY(*pk, pack->cmd + 1, pack->pack_id, err);

View File

@ -295,7 +295,7 @@ typedef struct _config_val
uint8_t type; // same as SANE_Value_Type uint8_t type; // same as SANE_Value_Type
uint8_t name_off; // name offset of the option in data, end with '\0' 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 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 val_size; // real size of value
uint16_t max_size; // max size of this option, this value has given in gb_json::size 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. char data[0]; // contains value and name. fetch them according name_off and val_off members.

View File

@ -470,7 +470,8 @@ void async_usb_gadget::thread_read_ep0(void)
ret = wait_fd_event(fd); ret = wait_fd_event(fd);
if( !run_ || ret <= 0 ) 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; break;
} }