Tobii Pro SDK .NET 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.
 
static IEyeTracker GetEyeTracker (Uri address)
 Gets an eye tracker object that has the specified address.
 
static IEyeTracker GetEyeTracker (string address)
 Gets an eye tracker object that has the specified address.
 
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.
 
static async Task< EyeTrackerCollectionFindAllEyeTrackersAsync ()
 Asynchronously finds eye trackers connected to the computer or the network. Please note that subsequent calls to FindAllEyeTrackersAsync() may return the eye trackers in a different order.
 
static long GetSystemTimeStamp ()
 Retrieves the time stamp from the system clock in microseconds.
 

Properties

static EventHandler< LogEventArgsLogReceived
 Event fired when a debug log is received.
 
static Version SdkVersion [get]
 Gets the version of the SDK.
 

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.

Examples
ScreenBasedCalibration_CalibrateDuringGazeRecording.cs.

Member Function Documentation

◆ FindAllEyeTrackers()

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:

Console.WriteLine("\nSearching for all eye trackers");
foreach (IEyeTracker eyeTracker in eyeTrackers)
{
Console.WriteLine("{0}, {1}, {2}, {3}, {4}, {5}", eyeTracker.Address, eyeTracker.DeviceName, eyeTracker.Model, eyeTracker.SerialNumber, eyeTracker.FirmwareVersion, eyeTracker.RuntimeVersion);
}
Represents a read-only collection of IEyeTracker objects.
Definition: EyeTrackerCollection.cs:15
Provides static methods for searching for eye trackers as well as connecting directly to a specific e...
Definition: EyeTrackingOperations.cs:21
static EyeTrackerCollection FindAllEyeTrackers()
Finds eye trackers connected to the computer or the network. Please note that subsequent calls to Fin...
Definition: EyeTrackingOperations.cs:247
Provides methods and properties to manage and get data from an eye tracker.
Definition: IEyeTracker.cs:16
string SerialNumber
Gets the serial number of the eye tracker. All physical eye trackers have a unique serial number.
Definition: IEyeTracker.cs:523
string RuntimeVersion
Gets the runtime version of the eye tracker.
Definition: IEyeTracker.cs:538
string DeviceName
Gets the name of the eye tracker.
Definition: IEyeTracker.cs:518
Uri Address
Gets the address (URI) of the eye tracker device.
Definition: IEyeTracker.cs:513
string FirmwareVersion
Gets the firmware version of the eye tracker.
Definition: IEyeTracker.cs:533
string Model
Gets the model of the eye tracker.
Definition: IEyeTracker.cs:528
Examples
ScreenBasedCalibration_CalibrateDuringGazeRecording.cs.

◆ FindAllEyeTrackersAsync()

static async Task< EyeTrackerCollection > Tobii.Research.EyeTrackingOperations.FindAllEyeTrackersAsync ( )
inlinestatic

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

Returns
An asynchronous operation that will provide a collection of eye trackers.
internal static async Task<EyeTrackerCollection> SearchAsync()
{
Console.WriteLine("\nSearching for all eye trackers asynchronously.");
// Search for eye trackers asynchronously.
// Execution resumes here when SearchAsync is complete.
foreach (IEyeTracker eyeTracker in eyeTrackers)
{
Console.WriteLine("{0}, {1}, {2}, {3}, {4}, {5}", eyeTracker.Address, eyeTracker.DeviceName, eyeTracker.Model, eyeTracker.SerialNumber, eyeTracker.FirmwareVersion, eyeTracker.RuntimeVersion);
}
return eyeTrackers;
}
static async Task< EyeTrackerCollection > FindAllEyeTrackersAsync()
Asynchronously finds eye trackers connected to the computer or the network. Please note that subseque...
Definition: EyeTrackingOperations.cs:279

◆ GetEyeTracker() [1/2]

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)
{
Console.WriteLine("\nGet eye tracker from address string: {0}.", address);
var eyeTracker = EyeTrackingOperations.GetEyeTracker(address);
Console.WriteLine("Got eye tracker");
Console.WriteLine("Address: {0}", eyeTracker.Address);
Console.WriteLine("Device name: {0}", eyeTracker.DeviceName);
Console.WriteLine("Model: {0}", eyeTracker.Model);
Console.WriteLine("Serial number: {0}", eyeTracker.SerialNumber);
Console.WriteLine("Firmware version: {0}", eyeTracker.FirmwareVersion);
Console.WriteLine("Runtime version: {0}", eyeTracker.RuntimeVersion);
return eyeTracker;
}
static IEyeTracker GetEyeTracker(Uri address)
Gets an eye tracker object that has the specified address.
Definition: EyeTrackingOperations.cs:186

◆ GetEyeTracker() [2/2]

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)
{
Console.WriteLine("\nGet eye tracker from Uri: {0}.", address);
var eyeTracker = EyeTrackingOperations.GetEyeTracker(address);
Console.WriteLine("Got eye tracker");
Console.WriteLine("Address: {0}", eyeTracker.Address);
Console.WriteLine("Device name: {0}", eyeTracker.DeviceName);
Console.WriteLine("Model: {0}", eyeTracker.Model);
Console.WriteLine("Serial number: {0}", eyeTracker.SerialNumber);
Console.WriteLine("Firmware version: {0}", eyeTracker.FirmwareVersion);
Console.WriteLine("Runtime version: {0}", eyeTracker.RuntimeVersion);
return eyeTracker;
}
Examples
ScreenBasedCalibration_CalibrateDuringGazeRecording.cs.

◆ GetSystemTimeStamp()

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.
Console.WriteLine("\nGet system time stamp.");
var systemTimeStamp = EyeTrackingOperations.GetSystemTimeStamp();
Console.WriteLine("System time stamp is: {0}.", systemTimeStamp);
static long GetSystemTimeStamp()
Retrieves the time stamp from the system clock in microseconds.
Definition: EyeTrackingOperations.cs:296

Property Documentation

◆ LogReceived

EventHandler<LogEventArgs> Tobii.Research.EyeTrackingOperations.LogReceived
staticaddremove

Event fired when a debug log is received.

internal static void ReceiveLogs()
{
Console.WriteLine("\nReceive logs");
// Subscribe to debug logs.
EyeTrackingOperations.LogReceived += LogReceived;
// Provoke some logs.
// Unsubscribe from debug logs.
EyeTrackingOperations.LogReceived -= LogReceived;
}
private static void LogReceived(object sender, LogEventArgs e)
{
Console.WriteLine("\nSource: {0}\nLevel: {1}\nMessage: \"{2}\" Time Stamp: \"{3}\"", e.Source, e.Level, e.Message, e.SystemTimeStamp);
}
Provides data for the LogReceived event.
Definition: LogEventArgs.cs:15
long SystemTimeStamp
Gets the time stamp in microseconds according to the computer's internal clock.
Definition: LogEventArgs.cs:35
LogSource Source
Gets the log source.
Definition: LogEventArgs.cs:40
string Message
Gets the log message.
Definition: LogEventArgs.cs:50
LogLevel Level
Gets the log level.
Definition: LogEventArgs.cs:45