Tobii Pro SDK C API
tobii_research_eyetracker.h File Reference

Functionality for an eye tracker. More...

Go to the source code of this file.

Data Structures

struct  TobiiResearchDisplayArea
 
struct  TobiiResearchCalibrationData
 
struct  TobiiResearchGazeOutputFrequencies
 
struct  TobiiResearchEyeTrackingModes
 

Typedefs

typedef enum TobiiResearchLicenseValidationResult TobiiResearchLicenseValidationResult
 

Enumerations

enum  TobiiResearchCapabilities {
  TOBII_RESEARCH_CAPABILITIES_NONE , TOBII_RESEARCH_CAPABILITIES_CAN_SET_DISPLAY_AREA = 1 << 0 , TOBII_RESEARCH_CAPABILITIES_HAS_EXTERNAL_SIGNAL = 1 << 1 , TOBII_RESEARCH_CAPABILITIES_HAS_EYE_IMAGES = 1 << 2 ,
  TOBII_RESEARCH_CAPABILITIES_HAS_GAZE_DATA = 1 << 3 , TOBII_RESEARCH_CAPABILITIES_CAN_DO_SCREEN_BASED_CALIBRATION = 1 << 5 , TOBII_RESEARCH_CAPABILITIES_CAN_DO_MONOCULAR_CALIBRATION = 1 << 8 , TOBII_RESEARCH_CAPABILITIES_HAS_EYE_OPENNESS_DATA = 1 << 9
}
 
enum  TobiiResearchLicenseValidationResult {
  TOBII_RESEARCH_LICENSE_VALIDATION_RESULT_OK , TOBII_RESEARCH_LICENSE_VALIDATION_RESULT_TAMPERED , TOBII_RESEARCH_LICENSE_VALIDATION_RESULT_INVALID_APPLICATION_SIGNATURE , TOBII_RESEARCH_LICENSE_VALIDATION_RESULT_NONSIGNED_APPLICATION ,
  TOBII_RESEARCH_LICENSE_VALIDATION_RESULT_EXPIRED , TOBII_RESEARCH_LICENSE_VALIDATION_RESULT_PREMATURE , TOBII_RESEARCH_LICENSE_VALIDATION_RESULT_INVALID_PROCESS_NAME , TOBII_RESEARCH_LICENSE_VALIDATION_RESULT_INVALID_SERIAL_NUMBER ,
  TOBII_RESEARCH_LICENSE_VALIDATION_RESULT_INVALID_MODEL , TOBII_RESEARCH_LICENSE_VALIDATION_RESULT_UNKNOWN
}
 

Functions

TOBII_RESEARCH_API TobiiResearchStatus TOBII_RESEARCH_CALL tobii_research_get_address (TobiiResearchEyeTracker *eyetracker, char **address)
 Gets the address (URI) of the eye tracker device. More...
 
TOBII_RESEARCH_API TobiiResearchStatus TOBII_RESEARCH_CALL tobii_research_get_serial_number (TobiiResearchEyeTracker *eyetracker, char **serial_number)
 Gets the serial number of the eye tracker. All physical eye trackers have a unique serial number. More...
 
TOBII_RESEARCH_API TobiiResearchStatus TOBII_RESEARCH_CALL tobii_research_get_device_name (TobiiResearchEyeTracker *eyetracker, char **device_name)
 Gets the name of the eye tracker. More...
 
TOBII_RESEARCH_API TobiiResearchStatus TOBII_RESEARCH_CALL tobii_research_get_model (TobiiResearchEyeTracker *eyetracker, char **model)
 Gets the model of the eye tracker. More...
 
TOBII_RESEARCH_API TobiiResearchStatus TOBII_RESEARCH_CALL tobii_research_get_firmware_version (TobiiResearchEyeTracker *eyetracker, char **fw_version)
 Gets the firmware version of the eye tracker. More...
 
TOBII_RESEARCH_API TobiiResearchStatus TOBII_RESEARCH_CALL tobii_research_get_runtime_version (TobiiResearchEyeTracker *eyetracker, char **runtime_version)
 Gets the runtime build version of the eye tracker. More...
 
TOBII_RESEARCH_API TobiiResearchStatus TOBII_RESEARCH_CALL tobii_research_get_capabilities (TobiiResearchEyeTracker *eyetracker, TobiiResearchCapabilities *capabilities)
 Gets the capabilities of the device. More...
 
TOBII_RESEARCH_API TobiiResearchStatus TOBII_RESEARCH_CALL tobii_research_retrieve_calibration_data (TobiiResearchEyeTracker *eyetracker, TobiiResearchCalibrationData **data)
 Gets the calibration data used currently by the eye tracker. More...
 
TOBII_RESEARCH_API void TOBII_RESEARCH_CALL tobii_research_free_calibration_data (TobiiResearchCalibrationData *data)
 Free memory allocation for the calibration data received via tobii_research_retrieve_calibration_data. More...
 
TOBII_RESEARCH_API TobiiResearchStatus TOBII_RESEARCH_CALL tobii_research_apply_calibration_data (TobiiResearchEyeTracker *eyetracker, const TobiiResearchCalibrationData *data)
 Sets the provided calibration data to the eye tracker, which means it will be active calibration. More...
 
