diff options
-rw-r--r-- | Makefile | 12 | ||||
-rwxr-xr-x | src/survive_vive.c | 31 | ||||
-rw-r--r-- | useful_files/81-vive.rules | 4 |
3 files changed, 13 insertions, 34 deletions
@@ -57,18 +57,18 @@ else # Linux / FreeBSD GRAPHICS_LOFI:=redist/CNFGFunctions.c redist/CNFGXDriver.c endif +ifdef LINUX_USE_HIDAPI + CFLAGS:=$(CFLAGS) -DHIDAPI + REDISTS:=$(REDISTS) redist/hid-linux.c + LDFLAGS:=$(LDFLAGS) -ludev +endif + ifdef MINIMAL LIBSURVIVE_C:=$(REDISTS) $(LIBSURVIVE_CORE) $(MINIMAL_NEEDED) else LIBSURVIVE_C:=$(POSERS) $(REDISTS) $(LIBSURVIVE_CORE) $(SBA) $(MINIMAL_NEEDED) $(AUX_NEEDED) endif -ifdef LINUX_USE_HIDAPI - CFLAGS:=$(CFLAGS) -DHIDAPI - REDISTS:=$(REDISTS) redist/hid-linux.o - LDFLAGS:=$(LDFLAGS) -ludev -endif - #Actually make object and dependency lists. LIBSURVIVE_O:=$(LIBSURVIVE_C:%.c=$(OBJDIR)/%.o) diff --git a/src/survive_vive.c b/src/survive_vive.c index 493215a..8a4bcd5 100755 --- a/src/survive_vive.c +++ b/src/survive_vive.c @@ -47,15 +47,15 @@ const short vidpids[] = { 0x28de, 0x2000, 0, //Valve HMD IMU & Lighthouse Sensors 0x28de, 0x2101, 0, //Valve Watchman 0x28de, 0x2101, 1, //Valve Watchman - 0x28de, 0x2022, 0, //HTC Tracker + 0x28de, 0x2300, 0, //HTC Tracker 0x28de, 0x2012, 0, //Valve Watchman, USB connected #ifdef HIDAPI 0x28de, 0x2000, 1, //Valve HMD lighthouse(B) (only used on HIDAPI, for lightcap) - 0x28de, 0x2022, 1, //HTC Tracker (only used on HIDAPI, for lightcap) + 0x28de, 0x2300, 1, //HTC Tracker (only used on HIDAPI, for lightcap) 0x28de, 0x2012, 1, //Valve Watchman, USB connected (only used on HIDAPI, for lightcap) 0x28de, 0x2000, 2, //Valve HMD lighthouse(B) (only used on HIDAPI, for lightcap) - 0x28de, 0x2022, 2, //HTC Tracker (only used on HIDAPI, for lightcap) + 0x28de, 0x2300, 2, //HTC Tracker (only used on HIDAPI, for lightcap) 0x28de, 0x2012, 2, //Valve Watchman, USB connected (only used on HIDAPI, for lightcap) #endif @@ -1515,6 +1515,8 @@ void survive_data_cb( SurviveUSBInterface * si ) break; } case USB_IF_LIGHTCAP: + case USB_IF_TRACKER0_LIGHTCAP: + case USB_IF_W_WATCHMAN1_LIGHTCAP: { int i; for( i = 0; i < 9; i++ ) @@ -1528,29 +1530,6 @@ void survive_data_cb( SurviveUSBInterface * si ) } break; } - case USB_IF_W_WATCHMAN1_LIGHTCAP: - case USB_IF_TRACKER0_LIGHTCAP: - { - int i=0; - for( i = 0; i < 7; i++ ) - { - unsigned short *sensorId = (unsigned short *)readdata; - unsigned short *length = (unsigned short *)(&(readdata[2])); - unsigned long *time = (unsigned long *)(&(readdata[4])); - LightcapElement le; - le.sensor_id = (uint8_t)POP2; - le.length = POP2; - le.timestamp = POP4; - if( le.sensor_id > 0xfd ) continue; // - handle_lightcap( obj, &le ); - } - break; - - if (id != 33) - { - int a = 0; // breakpoint here - } - } case USB_IF_TRACKER0_BUTTONS: case USB_IF_W_WATCHMAN1_BUTTONS: { diff --git a/useful_files/81-vive.rules b/useful_files/81-vive.rules index ea5be37..a8b4e63 100644 --- a/useful_files/81-vive.rules +++ b/useful_files/81-vive.rules @@ -6,7 +6,7 @@ KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{idVendor}=="28de", ATTRS{idProduct KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{idVendor}=="28de", ATTRS{idProduct}=="2050", TAG+="uaccess" KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{idVendor}=="28de", ATTRS{idProduct}=="2011", TAG+="uaccess" KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{idVendor}=="28de", ATTRS{idProduct}=="2012", TAG+="uaccess" -KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{idVendor}=="28de", ATTRS{idProduct}=="2022", TAG+="uaccess" +KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{idVendor}=="28de", ATTRS{idProduct}=="2300", TAG+="uaccess" SUBSYSTEM=="usb", ATTRS{idVendor}=="0bb4", ATTRS{idProduct}=="2c87", TAG+="uaccess" # HTC Camera USB Node @@ -21,7 +21,7 @@ SUBSYSTEM=="usb", ATTRS{idVendor}=="0bb4", ATTRS{idProduct}=="2c87", MODE="0666" SUBSYSTEM=="usb", ATTRS{idVendor}=="28de", ATTRS{idProduct}=="2000", MODE="0666" # Light input SUBSYSTEM=="usb", ATTRS{idVendor}=="28de", ATTRS{idProduct}=="2101", MODE="0666" # Watchman SUBSYSTEM=="usb", ATTRS{idVendor}=="28de", ATTRS{idProduct}=="2012", MODE="0666" # Watchman wired -SUBSYSTEM=="usb", ATTRS{idVendor}=="28de", ATTRS{idProduct}=="2022", MODE="0666" # Tracker wired +SUBSYSTEM=="usb", ATTRS{idVendor}=="28de", ATTRS{idProduct}=="2300", MODE="0666" # Tracker wired #KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{idVendor}=="0bb4", ATTR{idProduct}=="2c87", MODE="0666" # HTC #KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{idVendor}=="28de", ATTR{idProduct}=="2000", MODE="0666" # Valve |