[][src]Function libeyelink_sys::eyelink_in_data_block

pub unsafe extern "C" fn eyelink_in_data_block(
    samples: INT16,
    events: INT16
) -> INT16

@ingroup recording Checks to see if framing events read from queue indicate that the data is in a block containing samples, events, or both.

@remarks The first item in queue may not be a block start even, so this should be used in a loop while discarding items using \c eyelink_get_next_data(NULL). NOTE: this function did not work reliably in versions of the SLL before v2.0 (did not detect end of blocks). @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 no data of either masked type is being sent.

\b Example:

\code

#include 
#include 

if(open_eyelink_connection(-1))
return -1;

...

if(eyelink_broadcast_open())
{
printf("Cannot open broadcast connection to tracker");
return -1;
}
eyelink_reset_data(1);

eyelink_data_switch(RECORD_LINK_SAMPLES | RECORD_LINK_EVENTS);

while(eyelink_is_connected())
{
if(escape_pressed() || break_pressed()) return;

i = eyelink_get_next_data(NULL);
if(i == 0) continue;

if(eyelink_in_data_block(1, 1))
{
...
}
}
\endcode

\sa \c eyelink_data_status() and \c eyelink_wait_for_block_start()