TOBII_RESEARCH_API TobiiResearchStatus TOBII_RESEARCH_CALL tobii_research_get_all_gaze_output_frequencies (TobiiResearchEyeTracker *eyetracker, TobiiResearchGazeOutputFrequencies **frequencies)
 Gets an array of gaze output frequencies supported by the eye tracker. More...
 
TOBII_RESEARCH_API void TOBII_RESEARCH_CALL tobii_research_free_gaze_output_frequencies (TobiiResearchGazeOutputFrequencies *frequencies)
 Free memory allocation for the gaze output frequencies received via tobii_research_free_gaze_output_frequencies. More...
 
TOBII_RESEARCH_API TobiiResearchStatus TOBII_RESEARCH_CALL tobii_research_get_gaze_output_frequency (TobiiResearchEyeTracker *eyetracker, float *gaze_output_frequency)
 Gets the gaze output frequency of the eye tracker. More...
 
TOBII_RESEARCH_API TobiiResearchStatus TOBII_RESEARCH_CALL tobii_research_set_gaze_output_frequency (TobiiResearchEyeTracker *eyetracker, float gaze_output_frequency)
 Sets the gaze output frequency of the eye tracker. More...
 
TOBII_RESEARCH_API TobiiResearchStatus TOBII_RESEARCH_CALL tobii_research_get_all_eye_tracking_modes (TobiiResearchEyeTracker *eyetracker, TobiiResearchEyeTrackingModes **modes)
 Gets a all eye tracking modes supported by the eye tracker. More...
 
TOBII_RESEARCH_API void TOBII_RESEARCH_CALL tobii_research_free_eye_tracking_modes (TobiiResearchEyeTrackingModes *modes)
 Free memory allocation for the eye tracking modes received via tobii_research_get_all_eye_tracking_modes. More...
 
TOBII_RESEARCH_API TobiiResearchStatus TOBII_RESEARCH_CALL tobii_research_get_eye_tracking_mode (TobiiResearchEyeTracker *eyetracker, char **eye_tracking_mode)
 Gets the eye tracking mode of the eye tracker. More...
 
TOBII_RESEARCH_API TobiiResearchStatus TOBII_RESEARCH_CALL tobii_research_set_eye_tracking_mode (TobiiResearchEyeTracker *eyetracker, const char *eye_tracking_mode)
 Sets the eye tracking mode of the eye tracker. More...
 
TOBII_RESEARCH_API TobiiResearchStatus TOBII_RESEARCH_CALL tobii_research_apply_licenses (TobiiResearchEyeTracker *eyetracker, const void **license_key, size_t *license_keys_size, TobiiResearchLicenseValidationResult *validation_results, size_t number_of_licenses)
 Apply one or more licenses to unlock features of the eye tracker. More...
 
TOBII_RESEARCH_API TobiiResearchStatus TOBII_RESEARCH_CALL tobii_research_clear_applied_licenses (TobiiResearchEyeTracker *eyetracker)
 Clears any previously applied licenses. More...
 
TOBII_RESEARCH_API TobiiResearchStatus TOBII_RESEARCH_CALL tobii_research_get_display_area (TobiiResearchEyeTracker *eyetracker, TobiiResearchDisplayArea *display_area)
 Gets the size and corners of the display area. More...
 
TOBII_RESEARCH_API TobiiResearchStatus TOBII_RESEARCH_CALL tobii_research_set_display_area (TobiiResearchEyeTracker *eyetracker, const TobiiResearchDisplayArea *display_area)
 Sets the display area of the eye tracker. It is strongly recommended to use Eye Tracker Manager to calculate the display area coordinates as the origin of the User Coordinate System differs between eye tracker models. More...
 
TOBII_RESEARCH_API TobiiResearchStatus TOBII_RESEARCH_CALL tobii_research_set_device_name (TobiiResearchEyeTracker *eyetracker, const char *device_name)
 Changes the device name. This is not supported by all eye trackers. More...
 

Detailed Description

Functionality for an eye tracker.

Typedef Documentation

◆ TobiiResearchLicenseValidationResult

Specifies license validation result.

Enumeration Type Documentation

◆ TobiiResearchCapabilities

Defines the capabilities.

Enumerator
TOBII_RESEARCH_CAPABILITIES_NONE 

No capabilities set.

TOBII_RESEARCH_CAPABILITIES_CAN_SET_DISPLAY_AREA 

Indicates that the device can have display areas set.

TOBII_RESEARCH_CAPABILITIES_HAS_EXTERNAL_SIGNAL 

Indicates that the device can deliver an external signal stream.

TOBII_RESEARCH_CAPABILITIES_HAS_EYE_IMAGES 

Indicates that the device can deliver an eye image stream.

TOBII_RESEARCH_CAPABILITIES_HAS_GAZE_DATA 

Indicates that the device can deliver a gaze data stream. Standard for all screen based eye trackers.

TOBII_RESEARCH_CAPABILITIES_CAN_DO_SCREEN_BASED_CALIBRATION 

(2024-10-21) A few fields (1 << 4 / 6 / 7) have been removed, see "source/include/tobii_pro_eyetracker.h" for explanation of this. Indicates that screen based calibration can be performed on the device.

