Skip to content

Commit

Permalink
Revised the device detection condition.
Browse files Browse the repository at this point in the history
Add THETA X PID.
  • Loading branch information
nickel110 committed Jun 5, 2022
1 parent 1b9f7f0 commit 753f735
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
8 changes: 4 additions & 4 deletions thetauvc/thetauvc.c
@@ -1,5 +1,5 @@
/*
* Copyright 2020-2021 K. Takeo. All rights reserved.
* Copyright 2020-2022 K. Takeo. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
Expand Down Expand Up @@ -75,6 +75,8 @@ static thetauvc_mode_t stream_mode[] = {
}
};

static const char iProduct[] = "RICOH THETA";

uvc_error_t
thetauvc_find_devices(uvc_context_t * ctx, uvc_device_t *** devs)
{
Expand Down Expand Up @@ -102,9 +104,7 @@ thetauvc_find_devices(uvc_context_t * ctx, uvc_device_t *** devs)
if (uvc_get_device_descriptor(dev, &desc) != UVC_SUCCESS)
continue;

if (desc->idProduct == USBPID_THETAV_UVC
|| desc->idProduct == USBPID_THETAZ1_UVC
|| desc->idProduct == USBPID_THETAS_UVC) {
if (desc->product && strncmp(desc->product, iProduct, strlen(iProduct)) == 0) {
void *tmp_ptr;

devcnt++;
Expand Down
3 changes: 2 additions & 1 deletion thetauvc/thetauvc.h
@@ -1,5 +1,5 @@
/*
* Copyright 2020 K. Takeo. All rights reserved.
* Copyright 2020-2022 K. Takeo. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
Expand Down Expand Up @@ -40,6 +40,7 @@ extern "C" {
#define USBPID_THETAS_UVC 0x2711
#define USBPID_THETAV_UVC 0x2712
#define USBPID_THETAZ1_UVC 0x2715
#define USBPID_THETAX_UVC 0x2717

enum thetauvc_mode_code {
THETAUVC_MODE_FHD_2997 = 0,
Expand Down

0 comments on commit 753f735

Please sign in to comment.