Tobii Pro SDK Unity API
Tobii.Research.EyeTrackingOperations Class Reference

Provides static methods for searching for eye trackers as well as connecting directly to a specific eye tracker.The eye tracker object(s) returned can then be used to manipulate the eye trackers and read eye tracker data.This is the entry point for the SDK users. More...

Static Public Member Functions

static void Terminate ()
 Terminate SDK. Call this before exiting the process to release all SDK allocated resources. More...
 
static IEyeTracker GetEyeTracker (Uri address)
 Gets an eye tracker object that has the specified address. More...
 
static IEyeTracker GetEyeTracker (string address)
 Gets an eye tracker object that has the specified address. More...
 
static EyeTrackerCollection FindAllEyeTrackers ()
 Finds eye trackers connected to the computer or the network. Please note that subsequent calls to FindAllEyeTrackers() may return the eye trackers in a different order. More...
 
static long GetSystemTimeStamp ()
 Retrieves the time stamp from the system clock in microseconds. More...
 

Properties

static EventHandler< LogEventArgsLogReceived x86_64"x86"Plugins\tobii_pro.dll"tobii_pro.dll"
 Event fired when a debug log is received. More...
 
static Version SdkVersion [get]
 Gets the version of the SDK. More...
 

Detailed Description

Provides static methods for searching for eye trackers as well as connecting directly to a specific eye tracker.The eye tracker object(s) returned can then be used to manipulate the eye trackers and read eye tracker data.This is the entry point for the SDK users.

Member Function Documentation

static EyeTrackerCollection Tobii.Research.EyeTrackingOperations.FindAllEyeTrackers ( )
inlinestatic

Finds eye trackers connected to the computer or the network. Please note that subsequent calls to FindAllEyeTrackers() may return the eye trackers in a different order.

Returns
A read-only EyeTrackerCollection with found eye trackers.

Example of how to search for all available eye trackers and print their device names, models and serial numbers to the console:

Debug.Log(string.Format("\nSearching for all eye trackers"));
EyeTrackerCollection eyeTrackers = EyeTrackingOperations.FindAllEyeTrackers();
foreach (IEyeTracker eyeTracker in eyeTrackers)
{
Debug.Log(string.Format("{0}, {1}, {2}, {3}, {4}", eyeTracker.Address, eyeTracker.DeviceName, eyeTracker.Model, eyeTracker.SerialNumber, eyeTracker.FirmwareVersion));
}
static IEyeTracker Tobii.Research.EyeTrackingOperations.GetEyeTracker ( Uri  address)
inlinestatic

Gets an eye tracker object that has the specified address.

Parameters
addressThe address to the eye tracker, represented as a Uri, to use for connecting to the eye tracker.
Returns
An IEyeTracker Object if the connection to the eye tracker was successfully connected, otherwise null.
internal static IEyeTracker GetEyeTracker(Uri address)
{
Debug.Log(string.Format("\nGet eye tracker from Uri: {0}.", address));
var eyeTracker = EyeTrackingOperations.GetEyeTracker(address);
Debug.Log(string.Format("Got eye tracker"));
Debug.Log(string.Format("Address: {0}", eyeTracker.Address));
Debug.Log(string.Format("Device name: {0}", eyeTracker.DeviceName));
Debug.Log(string.Format("Model: {0}", eyeTracker.Model));
Debug.Log(string.Format("Serial number: {0}", eyeTracker.SerialNumber));
Debug.Log(string.Format("Firmware version: {0}", eyeTracker.FirmwareVersion));
return eyeTracker;
}
static IEyeTracker Tobii.Research.EyeTrackingOperations.GetEyeTracker ( string  address)
inlinestatic

Gets an eye tracker object that has the specified address.

Parameters
addressThe address to the eye tracker, represented as a string, to use for connecting to the eye tracker.
Exceptions
UriFormatExceptionIf string passed is invalid.
Returns
An IEyeTracker Object if the connection to the eye tracker was successfully connected, otherwise null.
internal static IEyeTracker GetEyeTracker(string address)
{
Debug.Log(string.Format("\nGet eye tracker from address string: {0}.", address));
var eyeTracker = EyeTrackingOperations.GetEyeTracker(address);
Debug.Log(string.Format("Got eye tracker"));
Debug.Log(string.Format("Address: {0}", eyeTracker.Address));
Debug.Log(string.Format("Device name: {0}", eyeTracker.DeviceName));
Debug.Log(string.Format("Model: {0}", eyeTracker.Model));
Debug.Log(string.Format("Serial number: {0}", eyeTracker.SerialNumber));
Debug.Log(string.Format("Firmware version: {0}", eyeTracker.FirmwareVersion));
return eyeTracker;
}
static long Tobii.Research.EyeTrackingOperations.GetSystemTimeStamp ( )
inlinestatic

Retrieves the time stamp from the system clock in microseconds.

Returns
The time stamp from the system clock in microseconds.
Debug.Log(string.Format("\nGet system time stamp."));
var systemTimeStamp = EyeTrackingOperations.GetSystemTimeStamp();
Debug.Log(string.Format("System time stamp is: {0}.", systemTimeStamp));
static void Tobii.Research.EyeTrackingOperations.Terminate ( )
inlinestatic

Terminate SDK. Call this before exiting the process to release all SDK allocated resources.

Property Documentation

EventHandler<LogEventArgs> Tobii.Research.EyeTrackingOperations.LogReceived x86_64"x86"Plugins\tobii_pro.dll"tobii_pro.dll"
staticaddremove

Event fired when a debug log is received.

internal static void ReceiveLogs()
{
Debug.Log(string.Format("\nReceive logs"));
// Subscribe to debug logs.
EyeTrackingOperations.LogReceived += LogReceived;
// Provoke some logs.
EyeTrackingOperations.FindAllEyeTrackers();
// Unsubscribe from debug logs.
EyeTrackingOperations.LogReceived -= LogReceived;
}
private static void LogReceived(object sender, LogEventArgs e)
{
Debug.Log(string.Format("\nSource: {0}\nLevel: {1}\nMessage: \"{2}\" Time Stamp: \"{3}\"", e.Source, e.Level, e.Message, e.SystemTimeStamp));
}
Version Tobii.Research.EyeTrackingOperations.SdkVersion
staticget

Gets the version of the SDK.