TOBII_RESEARCH_CAPABILITIES_CAN_DO_MONOCULAR_CALIBRATION 

Indicates that monocular calibration can be performed on the device.

TOBII_RESEARCH_CAPABILITIES_HAS_EYE_OPENNESS_DATA 

Indicates that an eye openness stream is available on the device

◆ TobiiResearchLicenseValidationResult

Specifies license validation result.

Enumerator
TOBII_RESEARCH_LICENSE_VALIDATION_RESULT_OK 

The license is ok.

TOBII_RESEARCH_LICENSE_VALIDATION_RESULT_TAMPERED 

The license is tampered.

TOBII_RESEARCH_LICENSE_VALIDATION_RESULT_INVALID_APPLICATION_SIGNATURE 

The application signature is invalid.

TOBII_RESEARCH_LICENSE_VALIDATION_RESULT_NONSIGNED_APPLICATION 

The application has not been signed.

TOBII_RESEARCH_LICENSE_VALIDATION_RESULT_EXPIRED 

The license has expired.

TOBII_RESEARCH_LICENSE_VALIDATION_RESULT_PREMATURE 

The license is not yet valid.

TOBII_RESEARCH_LICENSE_VALIDATION_RESULT_INVALID_PROCESS_NAME 

The process name does not match the license.

TOBII_RESEARCH_LICENSE_VALIDATION_RESULT_INVALID_SERIAL_NUMBER 

The serial number does not match the license.

TOBII_RESEARCH_LICENSE_VALIDATION_RESULT_INVALID_MODEL 

The model does not match the license.

TOBII_RESEARCH_LICENSE_VALIDATION_RESULT_UNKNOWN 

The license validation returned an unexpected result.

Function Documentation

◆ tobii_research_apply_calibration_data()

TOBII_RESEARCH_API TobiiResearchStatus TOBII_RESEARCH_CALL tobii_research_apply_calibration_data ( TobiiResearchEyeTracker eyetracker,
const TobiiResearchCalibrationData data 
)

Sets the provided calibration data to the eye tracker, which means it will be active calibration.

This function should not be called during calibration. Also see tobii_research_retrieve_calibration_data.

/* Read the calibration from file. */
FILE *calibration_file = fopen(filename, "rb" );
size_t file_size;
if( !calibration_file ) {
printf("Calibration file not found!\n");
return;
}
fseek(calibration_file, 0, SEEK_END);
file_size = (size_t)ftell(calibration_file);
rewind(calibration_file);
if(file_size <= 0) {
printf("Calibration file is empty!\n");
return;
};
TobiiResearchCalibrationData calibration_data_to_write;
calibration_data_to_write.data = malloc(file_size);
calibration_data_to_write.size = file_size;
file_size = fread(calibration_data_to_write.data, calibration_data_to_write.size, 1, calibration_file);
/* Don't apply empty calibrations. */
if (file_size > 0) {
printf("Applying calibration on eye tracker with serial number %s.\n", serial_number);
tobii_research_apply_calibration_data(eyetracker, &calibration_data_to_write);
}
free(calibration_data_to_write.data);
fclose(calibration_file);
Definition: tobii_research_eyetracker.h:167
size_t size
Definition: tobii_research_eyetracker.h:175
void * data
Definition: tobii_research_eyetracker.h:171
TOBII_RESEARCH_API void TOBII_RESEARCH_CALL tobii_research_free_string(char *str)
Free memory allocation for a string allocated by the SDK.
TOBII_RESEARCH_API TobiiResearchStatus TOBII_RESEARCH_CALL tobii_research_apply_calibration_data(TobiiResearchEyeTracker *eyetracker, const TobiiResearchCalibrationData *data)
Sets the provided calibration data to the eye tracker, which means it will be active calibration.
Parameters
eyetrackerEye tracker object.
dataCalibration data.
Returns
A TobiiResearchStatus code.
Examples
calibration_data.c.

◆ tobii_research_apply_licenses()

TOBII_RESEARCH_API TobiiResearchStatus TOBII_RESEARCH_CALL tobii_research_apply_licenses ( TobiiResearchEyeTracker eyetracker,
const void **  license_key,
size_t *  license_keys_size,
TobiiResearchLicenseValidationResult validation_results,
size_t  number_of_licenses 
)

Apply one or more licenses to unlock features of the eye tracker.

The validation_results array indicates whether all licenses were applied or not.

