Enable Notifications

clear;

Tobii = EyeTrackingOperations();

eyetracker_address = 'Address of the desired device';
% Example:
% eyetracker_address = 'tet-tcp://10.46.32.51';
try
    eyetracker = Tobii.get_eyetracker(eyetracker_address);
catch ME
    if (strcmp(ME.identifier,'EyeTrackerGet:error204'))
        fprintf('Unable to connect eye tracker.\n');
        return
    end
end

% First the notifications will be enabled
eyetracker.enable_notifications();

% For example, changing the gaze output frequency will generate a
% notification
available_gaze_output_frequencies = eyetracker.get_all_gaze_output_frequencies();
gaze_output_frequency = available_gaze_output_frequencies(1);
eyetracker.set_gaze_output_frequency(gaze_output_frequency)

% It is possible to catch the notifcation by checking 'lastwarn'
[message,ID] = lastwarn;

eyetracker.disable_notifications();