Functions | |
T5_EXPORT T5_Result | t5CreateContext (T5_Context *context, const T5_ClientInfo *clientInfo, void *platformContext) |
Create a context object. More... | |
T5_EXPORT void | t5DestroyContext (T5_Context *context) |
Destroy a context object. More... | |
T5_EXPORT T5_Result t5CreateContext | ( | T5_Context * | context, |
const T5_ClientInfo * | clientInfo, | ||
void * | platformContext | ||
) |
Create a context object.
Internally, this starts a client connection to the Tilt Five™ service, which is required for other library functions.
This function can succeed even if it can't connect to the service, but will continue to attempt to connect. If the service connection goes away at any time, the client will reconnect automatically when it returns.
Calling t5CreateContext() multiple times is valid, but likely unnecessary. It will result in multiple separate connections to the service. Note that you do not need multiple separate connections to connect to multiple glasses.
Contexts should be destroyed with t5DestroyContext() after a client is done. Failure to do so will keep the client connected and leak memory.
Some platforms may require additional parameters to create the context. For example, Android uses JNI, which requires information about the JVM in the form of a NativePlatformContext passed in from the Java layer.
[out] | context | - Pointer to a T5_Context to be created | ||||||||
[in] | clientInfo | - T5_ClientInfo filled by client to detail client information. | ||||||||
[in] | platformContext | - Platform specific context.
|
T5_SUCCESS | Context object was written to context |
T5_ERROR_INVALID_ARGS | Nullptr was supplied for clientInfo . |
T5_ERROR_STRING_OVERFLOW | One or more of the provided strings is too long. |
T5_EXPORT void t5DestroyContext | ( | T5_Context * | context | ) |
Destroy a context object.
This function destroys a T5_Context context object created with t5CreateContext() and closes it's connection to the Tilt Five™ service.
Attempting to use a T5_Context after it has been destroyed will result in a T5_ERROR_NO_CONTEXT error.
[in,out] | context | - T5_Context returned by t5CreateContext(). Invalidated on return. |