#define NUM_OF_LICENSES 1
char* license_key_ring[NUM_OF_LICENSES];
FILE *license_file = fopen(license_file_path, "rb" );
if( !license_file ) {
printf("License not found!\n");
return;
}
fseek(license_file, 0, SEEK_END);
size_t file_size = (size_t)ftell(license_file);
rewind(license_file);
if(file_size <= 0) {
printf("License is empty!\n");
return;
}
license_key_ring[0] = (char*)malloc(file_size);
if(license_key_ring[0]) {
size_t read_bytes = fread( license_key_ring[0], sizeof(char), file_size, license_file );
if (file_size != read_bytes) {
printf("Failed to read license file!\n");
return;
}
}
fclose(license_file);
printf("Applying license from %s.\n", license_file_path);
TobiiResearchStatus retval = tobii_research_apply_licenses(eyetracker, (const void**)license_key_ring, &file_size, &validation_results, NUM_OF_LICENSES);
free(license_key_ring[0]);
printf("Successfully applied license from list of keys.\n");
}
TobiiResearchStatus
Definition: tobii_research.h:45
@ TOBII_RESEARCH_STATUS_OK
Definition: tobii_research.h:49
TobiiResearchLicenseValidationResult
Definition: tobii_research_eyetracker.h:76
@ TOBII_RESEARCH_LICENSE_VALIDATION_RESULT_OK
Definition: tobii_research_eyetracker.h:80
TOBII_RESEARCH_API TobiiResearchStatus TOBII_RESEARCH_CALL tobii_research_apply_licenses(TobiiResearchEyeTracker *eyetracker, const void **license_key, size_t *license_keys_size, TobiiResearchLicenseValidationResult *validation_results, size_t number_of_licenses)
Apply one or more licenses to unlock features of the eye tracker.
Parameters
eyetrackerEye tracker object.
license_keyLicenses to apply.
license_keys_sizeA list of license key sizes.
validation_resultsOptional. Validation result for each license.
number_of_licensesNumber of licenses in license_key_ring.
Returns
A TobiiResearchStatus code.
Examples
apply_licenses.c.

◆ tobii_research_clear_applied_licenses()

TOBII_RESEARCH_API TobiiResearchStatus TOBII_RESEARCH_CALL tobii_research_clear_applied_licenses ( TobiiResearchEyeTracker eyetracker)

Clears any previously applied licenses.

Parameters
eyetrackerEye tracker object.
Returns
A TobiiResearchStatus code.

◆ tobii_research_free_calibration_data()

TOBII_RESEARCH_API void TOBII_RESEARCH_CALL tobii_research_free_calibration_data ( TobiiResearchCalibrationData data)

Free memory allocation for the calibration data received via tobii_research_retrieve_calibration_data.

Parameters
dataCalibration data to free.
Examples
calibration_data.c.

◆ tobii_research_free_eye_tracking_modes()

TOBII_RESEARCH_API void TOBII_RESEARCH_CALL tobii_research_free_eye_tracking_modes ( TobiiResearchEyeTrackingModes modes)

Free memory allocation for the eye tracking modes received via tobii_research_get_all_eye_tracking_modes.

Parameters
modesEye tracker modes to free.
Examples
eye_tracking_modes.c.

◆ tobii_research_free_gaze_output_frequencies()

TOBII_RESEARCH_API void TOBII_RESEARCH_CALL tobii_research_free_gaze_output_frequencies ( TobiiResearchGazeOutputFrequencies frequencies)

Free memory allocation for the gaze output frequencies received via tobii_research_free_gaze_output_frequencies.

Parameters
frequenciesGaze output frequencies to free.
Examples
gaze_output_frequencies.c.

◆ tobii_research_get_address()

TOBII_RESEARCH_API TobiiResearchStatus TOBII_RESEARCH_CALL tobii_research_get_address ( TobiiResearchEyeTracker eyetracker,
char **  address 
)

Gets the address (URI) of the eye tracker device.

char* address = NULL;
char* serial_number = NULL;
char* device_name = NULL;
tobii_research_get_address(eyetracker, &address);
tobii_research_get_serial_number(eyetracker, &serial_number);
tobii_research_get_device_name(eyetracker, &device_name);
printf("%s\t%s\t%s\n", address, serial_number, device_name);
TOBII_RESEARCH_API TobiiResearchStatus TOBII_RESEARCH_CALL tobii_research_get_serial_number(TobiiResearchEyeTracker *eyetracker, char **serial_number)
Gets the serial number of the eye tracker. All physical eye trackers have a unique serial number.
TOBII_RESEARCH_API TobiiResearchStatus TOBII_RESEARCH_CALL tobii_research_get_device_name(TobiiResearchEyeTracker *eyetracker, char **device_name)
Gets the name of the eye tracker.
TOBII_RESEARCH_API TobiiResearchStatus TOBII_RESEARCH_CALL tobii_research_get_address(TobiiResearchEyeTracker *eyetracker, char **address)
Gets the address (URI) of the eye tracker device.
Parameters
eyetrackerEye tracker object.
addressAddress as string, should be freed when not in use by tobii_research_free_string.
Returns
A TobiiResearchStatus code.
Examples
call_eyetracker_manager_posix.c, call_eyetracker_manager_windows.c, and find_all_eyetrackers.c.

◆ tobii_research_get_all_eye_tracking_modes()

TOBII_RESEARCH_API TobiiResearchStatus TOBII_RESEARCH_CALL tobii_research_get_all_eye_tracking_modes ( TobiiResearchEyeTracker eyetracker,
TobiiResearchEyeTrackingModes **  modes 
)

Gets a all eye tracking modes supported by the eye tracker.

