device_io_control增加对待纸扫描功能的支持

This commit is contained in:
gb 2023-07-02 11:32:43 +08:00
parent cdc979ea38
commit 0c851dc2a0
1 changed files with 22 additions and 0 deletions

View File

@ -4219,6 +4219,28 @@ int hg_scanner::device_io_control(unsigned long code, void* data, unsigned* len)
return SCANNER_ERR_OK;
}
else if (code == IO_CTRL_CODE_SET_SCAN_WHEN_PAPER_ON)
{
long l = len ? *len : sizeof(bool);
int ret = setting_auto_paper_scan(data, &l);
if (len)
*len = l;
return ret;
}
else if (code == IO_CTRL_CODE_GET_SCAN_WHEN_PAPER_ON)
{
if (!len)
return SCANNER_ERR_INVALID_PARAMETER;
if (*len < sizeof(bool))
{
*len = sizeof(bool);
return SCANNER_ERR_INSUFFICIENT_MEMORY;
}
*(bool*)data = is_auto_paper_scan;
return SCANNER_ERR_OK;
}
return SCANNER_ERR_DEVICE_NOT_SUPPORT;
}