[][src]Function libeyelink_sys::eyelink_wait_for_block_start

pub unsafe extern "C" fn eyelink_wait_for_block_start(
    maxwait: UINT32,
    samples: INT16,
    events: INT16
) -> INT16

@ingroup recording Reads and discards events in data queue until in a recording block. Waits for up to \c <timeout> milliseconds for a block containing samples, events, or both to be opened. Items in the queue are discarded until the block start events are found and processed. This function will fail if both samples and events are selected but only one of link samples and events were enabled by \c start_recording().

@remarks This function did not work in versions previous to 2.0. @param maxwait Time in milliseconds to wait. @param samples If non-zero, check if in a block with samples. @param events If non-zero, check if in a block with events. @return \c 0 if time expired without any data of masked types available.

\b Example:

\code

#include 
#include 

if(start_recording(1,1,1,1)!= 0)
return -1;          // ERROR: couldn't start recording

begin_realtime_mode(100);

if(!eyelink_wait_for_block_start(100, 1, 0))
{
printf("ERROR: No link samples received!");
return TRIAL_ERROR;
}

eye_used = eyelink_eye_available();
switch(eye_used) // select eye, add annotation to EDF file
{
case RIGHT_EYE:
eyemsg_printf("EYE_USED 1 RIGHT");
break;
case BINOCULAR:  // both eye's data present: use left eye only
eye_used = LEFT_EYE;
case LEFT_EYE:
eyemsg_printf("EYE_USED 0 LEFT");
break;
}
\endcode