char* initial_eye_tracking_mode = NULL;
TobiiResearchStatus status = tobii_research_get_eye_tracking_mode(eyetracker, &initial_eye_tracking_mode);
printf("The eye tracker's initial eye tracking mode is %s with status %i.\n", initial_eye_tracking_mode, status);
{
TobiiResearchEyeTrackingModes* all_eye_tracking_modes = NULL;
size_t i = 0;
status = tobii_research_get_all_eye_tracking_modes(eyetracker, &all_eye_tracking_modes);
if (status == TOBII_RESEARCH_STATUS_OK) {
for (; i < all_eye_tracking_modes->mode_count; i++) {
status = tobii_research_set_eye_tracking_mode(eyetracker, all_eye_tracking_modes->modes[i]);
printf("Eye tracking mode set to %s with status %i.\n", all_eye_tracking_modes->modes[i], status);
}
status = tobii_research_set_eye_tracking_mode(eyetracker, initial_eye_tracking_mode);
printf("Eye tracking mode reset to %s with status %i.\n", initial_eye_tracking_mode, status);
tobii_research_free_string(initial_eye_tracking_mode);
} else {
printf("tobii_research_get_all_eye_tracking_modes returned status %i.\n", status);
}
tobii_research_free_eye_tracking_modes(all_eye_tracking_modes);
}
Definition: tobii_research_eyetracker.h:195
size_t mode_count
Definition: tobii_research_eyetracker.h:203
char ** modes
Definition: tobii_research_eyetracker.h:199
TOBII_RESEARCH_API TobiiResearchStatus TOBII_RESEARCH_CALL tobii_research_get_all_eye_tracking_modes(TobiiResearchEyeTracker *eyetracker, TobiiResearchEyeTrackingModes **modes)
Gets a all eye tracking modes supported by the eye tracker.
TOBII_RESEARCH_API TobiiResearchStatus TOBII_RESEARCH_CALL tobii_research_get_eye_tracking_mode(TobiiResearchEyeTracker *eyetracker, char **eye_tracking_mode)
Gets the eye tracking mode of the eye tracker.
TOBII_RESEARCH_API void TOBII_RESEARCH_CALL tobii_research_free_eye_tracking_modes(TobiiResearchEyeTrackingModes *modes)
Free memory allocation for the eye tracking modes received via tobii_research_get_all_eye_tracking_mo...
TOBII_RESEARCH_API TobiiResearchStatus TOBII_RESEARCH_CALL tobii_research_set_eye_tracking_mode(TobiiResearchEyeTracker *eyetracker, const char *eye_tracking_mode)
Sets the eye tracking mode of the eye tracker.
Parameters
eyetrackerEye tracker object.
modesEye tracking modes.
Returns
A TobiiResearchStatus code.
Examples
eye_tracking_modes.c.

◆ tobii_research_get_all_gaze_output_frequencies()

TOBII_RESEARCH_API TobiiResearchStatus TOBII_RESEARCH_CALL tobii_research_get_all_gaze_output_frequencies ( TobiiResearchEyeTracker eyetracker,
TobiiResearchGazeOutputFrequencies **  frequencies 
)

Gets an array of gaze output frequencies supported by the eye tracker.

float initial_gaze_output_frequency;
TobiiResearchStatus status = tobii_research_get_gaze_output_frequency(eyetracker, &initial_gaze_output_frequency);
printf("The eye tracker's initial gaze output frequency is %f Hz with status %i.\n",
initial_gaze_output_frequency, status);
{
size_t i = 0;
status = tobii_research_get_all_gaze_output_frequencies(eyetracker, &frequencies);
if (status == TOBII_RESEARCH_STATUS_OK) {
for(; i < frequencies->frequency_count; i++) {
status = tobii_research_set_gaze_output_frequency(eyetracker, frequencies->frequencies[i]);
printf("Gaze output frequency set to %f Hz with status %i.\n", frequencies->frequencies[i], status);
}
tobii_research_set_gaze_output_frequency(eyetracker, initial_gaze_output_frequency);
printf("Gaze output frequency reset to %f Hz.\n", initial_gaze_output_frequency);
} else {
printf("tobii_research_get_all_gaze_output_frequencies returned status %i.\n", status);
}
}
Definition: tobii_research_eyetracker.h:181
float * frequencies
Definition: tobii_research_eyetracker.h:185
size_t frequency_count
Definition: tobii_research_eyetracker.h:189
TOBII_RESEARCH_API TobiiResearchStatus TOBII_RESEARCH_CALL tobii_research_set_gaze_output_frequency(TobiiResearchEyeTracker *eyetracker, float gaze_output_frequency)
Sets the gaze output frequency of the eye tracker.
TOBII_RESEARCH_API void TOBII_RESEARCH_CALL tobii_research_free_gaze_output_frequencies(TobiiResearchGazeOutputFrequencies *frequencies)
Free memory allocation for the gaze output frequencies received via tobii_research_free_gaze_output_f...
TOBII_RESEARCH_API TobiiResearchStatus TOBII_RESEARCH_CALL tobii_research_get_all_gaze_output_frequencies(TobiiResearchEyeTracker *eyetracker, TobiiResearchGazeOutputFrequencies **frequencies)
Gets an array of gaze output frequencies supported by the eye tracker.
TOBII_RESEARCH_API TobiiResearchStatus TOBII_RESEARCH_CALL tobii_research_get_gaze_output_frequency(TobiiResearchEyeTracker *eyetracker, float *gaze_output_frequency)
Gets the gaze output frequency of the eye tracker.
Parameters
eyetrackerEye tracker object.
frequenciesGaze output frequencies.
Returns
A TobiiResearchStatus code.
Examples
gaze_output_frequencies.c.

