获取序列号前判断设备是否在线

This commit is contained in:
gb 2023-05-31 11:37:24 +08:00
parent 00f56eab54
commit 89912ba290
1 changed files with 3 additions and 0 deletions

View File

@ -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)
{ {