[][src]Function libeyelink_sys::eyelink_is_connected

pub unsafe extern "C" fn eyelink_is_connected() -> INT16

@ingroup init_eyelink Checks whether the connection to the tracker is alive.

@remarks Call this routine during loops and wherever the experiment might lock up if the tracker is shut down. Exit the experiment (by terminating loops and returning from all calls) if this returns \c 0. @return \c 0 if link closed.\n \c -1 if simulating connection.\n \c 1 for normal connection.\n \c 2 for broadcast connection (NEW for v2.1 and later).\n

\b Example:

\code

#include 

while(1)
{
if(!eyelink_is_connected())
return ABORT_EXPT;

error = do_drift_correct(SCRWIDTH/2, SCRHEIGHT/2, 1, 1);

if(error!=27) break;
}
\endcode

\sa \c eyelink_close() and \c eyelink_open()