Home Forums Software Development Checking whether if the eye tracker is connected Reply To: Checking whether if the eye tracker is connected

#451
Jenny [Tobii]
Participant

Hi again,

Yep, there was a bug in the client library… It worked well on my computer for some reason, but not on Robert’s. The bug is fixed and I have uploaded new SDK packages that include the fix.

Ok, so let’s go back to what you actually want to achieve 🙂

If I understand you correctly, you have an application that there is no point in starting if there is no working eye tracking?

I believe the Eye Tracking Device Status is what you should use. It does not require the eye tracker to be physically connected and it has a state for when the eye tracker is not connected. But I think the best thing you could do is to make sure that this status is “Tracking” before starting your application. Then everything should be up and running and usable with eye tracking (eye tracker connected, correct screen mapping, calibration – all the ground work that is handled by the EyeX Engine). If the status is not “Tracking”, then something is missing in the setup, or eye tracking is disabled, so eye tracking cannot be used with the application.

But, something is missing to the code I gave you in the last reply – that code only reports changes to the status.

This is what you have to do to request the current status:
After the connection to the EyeX Engine has been established (when there has been a ConnectionStateChanged event with status ConnectionState.Connected), you can make this asynchronous call to retrieve the Eye Tracking Device Status:

context.GetSettingsAsync(SettingsPaths.EyeTracking, OnSettingsReceived);

The callback method OnSettingsReceived is the same as in the reply above.

If you are only interested in making a single call to ask the current status, the above line of code plus the callback method is all you need. If you also want to react to changes to the status, you should keep the other code as well.