◆ tobii_research_get_capabilities()

TOBII_RESEARCH_API TobiiResearchStatus TOBII_RESEARCH_CALL tobii_research_get_capabilities ( TobiiResearchEyeTracker eyetracker,
TobiiResearchCapabilities capabilities 
)

Gets the capabilities of the device.

Parameters
eyetrackerEye tracker object.
capabilitiesBit array where each bit set indicates a supported capability, see TobiiResearchCapabilities.
Returns
A TobiiResearchStatus code.

◆ tobii_research_get_device_name()

TOBII_RESEARCH_API TobiiResearchStatus TOBII_RESEARCH_CALL tobii_research_get_device_name ( TobiiResearchEyeTracker eyetracker,
char **  device_name 
)

Gets the name of the eye tracker.

char* address = NULL;
char* serial_number = NULL;
char* device_name = NULL;
tobii_research_get_address(eyetracker, &address);
tobii_research_get_serial_number(eyetracker, &serial_number);
tobii_research_get_device_name(eyetracker, &device_name);
printf("%s\t%s\t%s\n", address, serial_number, device_name);
Parameters
eyetrackerEye tracker object.
device_nameDevice name as string, should be freed when not in use by tobii_research_free_string.
Returns
A TobiiResearchStatus code.
Examples
create_eyetracker.c, find_all_eyetrackers.c, and set_device_name.c.

◆ tobii_research_get_display_area()

TOBII_RESEARCH_API TobiiResearchStatus TOBII_RESEARCH_CALL tobii_research_get_display_area ( TobiiResearchEyeTracker eyetracker,
TobiiResearchDisplayArea display_area 
)

Gets the size and corners of the display area.

TobiiResearchStatus status = tobii_research_get_display_area(eyetracker, &display_area);
char* serial_number = NULL;
tobii_research_get_serial_number(eyetracker, &serial_number);
printf("Got display area from tracker with serial number %s with status %i:\n", serial_number, status);
printf("Bottom Left: (%f, %f, %f)\n",
display_area.bottom_left.x,
display_area.bottom_left.y,
display_area.bottom_left.z);
printf("Bottom Right: (%f, %f, %f)\n",
display_area.bottom_right.x,
display_area.bottom_right.y,
display_area.bottom_right.z);
printf("Height: %f\n", display_area.height);
printf("Top Left: (%f, %f, %f)\n",
display_area.top_left.x,
display_area.top_left.y,
display_area.top_left.z);
printf("Top Right: (%f, %f, %f)\n",
display_area.top_right.x,
display_area.top_right.y,
display_area.top_right.z);
printf("Width: %f\n", display_area.width);
// To set the display area it is possible to either use a previously saved instance of
// the type TobiiResearchDisplayArea, or create a new one as shown below.
TobiiResearchDisplayArea new_display_area;
// For simplicity we are using the same values that are already set on the eye tracker.
memcpy(&new_display_area.top_left, &display_area.top_left, sizeof(display_area.top_left));
memcpy(&new_display_area.top_right, &display_area.top_right, sizeof(display_area.top_right));
memcpy(&new_display_area.bottom_left, &display_area.bottom_left, sizeof(display_area.bottom_left));
status = tobii_research_set_display_area(eyetracker, &new_display_area);
Definition: tobii_research_eyetracker.h:132
TobiiResearchPoint3D top_left
Definition: tobii_research_eyetracker.h:151
float height
Definition: tobii_research_eyetracker.h:146
float width
Definition: tobii_research_eyetracker.h:161
TobiiResearchPoint3D bottom_right
Definition: tobii_research_eyetracker.h:141
TobiiResearchPoint3D top_right
Definition: tobii_research_eyetracker.h:156
TobiiResearchPoint3D bottom_left
Definition: tobii_research_eyetracker.h:136
float x
Definition: tobii_research.h:403
float z
Definition: tobii_research.h:411
float y
Definition: tobii_research.h:407
TOBII_RESEARCH_API TobiiResearchStatus TOBII_RESEARCH_CALL tobii_research_set_display_area(TobiiResearchEyeTracker *eyetracker, const TobiiResearchDisplayArea *display_area)
Sets the display area of the eye tracker. It is strongly recommended to use Eye Tracker Manager to ca...
TOBII_RESEARCH_API TobiiResearchStatus TOBII_RESEARCH_CALL tobii_research_get_display_area(TobiiResearchEyeTracker *eyetracker, TobiiResearchDisplayArea *display_area)
Gets the size and corners of the display area.
Parameters
eyetrackerEye tracker object.
display_areaThe eye tracker's display area.
Returns
A TobiiResearchStatus code.
Examples
get_and_set_display_area.c.

◆ tobii_research_get_eye_tracking_mode()

TOBII_RESEARCH_API TobiiResearchStatus TOBII_RESEARCH_CALL tobii_research_get_eye_tracking_mode ( TobiiResearchEyeTracker eyetracker,
char **  eye_tracking_mode 
)

