HGScannerLib增加设备关机和重启的接口
This commit is contained in:
parent
0335466fc8
commit
65958831b9
|
@ -20,5 +20,7 @@ HGLib_ReleaseDeviceParamGroupList
|
|||
HGLib_ReleaseDeviceParam
|
||||
HGLib_ResetDeviceParam
|
||||
HGLib_DeviceIsPaperOn
|
||||
HGLib_DeviceRestart
|
||||
HGLib_DeviceShutDown
|
||||
HGLib_StartDeviceScan
|
||||
HGLib_StopDeviceScan
|
Binary file not shown.
Binary file not shown.
|
@ -944,6 +944,26 @@ HGBool HGLibDeviceImpl::IsPaperOn()
|
|||
return HGFALSE;
|
||||
}
|
||||
|
||||
HGBool HGLibDeviceImpl::Restart()
|
||||
{
|
||||
SANE_Power stat = SANE_Power::SANE_POWER_RESTART;
|
||||
unsigned int len = sizeof(SANE_Power);
|
||||
SANE_Status status = sane_io_control(m_devHandle, IO_CTRL_CODE_SET_POWER_LEVEL, &stat, &len);
|
||||
if (SANE_STATUS_GOOD == status)
|
||||
return HGTRUE;
|
||||
return HGFALSE;
|
||||
}
|
||||
|
||||
HGBool HGLibDeviceImpl::ShutDown()
|
||||
{
|
||||
SANE_Power stat = SANE_Power::SANE_POWER_SHUTDOWN;
|
||||
unsigned int len = sizeof(SANE_Power);
|
||||
SANE_Status status = sane_io_control(m_devHandle, IO_CTRL_CODE_SET_POWER_LEVEL, &stat, &len);
|
||||
if (SANE_STATUS_GOOD == status)
|
||||
return HGTRUE;
|
||||
return HGFALSE;
|
||||
}
|
||||
|
||||
HGBool HGLibDeviceImpl::StartScan(HGLibDeviceScanEventFunc eventFunc, HGPointer eventParam,
|
||||
HGLibDeviceScanImageFunc imageFunc, HGPointer imageParam)
|
||||
{
|
||||
|
|
|
@ -32,6 +32,8 @@ public:
|
|||
static HGBool ReleaseParam(HGLibDeviceParam* param);
|
||||
HGBool ResetParam();
|
||||
HGBool IsPaperOn();
|
||||
HGBool Restart();
|
||||
HGBool ShutDown();
|
||||
HGBool StartScan(HGLibDeviceScanEventFunc eventFunc, HGPointer eventParam,
|
||||
HGLibDeviceScanImageFunc imageFunc, HGPointer imageParam);
|
||||
HGBool StopScan();
|
||||
|
|
|
@ -219,6 +219,28 @@ HGBool HGAPI HGLib_DeviceIsPaperOn(HGLibDevice device)
|
|||
return deviceImpl->IsPaperOn();
|
||||
}
|
||||
|
||||
HGBool HGAPI HGLib_DeviceRestart(HGLibDevice device)
|
||||
{
|
||||
if (NULL == device)
|
||||
{
|
||||
return HGFALSE;
|
||||
}
|
||||
|
||||
HGLibDeviceImpl* deviceImpl = (HGLibDeviceImpl*)device;
|
||||
return deviceImpl->Restart();
|
||||
}
|
||||
|
||||
HGBool HGAPI HGLib_DeviceShutDown(HGLibDevice device)
|
||||
{
|
||||
if (NULL == device)
|
||||
{
|
||||
return HGFALSE;
|
||||
}
|
||||
|
||||
HGLibDeviceImpl* deviceImpl = (HGLibDeviceImpl*)device;
|
||||
return deviceImpl->ShutDown();
|
||||
}
|
||||
|
||||
HGBool HGAPI HGLib_StartDeviceScan(HGLibDevice device, HGLibDeviceScanEventFunc eventFunc, HGPointer eventParam,
|
||||
HGLibDeviceScanImageFunc imageFunc, HGPointer imageParam)
|
||||
{
|
||||
|
|
|
@ -494,6 +494,12 @@ HGEXPORT HGBool HGAPI HGLib_ResetDeviceParam(HGLibDevice device);
|
|||
/* 设备是否有纸 */
|
||||
HGEXPORT HGBool HGAPI HGLib_DeviceIsPaperOn(HGLibDevice device);
|
||||
|
||||
/* 重启设备 */
|
||||
HGEXPORT HGBool HGAPI HGLib_DeviceRestart(HGLibDevice device);
|
||||
|
||||
/* 关闭设备 */
|
||||
HGEXPORT HGBool HGAPI HGLib_DeviceShutDown(HGLibDevice device);
|
||||
|
||||
/* 开始扫描 */
|
||||
HGEXPORT HGBool HGAPI HGLib_StartDeviceScan(HGLibDevice device, HGLibDeviceScanEventFunc eventFunc, HGPointer eventParam,
|
||||
HGLibDeviceScanImageFunc imageFunc, HGPointer imageParam);
|
||||
|
|
Loading…
Reference in New Issue