diff options
author | jdavidberger <j.david.berger@gmail.com> | 2018-04-11 10:51:45 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-11 10:51:45 -0600 |
commit | 0cd7e8d9783e8cdff7be99a330b2096a0648b192 (patch) | |
tree | 09fa3f286dc20d87448220a4f7800fd0e3f04087 /include/libsurvive/survive_api.h | |
parent | 7af7eec04bc03719aa6b2879fe599ff0cf43e032 (diff) | |
parent | 8469de349450efb8e71fd0735bfe2dd6d3c62063 (diff) | |
download | libsurvive-0cd7e8d9783e8cdff7be99a330b2096a0648b192.tar.gz libsurvive-0cd7e8d9783e8cdff7be99a330b2096a0648b192.tar.bz2 |
Merge pull request #123 from cnlohr/simple_api
Simple async api
Diffstat (limited to 'include/libsurvive/survive_api.h')
-rw-r--r-- | include/libsurvive/survive_api.h | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/include/libsurvive/survive_api.h b/include/libsurvive/survive_api.h new file mode 100644 index 0000000..64d1271 --- /dev/null +++ b/include/libsurvive/survive_api.h @@ -0,0 +1,63 @@ +#include "survive_types.h" +#include <stdbool.h> + +#ifdef __cplusplus +extern "C" { +#endif + +struct SurviveSimpleContext; +typedef struct SurviveSimpleContext SurviveSimpleContext; + +/*** + * Initialize a new instance of an simple context -- mirrors survive_init + * @return Pointer to the simple context + */ +SURVIVE_EXPORT SurviveSimpleContext *survive_simple_init(int argc, char *const *argv); + +/** + * Close all devices and free all memory associated with the given context + */ +SURVIVE_EXPORT void survive_simple_close(SurviveSimpleContext *actx); + +/** + * Start the background thread which processes various inputs and produces deliverable data like position. + */ +SURVIVE_EXPORT void survive_simple_start_thread(SurviveSimpleContext *actx); + +/** + * @return true iff the background thread is still running + */ +SURVIVE_EXPORT bool survive_simple_is_running(SurviveSimpleContext *actx); + +struct SurviveSimpleObject; +typedef struct SurviveSimpleObject SurviveSimpleObject; + +/** + * Get the first known object. Note that this also includes lighthouses + */ +SURVIVE_EXPORT const SurviveSimpleObject *survive_simple_get_first_object(SurviveSimpleContext *actx); +/** + * Get the next known object from a current one. + */ +SURVIVE_EXPORT const SurviveSimpleObject *survive_simple_get_next_object(SurviveSimpleContext *actx, + const SurviveSimpleObject *curr); + +/** + * Gets the next object which has been updated since we last looked at it with this function + */ +SURVIVE_EXPORT const SurviveSimpleObject *survive_simple_get_next_updated(SurviveSimpleContext *actx); + +/** + * Gets the pose of a given object + */ +SURVIVE_EXPORT survive_timecode survive_simple_object_get_latest_pose(const SurviveSimpleObject *sao, + SurvivePose *pose); + +/** + * Gets the null terminated name of the object. + */ +SURVIVE_EXPORT const char *survive_simple_object_name(const SurviveSimpleObject *sao); + +#ifdef __cplusplus +} +#endif |