调整部分日志;修复WIN平台枚举模块BUG
This commit is contained in:
parent
7b2a89f3a1
commit
eb83eec0d5
|
@ -250,7 +250,7 @@ char* shared_memory::get_buf(void)
|
|||
#else
|
||||
int* h = (int*)&obj_;
|
||||
char* buf = (char*)shmat(*h, 0, 0);
|
||||
VLOG_MINI_3(LOG_LEVEL_DEBUG_INFO, "shared memory %d tiny_buffer = %s, error = %d\n", *h, hg_log::format_ptr(buf).c_str(), errno);
|
||||
VLOG_MINI_3(LOG_LEVEL_DEBUG_INFO, "shared memory %d buffer = %s, error = %d\n", *h, hg_log::format_ptr(buf).c_str(), errno);
|
||||
#endif
|
||||
|
||||
return buf;
|
||||
|
|
|
@ -604,11 +604,11 @@ void hg_scanner_200::image_process(std::shared_ptr<tiny_buffer>& buffer)
|
|||
param.double_side = img_conf_.is_duplex;
|
||||
param.dpi = img_conf_.resolution_dst;
|
||||
|
||||
VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO,"param.black_white :%d\r\n",param.black_white);
|
||||
VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO,"param.channels :%d\r\n",param.channels);
|
||||
VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO,"param.color_mode :%d\r\n",param.color_mode);
|
||||
VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO,"param.double_side :%d\r\n",param.double_side);
|
||||
VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO,"param.dpi :%d\r\n",param.dpi);
|
||||
//VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO,"param.black_white :%d\r\n",param.black_white);
|
||||
//VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO,"param.channels :%d\r\n",param.channels);
|
||||
//VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO,"param.color_mode :%d\r\n",param.color_mode);
|
||||
//VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO,"param.double_side :%d\r\n",param.double_side);
|
||||
//VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO,"param.dpi :%d\r\n",param.dpi);
|
||||
|
||||
|
||||
handle = hg_imgproc::init(&img_conf_,¶m,pid_);
|
||||
|
|
|
@ -890,13 +890,19 @@ int usb_io::read_bulk(void* buf, int* len)
|
|||
int total = 0,
|
||||
err = libusb_bulk_transfer(handle_, endpoints_.bulk.in.port, (unsigned char*)buf, *len, &total, to_);
|
||||
|
||||
*len = total;
|
||||
last_err_ = usb_manager::usb_error_2_hg_err(err);
|
||||
|
||||
if (err)
|
||||
{
|
||||
VLOG_MINI_4(LOG_LEVEL_DEBUG_INFO, "libusb_bulk_transfer(%x, %d/%d) = %s\n", endpoints_.bulk.in.port, *len, total, libusb_error_name(err));
|
||||
VLOG_MINI_4(LOG_LEVEL_DEBUG_INFO, "read_bulk(%x, %d/%d) = %s\n", endpoints_.bulk.in.port, total, *len, libusb_error_name(err));
|
||||
if (err == LIBUSB_ERROR_TIMEOUT && *len == total)
|
||||
{
|
||||
int old = to_;
|
||||
to_ *= 1.5f;
|
||||
err = LIBUSB_SUCCESS;
|
||||
VLOG_MINI_2(LOG_LEVEL_DEBUG_INFO, " Read full length, we consider it as success, and increament timeout from %d to %d\n", old, to_);
|
||||
}
|
||||
}
|
||||
*len = total;
|
||||
last_err_ = usb_manager::usb_error_2_hg_err(err);
|
||||
|
||||
return last_err_;
|
||||
}
|
||||
|
|
|
@ -167,11 +167,7 @@ extern "C"
|
|||
static bool on_found(const char* file, void* param)
|
||||
{
|
||||
LPFF lpff = (LPFF)param;
|
||||
#ifdef WIN32
|
||||
char pth = '\\';
|
||||
#else
|
||||
char pth = '/';
|
||||
#endif
|
||||
char pth = PATH_SEPARATOR[0];
|
||||
const char* name = strrchr(file, pth);
|
||||
|
||||
if (name++ == nullptr)
|
||||
|
@ -217,13 +213,17 @@ extern "C"
|
|||
ret = GetLastError();
|
||||
else
|
||||
{
|
||||
do
|
||||
pei.dwSize = sizeof(pei);
|
||||
if (Module32FirstW(h, &pei))
|
||||
{
|
||||
std::string ansi(u2a(pei.szExePath));
|
||||
if (!found_file(ansi.c_str(), param))
|
||||
break;
|
||||
} while (Module32NextW(h, &pei));
|
||||
|
||||
do
|
||||
{
|
||||
std::string ansi(u2a(pei.szExePath));
|
||||
if (!found_file(ansi.c_str(), param))
|
||||
break;
|
||||
pei.dwSize = sizeof(pei);
|
||||
} while (Module32NextW(h, &pei));
|
||||
}
|
||||
CloseHandle(h);
|
||||
}
|
||||
|
||||
|
|
|
@ -11,8 +11,10 @@
|
|||
#ifdef WIN32
|
||||
#define bzero(a, l) memset(a, 0, l)
|
||||
#define PATH_SEPARATOR "\\"
|
||||
#define DLL_EXTESION ".dll"
|
||||
#else
|
||||
#define PATH_SEPARATOR "/"
|
||||
#define DLL_EXTESION ".so"
|
||||
#endif
|
||||
|
||||
#ifdef OEM_HANWANG
|
||||
|
|
|
@ -34,9 +34,9 @@ extern "C"
|
|||
{
|
||||
std::string name(""),
|
||||
pe(hg_log::pe_path(&name)),
|
||||
path("\\"),
|
||||
path(PATH_SEPARATOR),
|
||||
scanner(g_scanner_path),
|
||||
sane(hg_log::get_module_full_path((g_sane_name + ".so").c_str()));
|
||||
sane(hg_log::get_module_full_path((g_sane_name + DLL_EXTESION).c_str()));
|
||||
#ifdef WIN32
|
||||
size_t pos = g_scanner_path.rfind('\\');
|
||||
if (pos++ != std::string::npos)
|
||||
|
@ -45,7 +45,6 @@ extern "C"
|
|||
size_t pos = 0;
|
||||
g_scanner_path = hg_log::get_module_full_path((std::string(GET_BACKEND_NAME) + ".so").c_str());
|
||||
scanner = g_scanner_path;
|
||||
path = "/";
|
||||
pos = g_scanner_path.rfind('/');
|
||||
if (pos++ != std::string::npos)
|
||||
g_scanner_path.erase(pos);
|
||||
|
|
Loading…
Reference in New Issue