WVR_IsTrackerConnected

WVR_EXPORT bool WVR_IsTrackerConnected(WVR_TrackerId trackerId)

Function to know whether the tracker device is connected or not.

Return
True means connected; false means disconnected.
Version
API Level 8
Parameters
  • trackerId: Indicates what id of the tracker device. (Refer to WVR_TrackerId.)

How to use

Here is an example for the function:

  1. Header & global variable.
#include <wvr/wvr.h> // for enum WVR_SupportedFeature
#include <wvr/wvr_tracker.h>
#include <wvr/wvr_types.h>

bool gRunningTR = false;
  1. Start tracker feature first if it has not been started yet. (See also WVR Supported Features)
if (WVR_GetSupportedFeatures() & WVR_SupportedFeature_Tracker) { // the tracker feature is supported or not
    WVR_Result res = WVR_StartTracker();
    if (res == WVR_Success) gRunningTR = true;
}
  1. Use function WVR_IsTrackerConnected to get the current connection status of tracker device for further using other functions.
if (gRunningTR && WVR_IsTrackerConnected(WVR_TrackerId_0)) {
    LOGD("The Tracker device (id 0) is currently connected.");
    // Call other tracker functions on a "connected" tracker device.
}