mirror of http://192.168.1.51:8099/lmh188/twain3.0
调整解锁协议,增加get接口
This commit is contained in:
parent
a70bdfc3f3
commit
d2b5ac090b
|
@ -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;
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -1470,11 +1470,17 @@ Result HuagaoDs::identityOpenDs(const Identity&) {
|
|||
m_query[CapType(CapTypeEx::TwEx_SETTOKEN)] = MsgSupport::Set;
|
||||
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 };
|
||||
if (msg != Msg::Set)
|
||||
{
|
||||
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()));
|
||||
|
|
BIN
huagao/stdafx.h
BIN
huagao/stdafx.h
Binary file not shown.
Loading…
Reference in New Issue