aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJustin Berger <j.david.berger@gmail.com>2018-03-16 15:07:00 -0600
committerJustin Berger <j.david.berger@gmail.com>2018-03-16 15:07:00 -0600
commitc5fc97504a9e46f0370587ae39f4b6e10615f813 (patch)
tree696d48b99f41c10e81d775e567429361c35c4227 /include
parentab218043f3d9ca6dd44f130a8c4255e102cb7a06 (diff)
downloadlibsurvive-c5fc97504a9e46f0370587ae39f4b6e10615f813.tar.gz
libsurvive-c5fc97504a9e46f0370587ae39f4b6e10615f813.tar.bz2
Playback now goes to a single file. Note that the file format changed too so that it always starts 'time' 'device name'
Diffstat (limited to 'include')
-rw-r--r--include/libsurvive/survive.h10
-rw-r--r--include/libsurvive/survive_types.h1
2 files changed, 9 insertions, 2 deletions
diff --git a/include/libsurvive/survive.h b/include/libsurvive/survive.h
index 7a9ec64..ed2f8d1 100644
--- a/include/libsurvive/survive.h
+++ b/include/libsurvive/survive.h
@@ -160,6 +160,7 @@ struct SurviveContext
button_process_func buttonproc;
raw_pose_func rawposeproc;
lighthouse_pose_func lighthouseposeproc;
+ htc_config_func configfunction;
struct config_group* global_config_values;
struct config_group* lh_config; //lighthouse configs
@@ -187,14 +188,18 @@ struct SurviveContext
};
-SurviveContext * survive_init_internal( int headless );
+SurviveContext *survive_init_internal(int headless, htc_config_func cfcb);
// Baked in size of FLT to verify users of the library have the correct setting.
void survive_verify_FLT_size(uint32_t user_size);
static inline SurviveContext * survive_init( int headless ) {
survive_verify_FLT_size(sizeof(FLT));
- return survive_init_internal( headless );
+ return survive_init_internal(headless, 0);
+}
+static inline SurviveContext *survive_init_with_config_cb(int headless, htc_config_func cfcb) {
+ survive_verify_FLT_size(sizeof(FLT));
+ return survive_init_internal(headless, cfcb);
}
//For any of these, you may pass in 0 for the function pointer to use default behavior.
@@ -235,6 +240,7 @@ void survive_default_angle_process( SurviveObject * so, int sensor_id, int acode
void survive_default_button_process(SurviveObject * so, uint8_t eventType, uint8_t buttonId, uint8_t axis1Id, uint16_t axis1Val, uint8_t axis2Id, uint16_t axis2Val);
void survive_default_raw_pose_process(SurviveObject *so, uint8_t lighthouse, SurvivePose *pose);
void survive_default_lighthouse_pose_process(SurviveContext *ctx, uint8_t lighthouse, SurvivePose *pose);
+int survive_default_htc_config_process(SurviveObject *so, char *ct0conf, int len);
////////////////////// Survive Drivers ////////////////////////////
diff --git a/include/libsurvive/survive_types.h b/include/libsurvive/survive_types.h
index 3c7dc7f..5f5dd1f 100644
--- a/include/libsurvive/survive_types.h
+++ b/include/libsurvive/survive_types.h
@@ -46,6 +46,7 @@ typedef struct SurviveContext SurviveContext;
typedef struct BaseStationData BaseStationData;
typedef struct SurviveCalData SurviveCalData; //XXX Warning: This may be removed. Check at a later time for its defunctness.
+typedef int (*htc_config_func)(SurviveObject *so, char *ct0conf, int len);
typedef void (*text_feedback_func)( SurviveContext * ctx, const char * fault );
typedef void (*light_process_func)( SurviveObject * so, int sensor_id, int acode, int timeinsweep, uint32_t timecode, uint32_t length, uint32_t lighthouse);
typedef void (*imu_process_func)( SurviveObject * so, int mask, FLT * accelgyro, uint32_t timecode, int id );