diff --git a/hgdriver/hgdev/hg_scanner.cpp b/hgdriver/hgdev/hg_scanner.cpp index 8fca720..c7781cb 100644 --- a/hgdriver/hgdev/hg_scanner.cpp +++ b/hgdriver/hgdev/hg_scanner.cpp @@ -470,6 +470,8 @@ int hg_scanner::set_server_blacklist_lock() string sn = get_serial_num(); string fv = get_firmware_version(); + if (fv.empty()) + return -1; strcpy(snbuffer, sn.c_str()); strcpy(fvbuffer, fv.c_str()); sprintf(pidbuffer, "%0x", pid_); diff --git a/hgdriver/hgdev/hg_scanner_239.cpp b/hgdriver/hgdev/hg_scanner_239.cpp index 5e763a7..4aa9bcc 100644 --- a/hgdriver/hgdev/hg_scanner_239.cpp +++ b/hgdriver/hgdev/hg_scanner_239.cpp @@ -396,6 +396,9 @@ void hg_scanner_239::init_version(void) { std::string fv(get_firmware_version()), sn(get_serial_num()); + if (fv.empty()) + return; + string dev = fv.substr(0, 2); string ver = fv.substr(2, 3); string date = fv.substr(5, 5); diff --git a/hgdriver/hgdev/hg_scanner_302.cpp b/hgdriver/hgdev/hg_scanner_302.cpp index f85bab8..ab0258e 100644 --- a/hgdriver/hgdev/hg_scanner_302.cpp +++ b/hgdriver/hgdev/hg_scanner_302.cpp @@ -411,7 +411,8 @@ void hg_scanner_302::init_version(void) { std::string fv(get_firmware_version()), sn(get_serial_num()); - + if (fv.empty()) + return; VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO, "Firmware version: %s\n", fv.c_str()); VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO, "Serial number: %s\n", sn.c_str()); //VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO, " HG3399 IP: %s\n", get_ip().c_str()); diff --git a/hgdriver/hgdev/hg_scanner_402.cpp b/hgdriver/hgdev/hg_scanner_402.cpp index d59a81a..0e66f31 100644 --- a/hgdriver/hgdev/hg_scanner_402.cpp +++ b/hgdriver/hgdev/hg_scanner_402.cpp @@ -379,7 +379,8 @@ void hg_scanner_402::init_version(void) { std::string fv(get_firmware_version()), sn(get_serial_num()); - + if (fv.empty()) + return; VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO, "Firmware version: %s\n", fv.c_str()); VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO, "Serial number: %s\n", sn.c_str()); //VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO, " HG3399 IP: %s\n", get_ip().c_str()); diff --git a/hgdriver/hgdev/scanner_manager.cpp b/hgdriver/hgdev/scanner_manager.cpp index f789f26..ebb871c 100644 --- a/hgdriver/hgdev/scanner_manager.cpp +++ b/hgdriver/hgdev/scanner_manager.cpp @@ -63,7 +63,7 @@ g_supporting_devices[] = { #else {0x3072, PID_AND_NAME(100, SCANNER_NAME_HG_G100), "G100", "", &hg_scanner_mgr::create_scanner_g100} , {0x3072, PID_AND_NAME(139, SCANNER_NAME_HG_G100), "G100", "", &hg_scanner_mgr::create_scanner_g239} - , {0x3072, PID_AND_NAME(200, SCANNER_NAME_HG_G200), "G200", "", &hg_scanner_mgr::create_scanner_g239} + , {0x3072, PID_AND_NAME(200, SCANNER_NAME_HG_G200), "G200", "", &hg_scanner_mgr::create_scanner_g100} , {0x3072, PID_AND_NAME(239, SCANNER_NAME_HG_G200), "G200", "", &hg_scanner_mgr::create_scanner_g239} , {0x3072, PID_AND_NAME(300, SCANNER_NAME_HG_G300), "G300", "", &hg_scanner_mgr::create_scanner_g300} , {0x3072, PID_AND_NAME(302, SCANNER_NAME_HG_G300), "G300", "", &hg_scanner_mgr::create_scanner_g302}