From c5fc97504a9e46f0370587ae39f4b6e10615f813 Mon Sep 17 00:00:00 2001 From: Justin Berger Date: Fri, 16 Mar 2018 15:07:00 -0600 Subject: Playback now goes to a single file. Note that the file format changed too so that it always starts 'time' 'device name' --- include/libsurvive/survive.h | 10 ++++++++-- include/libsurvive/survive_types.h | 1 + 2 files changed, 9 insertions(+), 2 deletions(-) (limited to 'include') 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 ); -- cgit v1.2.3