获取序列号前判断设备是否在线
This commit is contained in:
parent
00f56eab54
commit
89912ba290
|
@ -3640,6 +3640,9 @@ int hg_scanner::device_io_control(unsigned long code, void* data, unsigned* len)
|
||||||
}
|
}
|
||||||
else if(code == IO_CTRL_CODE_GET_SERIAL)
|
else if(code == IO_CTRL_CODE_GET_SERIAL)
|
||||||
{
|
{
|
||||||
|
if (!is_online())
|
||||||
|
return SCANNER_ERR_DEVICE_NOT_FOUND;
|
||||||
|
|
||||||
std::string ser = get_serial_num();
|
std::string ser = get_serial_num();
|
||||||
if (*len < ser.size() + 1)
|
if (*len < ser.size() + 1)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue