aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMichael Turvey <mwturvey@users.noreply.github.com>2018-01-04 08:48:40 -0700
committerGitHub <noreply@github.com>2018-01-04 08:48:40 -0700
commit98d62e595b90a76ecd6d4f87e95e5cc6af45a4ce (patch)
tree0ef5325a3494099b7c18c085106486fc5b6368f2 /include
parent1d98830c2b99afc7dfd02ada440acd30652db61b (diff)
parent499b80ae7b538f8e66f5ec8bfa60c7136a3babf5 (diff)
downloadlibsurvive-98d62e595b90a76ecd6d4f87e95e5cc6af45a4ce.tar.gz
libsurvive-98d62e595b90a76ecd6d4f87e95e5cc6af45a4ce.tar.bz2
Merge pull request #90 from mwturvey/MakeTrackingGood
Haptic Call Plumbed
Diffstat (limited to 'include')
-rw-r--r--include/libsurvive/survive.h5
-rw-r--r--include/libsurvive/survive_types.h2
2 files changed, 7 insertions, 0 deletions
diff --git a/include/libsurvive/survive.h b/include/libsurvive/survive.h
index e4afadf..0cfab1f 100644
--- a/include/libsurvive/survive.h
+++ b/include/libsurvive/survive.h
@@ -19,6 +19,7 @@ struct SurviveObject
char codename[4]; //3 letters, null-terminated. Currently HMD, WM0, WM1.
char drivername[4]; //3 letters for driver. Currently "HTC"
+ void *driver;
int32_t buttonmask;
int16_t axis1;
@@ -68,6 +69,7 @@ struct SurviveObject
FLT* gyro_bias; // size is FLT*3. contains x,y,z
FLT* gyro_scale; // size is FLT*3. contains x,y,z
+ haptic_func haptic;
//Debug
int tsl;
@@ -179,6 +181,9 @@ void survive_cal_install( SurviveContext * ctx ); //XXX This will be removed if
// Read back a human-readable string description of the calibration status
int survive_cal_get_status( struct SurviveContext * ctx, char * description, int description_length );
+// Induce haptic feedback
+int survive_haptic(SurviveObject * so, uint8_t reserved, uint16_t pulseHigh, uint16_t pulseLow, uint16_t repeatCount);
+
//Call these from your callback if overridden.
//Accept higher-level data.
void survive_default_light_process( SurviveObject * so, int sensor_id, int acode, int timeinsweep, uint32_t timecode, uint32_t length , uint32_t lh);
diff --git a/include/libsurvive/survive_types.h b/include/libsurvive/survive_types.h
index fa3eb2f..9a6e148 100644
--- a/include/libsurvive/survive_types.h
+++ b/include/libsurvive/survive_types.h
@@ -44,6 +44,8 @@ typedef void (*imu_process_func)( SurviveObject * so, int mask, FLT * accelgyro,
typedef void (*angle_process_func)( SurviveObject * so, int sensor_id, int acode, uint32_t timecode, FLT length, FLT angle, uint32_t lh);
typedef void (*button_process_func)(SurviveObject * so, uint8_t eventType, uint8_t buttonId, uint8_t axis1Id, uint16_t axis1Val, uint8_t axis2Id, uint16_t axis2Val);
+typedef int(*haptic_func)(SurviveObject * so, uint8_t reserved, uint16_t pulseHigh , uint16_t pulseLow, uint16_t repeatCount);
+
//Device drivers (prefix your drivers with "DriverReg") i.e.
// REGISTER_LINKTIME( DriverRegHTCVive );
typedef int (*DeviceDriver)( SurviveContext * ctx );