Gets the eye tracking mode of the eye tracker.

char* initial_eye_tracking_mode = NULL;
TobiiResearchStatus status = tobii_research_get_eye_tracking_mode(eyetracker, &initial_eye_tracking_mode);
printf("The eye tracker's initial eye tracking mode is %s with status %i.\n", initial_eye_tracking_mode, status);
Parameters
eyetrackerEye tracker object.
eye_tracking_modeThe current eye tracking mode.
Returns
A TobiiResearchStatus code.
Examples
eye_tracking_modes.c.

◆ tobii_research_get_firmware_version()

TOBII_RESEARCH_API TobiiResearchStatus TOBII_RESEARCH_CALL tobii_research_get_firmware_version ( TobiiResearchEyeTracker eyetracker,
char **  fw_version 
)

Gets the firmware version of the eye tracker.

Parameters
eyetrackerEye tracker object.
fw_versionFirmware version as string, should be freed when not in use by tobii_research_free_string.
Returns
A TobiiResearchStatus code.

◆ tobii_research_get_gaze_output_frequency()

TOBII_RESEARCH_API TobiiResearchStatus TOBII_RESEARCH_CALL tobii_research_get_gaze_output_frequency ( TobiiResearchEyeTracker eyetracker,
float *  gaze_output_frequency 
)

Gets the gaze output frequency of the eye tracker.

float initial_gaze_output_frequency;
TobiiResearchStatus status = tobii_research_get_gaze_output_frequency(eyetracker, &initial_gaze_output_frequency);
printf("The eye tracker's initial gaze output frequency is %f Hz with status %i.\n",
initial_gaze_output_frequency, status);
Parameters
eyetrackerEye tracker object.
gaze_output_frequencyThe current gaze output frequency.
Returns
A TobiiResearchStatus code.
Examples
gaze_output_frequencies.c.

◆ tobii_research_get_model()

TOBII_RESEARCH_API TobiiResearchStatus TOBII_RESEARCH_CALL tobii_research_get_model ( TobiiResearchEyeTracker eyetracker,
char **  model 
)

Gets the model of the eye tracker.

Parameters
eyetrackerEye tracker object.
modelModel as string, should be freed when not in use by tobii_research_free_string.
Returns
A TobiiResearchStatus code.
Examples
create_eyetracker.c.

◆ tobii_research_get_runtime_version()

TOBII_RESEARCH_API TobiiResearchStatus TOBII_RESEARCH_CALL tobii_research_get_runtime_version ( TobiiResearchEyeTracker eyetracker,
char **  runtime_version 
)

Gets the runtime build version of the eye tracker.

Parameters
eyetrackerEye tracker object.
runtime_versionRuntime build version as string, should be freed when not in use by tobii_research_free_string.
Returns
A TobiiResearchStatus code.

◆ tobii_research_get_serial_number()

TOBII_RESEARCH_API TobiiResearchStatus TOBII_RESEARCH_CALL tobii_research_get_serial_number ( TobiiResearchEyeTracker eyetracker,
char **  serial_number 
)

Gets the serial number of the eye tracker. All physical eye trackers have a unique serial number.

char* address = NULL;
char* serial_number = NULL;
char* device_name = NULL;
tobii_research_get_address(eyetracker, &address);
tobii_research_get_serial_number(eyetracker, &serial_number);
tobii_research_get_device_name(eyetracker, &device_name);
printf("%s\t%s\t%s\n", address, serial_number, device_name);
Parameters
eyetrackerEye tracker object.
serial_numberSerial number as string, should be freed when not in use by tobii_research_free_string.
Returns
A TobiiResearchStatus code.
Examples
calibrating_with_gaze.c, calibration.c, calibration_data.c, create_eyetracker.c, external_signal.c, eye_openness_data.c, find_all_eyetrackers.c, gaze_data.c, get_and_set_display_area.c, time_synchronization_data.c, and user_position_guide.c.

◆ tobii_research_retrieve_calibration_data()

TOBII_RESEARCH_API TobiiResearchStatus TOBII_RESEARCH_CALL tobii_research_retrieve_calibration_data ( TobiiResearchEyeTracker eyetracker,
TobiiResearchCalibrationData **  data 
)

Gets the calibration data used currently by the eye tracker.

This data can be saved to a file for later use. See tobii_research_apply_calibration_data

/* Save the calibration to file. */
char* filename = "saved_calibration.bin";
char* serial_number = NULL;
FILE* f = fopen(filename, "wb");
TobiiResearchCalibrationData* calibration_data = NULL;
TobiiResearchStatus status = tobii_research_retrieve_calibration_data(eyetracker, &calibration_data);
if (status != TOBII_RESEARCH_STATUS_OK)
return;
tobii_research_get_serial_number(eyetracker, &serial_number);
/* None is returned on empty calibration. */
if (calibration_data->size != 0) {
printf("Saving calibration to file for eye tracker with serial number %s.\n", serial_number);
fwrite(calibration_data->data, calibration_data->size, 1, f);
} else {
printf("No calibration available for eye tracker with serial number %s.\n", serial_number);
}
fclose(f);
TOBII_RESEARCH_API void TOBII_RESEARCH_CALL tobii_research_free_calibration_data(TobiiResearchCalibrationData *data)
Free memory allocation for the calibration data received via tobii_research_retrieve_calibration_data...
TOBII_RESEARCH_API TobiiResearchStatus TOBII_RESEARCH_CALL tobii_research_retrieve_calibration_data(TobiiResearchEyeTracker *eyetracker, TobiiResearchCalibrationData **data)
Gets the calibration data used currently by the eye tracker.
Parameters
eyetrackerEye tracker object.
dataCalibration data.
Returns
A TobiiResearchStatus code.
Examples
calibration_data.c.

