Skip to content

Commit 777667e

Browse files
author
Reini Urban
committed
Updates for USB33 and USB37
print the proper USB type, and the recommended action
1 parent 664bfb3 commit 777667e

File tree

4 files changed

+38
-8
lines changed

4 files changed

+38
-8
lines changed

src/UsbCamera.cpp

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ static const camera_type camera_type_list[] = {
5858
{ USB3, TIS_VENDOR_ID, 0x8415, "DFK 23UM021" },
5959
{ USB3, TIS_VENDOR_ID, 0x8416, "DFK 23UP031" },
6060
{ USB3, TIS_VENDOR_ID, 0x8426, "DMK 23UP031-AF" },
61-
{ USB3, TIS_VENDOR_ID, 0x8436, "DFK 23UP031-AF" }
61+
{ USB3, TIS_VENDOR_ID, 0x8436, "DFK 23UP031-AF" },
62+
{ USB37, TIS_VENDOR_ID, 0x9402, "DMK 37BUX178" }
6263
};
6364

6465

@@ -71,24 +72,34 @@ const camera_type find_camera_type(const unsigned int& idVendor, const unsigned
7172
return c;
7273
}
7374
}
75+
const unsigned int idProductMask = 0xFC00;
7476

7577
// type not known assure we still can handle the device
7678
// as long as it is one of ours
79+
if (idVendor != 0x199e)
80+
return camera_type_list[0];
7781

78-
if ((idProduct & (0x9000)) == (0x9000))
82+
if (idProductMask == 0x9400)
7983
{
80-
return { USB33, idVendor, idProduct, "Unkown USB33 Camera" };
84+
return { USB37, idVendor, idProduct, "Unkown USB37 Camera" };
8185
}
82-
83-
if ((idProduct & (0x8400)) == (0x8400))
86+
else if (idProductMask == 0x9000 ||
87+
idProductMask == 0x9800 ||
88+
idProductMask == 0x9c00)
8489
{
85-
return { USB3, idVendor, idProduct, "Unknown USB3 Camera" };
90+
return { USB33, idVendor, idProduct, "Unkown USB33 Camera" };
8691
}
87-
88-
if ((idProduct & (0x8200)) == (0x8200) || (idProduct & (0x8300)) == (0x8300))
92+
else if (idProductMask == 0x8200 || idProductMask == 0x8300)
8993
{
9094
return { USB2, idVendor, idProduct, "Unknown USB2 Camera" };
9195
}
96+
else if (idProductMask == 0x8400 ||
97+
idProductMask == 0x8500 ||
98+
idProductMask == 0x8400 ||
99+
idProductMask == 0x8700)
100+
{
101+
return { USB2, idVendor, idProduct, "Unknown USB2.3 Camera" };
102+
}
92103

93104
return camera_type_list[0];
94105
}

src/UsbHandler.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ std::shared_ptr<UsbCamera> UsbHandler::open_camera(std::string serial_number)
107107

108108
switch (t.camera_type)
109109
{
110+
case USB37:
110111
case USB33:
111112
return std::make_shared<Usb33Camera>(this->session, d);
112113
case USB3:

src/definitions.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ enum TYPE
3838
USB2,
3939
USB3,
4040
USB33,
41+
USB37,
4142
};
4243

4344
struct camera_type

src/firmware-update.cpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@ void print_device_info(const std::string& serial_number)
182182

183183
if (type.camera_type == USB2)
184184
{
185+
std::cout << "USB2 type" << std::endl;
185186
UVC_COMPLIANCE mode = cam->get_mode();
186187

187188
std::cout << "UVC mode is: ";
@@ -196,12 +197,28 @@ void print_device_info(const std::string& serial_number)
196197
}
197198
else if (type.camera_type == USB3 && cam->get_firmware_version() < 102)
198199
{
200+
std::cout << "USB3 type" << std::endl;
199201
std::cout << "\n!!! FIRMWARE UPGRADE REQUIRED !!!\n\n";
200202
std::cout << "To correctly interact with this camera under Linux\n";
201203
std::cout << "this device requires a firmware upgrade.\n\n";
202204
std::cout << "Please contact the manufacturer to receive the concerning firmware files."
203205
<< std::endl;
204206
}
207+
else if (type.camera_type >= USB3) {
208+
std::cout << "USB type: ";
209+
switch (type.camera_type) {
210+
case USB3: std::cout << "USB3" << std::endl; break;
211+
case USB33: std::cout << "USB33" << std::endl; break;
212+
case USB37: std::cout << "USB37" << std::endl; break;
213+
default: std::cout << "Unknown: " << type.camera_type << " "
214+
<< type.product_name << std::endl;
215+
}
216+
std::cout << "Please contact the manufacturer to check for firmware updates."
217+
<< std::endl;
218+
}
219+
else {
220+
std::cout << "USB type: " << type.product_name << std::endl;
221+
}
205222

206223
std::cout << std::endl;
207224
}

0 commit comments

Comments
 (0)