From 753f73546282be7241c6431b5fb6e6997d80fe99 Mon Sep 17 00:00:00 2001 From: Koji Takeo Date: Sat, 4 Jun 2022 18:11:58 +0900 Subject: [PATCH] Revised the device detection condition. Add THETA X PID. --- thetauvc/thetauvc.c | 8 ++++---- thetauvc/thetauvc.h | 3 ++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/thetauvc/thetauvc.c b/thetauvc/thetauvc.c index e8ca6b8..e8791d0 100644 --- a/thetauvc/thetauvc.c +++ b/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 @@ -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) { @@ -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++; diff --git a/thetauvc/thetauvc.h b/thetauvc/thetauvc.h index d09e9a9..49a79b1 100644 --- a/thetauvc/thetauvc.h +++ b/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 @@ -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,