Skip to content

Commit

Permalink
feat(usb_uvc): Allow any VID/PID
Browse files Browse the repository at this point in the history
  • Loading branch information
tore-espressif committed Oct 15, 2024
1 parent 9c311c8 commit 5d1e75e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions host/class/uvc/usb_host_uvc_2/uvc_host.c
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,8 @@ static esp_err_t uvc_find_and_open_usb_device(uint16_t vid, uint16_t pid, TickTy
SLIST_FOREACH(uvc_stream, &p_uvc_obj->uvc_stream_list, list_entry) {
const usb_device_desc_t *device_desc;
ESP_ERROR_CHECK(usb_host_get_device_descriptor(uvc_stream->dev_hdl, &device_desc));
if (device_desc->idVendor == vid && device_desc->idProduct == pid) {
if ((vid == device_desc->idVendor || vid == 0) &&
(pid == device_desc->idProduct || pid == 0)) {
// Return path 1:
(*dev)->dev_hdl = uvc_stream->dev_hdl;
return ESP_OK;
Expand Down Expand Up @@ -264,7 +265,8 @@ static esp_err_t uvc_find_and_open_usb_device(uint16_t vid, uint16_t pid, TickTy
assert(current_device);
const usb_device_desc_t *device_desc;
ESP_ERROR_CHECK(usb_host_get_device_descriptor(current_device, &device_desc));
if (device_desc->idVendor == vid && device_desc->idProduct == pid) {
if ((vid == device_desc->idVendor || vid == CDC_HOST_ANY_VID) &&
(pid == device_desc->idProduct || pid == CDC_HOST_ANY_PID)) {
// Return path 2:
(*dev)->dev_hdl = current_device;
return ESP_OK;
Expand Down

0 comments on commit 5d1e75e

Please sign in to comment.