aboutsummaryrefslogtreecommitdiff
path: root/src/survive_vive.c
diff options
context:
space:
mode:
authorMike Turvey <mturvey6@gmail.com>2018-01-03 18:58:43 -0700
committerMike Turvey <mturvey6@gmail.com>2018-01-03 18:59:48 -0700
commitf183aa480c549695ac5b481fade04e62f71d1e0a (patch)
tree63e956b42d54b12f7d7c943023c4e587ebad50b1 /src/survive_vive.c
parentffb879d7a69c3c38937ff0159de0a5d1db99b713 (diff)
downloadlibsurvive-f183aa480c549695ac5b481fade04e62f71d1e0a.tar.gz
libsurvive-f183aa480c549695ac5b481fade04e62f71d1e0a.tar.bz2
Controller Buttons Fully Implemented
Fully plumbed support for controller buttons Also, commented haptic call because it messed with the vive_magic calls, given where I had it.
Diffstat (limited to 'src/survive_vive.c')
-rwxr-xr-xsrc/survive_vive.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/survive_vive.c b/src/survive_vive.c
index e271e3e..3df60ba 100755
--- a/src/survive_vive.c
+++ b/src/survive_vive.c
@@ -619,30 +619,30 @@ int survive_vive_send_magic(SurviveContext * ctx, void * drv, int magic_code, vo
//#endif
-//#if 0
- for (int i = 0; i < 0xff; i++)
+#if 0
+ for (int i = 0; i < 0xf; i++)
{
//uint8_t vive_controller_haptic_pulse[64] = { 0xff, 0x8f, 0x7, 0 /*right*/, 0xFF /*period on*/, 0xFF/*period on*/, 0xFF/*period off*/, 0xFF/*period off*/, 0xFF /* repeat Count */, 0xFF /* repeat count */ };
//uint8_t vive_controller_haptic_pulse[64] = { 0xff, 0x8f, 0x07, 0x00, 0xf4, 0x01, 0xb5, 0xa2, 0x01, 0x00 }; // data taken from Nairol's captures
uint8_t vive_controller_haptic_pulse[64] = { 0xff, 0x8f, 0x07, 0x00, 0xf4, 0x01, 0xb5, 0xa2, 0x01, 0x00 };
- //r = update_feature_report( sv->udev[USB_DEV_WATCHMAN1], 0, vive_controller_haptic_pulse, sizeof( vive_controller_haptic_pulse ) );
- r = update_feature_report(sv->udev[USB_DEV_WATCHMAN1], 0, vive_controller_haptic_pulse, sizeof(vive_controller_haptic_pulse));
+ r = update_feature_report( sv->udev[USB_DEV_WATCHMAN1], 0, vive_controller_haptic_pulse, sizeof( vive_controller_haptic_pulse ) );
+ r = getupdate_feature_report(sv->udev[USB_DEV_WATCHMAN1], 0, vive_controller_haptic_pulse, sizeof(vive_controller_haptic_pulse));
SV_INFO("UCR: %d", r);
if (r != sizeof(vive_controller_haptic_pulse)) printf("HAPTIC FAILED **************************\n"); // return 5;
OGUSleep(1000);
}
-//#endif
+#endif
#if 0
- // working code to turn off a wireless controller:
- {
- uint8_t vive_controller_off[64] = { 0xff, 0x9f, 0x04, 'o', 'f', 'f', '!' };
- //r = update_feature_report( sv->udev[USB_DEV_WATCHMAN1], 0, vive_controller_haptic_pulse, sizeof( vive_controller_haptic_pulse ) );
- r = update_feature_report(sv->udev[USB_DEV_WATCHMAN1], 0, vive_controller_off, sizeof(vive_controller_off));
- SV_INFO("UCR: %d", r);
- if (r != sizeof(vive_controller_off)) printf("OFF FAILED **************************\n"); // return 5;
- OGUSleep(1000);
- }
+ //// working code to turn off a wireless controller:
+ //{
+ // uint8_t vive_controller_off[64] = { 0xff, 0x9f, 0x04, 'o', 'f', 'f', '!' };
+ // //r = update_feature_report( sv->udev[USB_DEV_WATCHMAN1], 0, vive_controller_haptic_pulse, sizeof( vive_controller_haptic_pulse ) );
+ // r = update_feature_report(sv->udev[USB_DEV_WATCHMAN1], 0, vive_controller_off, sizeof(vive_controller_off));
+ // SV_INFO("UCR: %d", r);
+ // if (r != sizeof(vive_controller_off)) printf("OFF FAILED **************************\n"); // return 5;
+ // OGUSleep(1000);
+ //}
#endif
//if (sv->udev[USB_DEV_TRACKER0])
//{