diff --git a/src/UsbCamera.cpp b/src/UsbCamera.cpp index da90ca7..818c5c9 100644 --- a/src/UsbCamera.cpp +++ b/src/UsbCamera.cpp @@ -58,7 +58,8 @@ static const camera_type camera_type_list[] = { { USB3, TIS_VENDOR_ID, 0x8415, "DFK 23UM021" }, { USB3, TIS_VENDOR_ID, 0x8416, "DFK 23UP031" }, { USB3, TIS_VENDOR_ID, 0x8426, "DMK 23UP031-AF" }, - { USB3, TIS_VENDOR_ID, 0x8436, "DFK 23UP031-AF" } + { USB3, TIS_VENDOR_ID, 0x8436, "DFK 23UP031-AF" }, + { USB37, TIS_VENDOR_ID, 0x9402, "DMK 37BUX178" } }; @@ -71,24 +72,34 @@ const camera_type find_camera_type(const unsigned int& idVendor, const unsigned return c; } } + const unsigned int idProductMask = 0xFC00; // type not known assure we still can handle the device // as long as it is one of ours + if (idVendor != 0x199e) + return camera_type_list[0]; - if ((idProduct & (0x9000)) == (0x9000)) + if (idProductMask == 0x9400) { - return { USB33, idVendor, idProduct, "Unkown USB33 Camera" }; + return { USB37, idVendor, idProduct, "Unkown USB37 Camera" }; } - - if ((idProduct & (0x8400)) == (0x8400)) + else if (idProductMask == 0x9000 || + idProductMask == 0x9800 || + idProductMask == 0x9c00) { - return { USB3, idVendor, idProduct, "Unknown USB3 Camera" }; + return { USB33, idVendor, idProduct, "Unkown USB33 Camera" }; } - - if ((idProduct & (0x8200)) == (0x8200) || (idProduct & (0x8300)) == (0x8300)) + else if (idProductMask == 0x8200 || idProductMask == 0x8300) { return { USB2, idVendor, idProduct, "Unknown USB2 Camera" }; } + else if (idProductMask == 0x8400 || + idProductMask == 0x8500 || + idProductMask == 0x8600 || + idProductMask == 0x8700) + { + return { USB2, idVendor, idProduct, "Unknown USB2.3 Camera" }; + } return camera_type_list[0]; } diff --git a/src/UsbHandler.cpp b/src/UsbHandler.cpp index 8194be9..ff29088 100644 --- a/src/UsbHandler.cpp +++ b/src/UsbHandler.cpp @@ -107,6 +107,7 @@ std::shared_ptr UsbHandler::open_camera(std::string serial_number) switch (t.camera_type) { + case USB37: case USB33: return std::make_shared(this->session, d); case USB3: diff --git a/src/definitions.h b/src/definitions.h index 67a5a2d..e712702 100644 --- a/src/definitions.h +++ b/src/definitions.h @@ -38,6 +38,7 @@ enum TYPE USB2, USB3, USB33, + USB37, }; struct camera_type diff --git a/src/firmware-update.cpp b/src/firmware-update.cpp index 66a225a..3e14b0d 100644 --- a/src/firmware-update.cpp +++ b/src/firmware-update.cpp @@ -182,6 +182,7 @@ void print_device_info(const std::string& serial_number) if (type.camera_type == USB2) { + std::cout << "USB2 type" << std::endl; UVC_COMPLIANCE mode = cam->get_mode(); std::cout << "UVC mode is: "; @@ -196,12 +197,28 @@ void print_device_info(const std::string& serial_number) } else if (type.camera_type == USB3 && cam->get_firmware_version() < 102) { + std::cout << "USB3 type" << std::endl; std::cout << "\n!!! FIRMWARE UPGRADE REQUIRED !!!\n\n"; std::cout << "To correctly interact with this camera under Linux\n"; std::cout << "this device requires a firmware upgrade.\n\n"; std::cout << "Please contact the manufacturer to receive the concerning firmware files." << std::endl; } + else if (type.camera_type >= USB3) { + std::cout << "USB type: "; + switch (type.camera_type) { + case USB3: std::cout << "USB3" << std::endl; break; + case USB33: std::cout << "USB33" << std::endl; break; + case USB37: std::cout << "USB37" << std::endl; break; + default: std::cout << "Unknown: " << type.camera_type << " " + << type.product_name << std::endl; + } + std::cout << "Please contact the manufacturer to check for firmware updates." + << std::endl; + } + else { + std::cout << "USB type: " << type.product_name << std::endl; + } std::cout << std::endl; }