[][src]Function libeyelink_sys::eyecmd_printf

pub unsafe extern "C" fn eyecmd_printf(fmt: *const c_char, ...) -> INT16

link command formatting * use just like printf() * returns command result * allows 500 msec. for command to finish * The EyeLink tracker accepts text commands through the link. These commands may be used to configure the system, open data files, and so on.

@remarks The function waits up to 500 msec. for a success or failure code to be returned from the tracker, then returns the error code \c NO_REPLY. If you need more time, use \c eyelink_timed_command() instead. @param fmt Similar to printf(), format string plus arguments. @return \c 0 if successfully executed, else error code.

\b Example:

\code

#include 

UINT32 t = current_msec();
int i, j;

eyecmd_printf("draw_box %d %d %d %d  7", 100, 100, 300, 400);

while(current_msec()-t < 1000)
{
i = eyelink_command_result();
j = eyelink_last_message(buf);

if (i == OK_RESULT)
{
eyemsg_printf("Command executed successfully: %s", j?buf:"");
break;
}
else if (i!=NO_REPLY)
{
eyemsg_printf("Error in executing command: %s", j?buf:"");
break;
}
}
\endcode

\b Output:

\code
MSG	5312110 Command executed successfully: OK
\endcode

\sa \c eyemsg_printf(), \c eyelink_send_command() and \c eyelink_timed_command()