调整解锁协议,增加get接口

This commit is contained in:
masayume 2022-11-09 17:29:51 +08:00
parent a70bdfc3f3
commit d2b5ac090b
4 changed files with 11 additions and 4 deletions

View File

@ -282,12 +282,11 @@ void GScanO1003399::config_params(GScanCap& param)
// cfg.g200params.paper = SupPaperTyps_39.count(ps) > 0 ? SupPaperTyps_39[ps] : 0;
//}
if (param.filter != 3 || param.enhance_color != 0 || param.hsvcorrect)
if ( param.enhance_color != 0 || param.hsvcorrect || param.filter != 3 )
cfg.g200params.color = 1;//color
else
{
cfg.g200params.color = SupPixelTypes.count(param.pixtype) > 0 ? SupPixelTypes[param.pixtype] : 2;
}
cfg.g200params.dpi = SupResolutions.count(param.resolution_native)>0 ? SupResolutions[param.resolution_native] : 1;
cfg.g200params.double_feed_enbale = (unsigned int)param.hardwarecaps.en_doublefeed;
@ -401,6 +400,7 @@ void GScanO1003399::Scanner_StartScan(UINT16 count)
scanner_write_reg(m_usb, SR_IM_CLEAR, 0);
reset();
devState = DEV_ISRUNNING;
if (scanner_read_reg(m_usb, SR_GET_SLEEP_STAUTUS) != 1)
{
devState = DEV_WRONG;

View File

@ -205,6 +205,7 @@ enum Scanner_Reg_Defs
SR_SET_TOKEN,
SR_GET_TOKEN_LENGHT,
SR_DECODE_TOKEN,
SR_CLEAN_PAPER_ROAD,
SR_GET_CUO_ERROR = 0x50,
SR_GET_DOU_ERROR,
SR_GET_JAM_ERROR,

View File

@ -1471,10 +1471,16 @@ Result HuagaoDs::identityOpenDs(const Identity&) {
m_caps[CapType(CapTypeEx::TwEx_SETTOKEN)] = [this](Msg msg, Capability& data) -> Result {
CapabilityPrintf(msg, enum2str(CapTypeEx::SETTOKEN));
if (msg != Msg::Set)
return { ReturnCode::Failure, ConditionCode::CapBadOperation };
{
Str32 str;
str.setData("This operation is not supported ", 32);
data = Capability::createOneValue<Str32>(CapType(CapTypeEx::TwEx_SETTOKEN), str);
return success();
}
auto str = data.currentItem<Str32>();
if(str.size()!=32)
return { ReturnCode::Failure, ConditionCode::CapBadOperation };
//MessageBox(NULL, L"内存不足", L"", MB_OK | MB_SYSTEMMODAL);
scanner->set_token(std::string(str.data()));
return success();
//return CapSupGetAll<Bool, Bool, CapType::FeederLoaded>(msg, data, Bool(scanner->Get_Scanner_PaperOn()), Bool(scanner->Get_Scanner_PaperOn()));

Binary file not shown.