◆ tobii_research_set_device_name()

TOBII_RESEARCH_API TobiiResearchStatus TOBII_RESEARCH_CALL tobii_research_set_device_name ( TobiiResearchEyeTracker eyetracker,
const char *  device_name 
)

Changes the device name. This is not supported by all eye trackers.

TobiiResearchStatus status = tobii_research_set_device_name(eyetracker, "A new name");
TOBII_RESEARCH_API TobiiResearchStatus TOBII_RESEARCH_CALL tobii_research_set_device_name(TobiiResearchEyeTracker *eyetracker, const char *device_name)
Changes the device name. This is not supported by all eye trackers.
Parameters
eyetrackerEye tracker object.
device_nameThe eye tracker's desired name.
Returns
A TobiiResearchStatus code.
Examples
set_device_name.c.

◆ tobii_research_set_display_area()

TOBII_RESEARCH_API TobiiResearchStatus TOBII_RESEARCH_CALL tobii_research_set_display_area ( TobiiResearchEyeTracker eyetracker,
const TobiiResearchDisplayArea display_area 
)

Sets the display area of the eye tracker. It is strongly recommended to use Eye Tracker Manager to calculate the display area coordinates as the origin of the User Coordinate System differs between eye tracker models.

TobiiResearchStatus status = tobii_research_get_display_area(eyetracker, &display_area);
char* serial_number = NULL;
tobii_research_get_serial_number(eyetracker, &serial_number);
printf("Got display area from tracker with serial number %s with status %i:\n", serial_number, status);
printf("Bottom Left: (%f, %f, %f)\n",
display_area.bottom_left.x,
display_area.bottom_left.y,
display_area.bottom_left.z);
printf("Bottom Right: (%f, %f, %f)\n",
display_area.bottom_right.x,
display_area.bottom_right.y,
display_area.bottom_right.z);
printf("Height: %f\n", display_area.height);
printf("Top Left: (%f, %f, %f)\n",
display_area.top_left.x,
display_area.top_left.y,
display_area.top_left.z);
printf("Top Right: (%f, %f, %f)\n",
display_area.top_right.x,
display_area.top_right.y,
display_area.top_right.z);
printf("Width: %f\n", display_area.width);
// To set the display area it is possible to either use a previously saved instance of
// the type TobiiResearchDisplayArea, or create a new one as shown below.
TobiiResearchDisplayArea new_display_area;
// For simplicity we are using the same values that are already set on the eye tracker.
memcpy(&new_display_area.top_left, &display_area.top_left, sizeof(display_area.top_left));
memcpy(&new_display_area.top_right, &display_area.top_right, sizeof(display_area.top_right));
memcpy(&new_display_area.bottom_left, &display_area.bottom_left, sizeof(display_area.bottom_left));
status = tobii_research_set_display_area(eyetracker, &new_display_area);
Parameters
eyetrackerEye tracker object.
display_areaThe eye tracker's desired display area.
Returns
A TobiiResearchStatus code.
Examples
get_and_set_display_area.c.

◆ tobii_research_set_eye_tracking_mode()

TOBII_RESEARCH_API TobiiResearchStatus TOBII_RESEARCH_CALL tobii_research_set_eye_tracking_mode ( TobiiResearchEyeTracker eyetracker,
const char *  eye_tracking_mode 
)

Sets the eye tracking mode of the eye tracker.

status = tobii_research_set_eye_tracking_mode(eyetracker, initial_eye_tracking_mode);
printf("Eye tracking mode reset to %s with status %i.\n", initial_eye_tracking_mode, status);
tobii_research_free_string(initial_eye_tracking_mode);
Parameters
eyetrackerEye tracker object.
eye_tracking_modeThe eye tracking mode.
Returns
A TobiiResearchStatus code.
Examples
eye_tracking_modes.c.

◆ tobii_research_set_gaze_output_frequency()

TOBII_RESEARCH_API TobiiResearchStatus TOBII_RESEARCH_CALL tobii_research_set_gaze_output_frequency ( TobiiResearchEyeTracker eyetracker,
float  gaze_output_frequency 
)

Sets the gaze output frequency of the eye tracker.

tobii_research_set_gaze_output_frequency(eyetracker, initial_gaze_output_frequency);
printf("Gaze output frequency reset to %f Hz.\n", initial_gaze_output_frequency);
} else {
printf("tobii_research_get_all_gaze_output_frequencies returned status %i.\n", status);
}
Parameters
eyetrackerEye tracker object.
gaze_output_frequencyThe gaze output frequency.
Returns
A TobiiResearchStatus code.
Examples
gaze_output_frequencies.c.