
Macros | |
| #define | LINK_INITIALIZE_FAILED -200 |
| #define | CONNECT_TIMEOUT_FAILED -201 |
| #define | WRONG_LINK_VERSION -202 |
| #define | TRACKER_BUSY -203 |
Variables | |
| ELINKADDR | eye_broadcast_address |
| ELINKADDR | rem_broadcast_address |
| ELINKADDR | our_address |
These methods are used to initialize the EyeLink Library.
| #define CONNECT_TIMEOUT_FAILED -201 |
CONNECTION ERROR CODES: timed out waiting for reply
| #define LINK_INITIALIZE_FAILED -200 |
CONNECTION ERROR CODES: can't use link
| #define TRACKER_BUSY -203 |
CONNECTION ERROR CODES: tracker already connected
| #define WRONG_LINK_VERSION -202 |
CONNECTION ERROR CODES: wrong TSR or source version
| void close_eyelink_connection | ( | void | ) |
Closes any connection to the eye tracker, and closes the link.
Example: See open_eyelink_connection()
open_eyelink_connection() and eyelink_close() | void close_eyelink_system | ( | void | ) |
Resets the EyeLink library, releases the system resources used by the millisecond clock.
Example: See open_eyelink_system()
open_eyelink_system(), eyelink_close() and set_offline_mode() | INT16 eyelink_broadcast_open | ( | void | ) |
Allows a third computer to listen in on a session between the eye tracker and a controlling remote machine. This allows it to receive data during recording and playback, and to monitor the eye tracker mode. The local computer will not be able to send commands to the eye tracker, but may be able to send messages or request the tracker time.
0 if successful.LINK_INITIALIZE_FAILED if link could not be established.CONNECT_TIMEOUT_FAILED if tracker did not respond.WRONG_LINK_VERSION if the versions of the EyeLink library and tracker are incompatible.Sends a disconnect message to the EyeLink tracker, resets the link data system.
| send_msg | Usually <send_msg> is 1. However, 0 can be used to reset the eyelink system if it is listening on a broadcast session. |
0 if successful, otherwise link error.Example:
| INT16 eyelink_dummy_open | ( | void | ) |
Sets the EyeLink library to simulate an eyetracker connection. Functions will return plausible values, but no data.
eyelink_is_connected() will return -1 to indicate a simulated connection. 0.Example:
eyelink_broadcast_open(), eyelink_open() and eyelink_open_node() Reads the responses returned by other trackers or remotes in response to eyelink_poll_trackers() or eyelink_poll_remotes(). It can also read the tracker broadcast address and remote broadcast addresses.
| resp | Nmber of responses to read:0 gets our data, 1 get first response, 2 gets the second response, etc. -1 to read the tracker broadcast address. -2 to read remote broadcast addresses. |
| data | Pointer to buffer of ELINKNODE type, to hold name and ELINKADDR of the respondent. |
0 if OK, -1 if node response number is too high.Example: See eyelink_poll_remotes()
| void eyelink_get_special_keys_ex | ( | int | option, |
| int * | key_mask, | ||
| int * | key, | ||
| int * | case_sensitive | ||
| ) |
Gets the alternative extra special keys using option value that was previously set.
| option | . To indicate which function the special key set to |
| key_mask | reference to an array of mask values that is used for the provided option. |
| key | reference to an array of key charecter values that is used for the provided option. |
| case_sensitive | flag reference to case sensitive \param[in] option
\c 1 especial key for drift correct skip
|
Example:
Output:
| INT16 eyelink_get_tracker_version | ( | char FARTYPE * | c | ) |
After connection, determines if the connected tracker is an EyeLink I or II.
| c | NULL, or pointer to a string (at least 40 characters) to hold the version string. This will be "EYELINK I" or "EYELINK II x.xx", where "x.xx" is the software version. |
0 if not connected, 1 for EyeLink I, 2 for EyeLink II, 3 for EyeLink 1000, and 4 for EyeLink 3.Example:
Output:
| INT16 eyelink_is_connected | ( | void | ) |
Checks whether the connection to the tracker is alive.
0. 0 if link closed.-1 if simulating connection.1 for normal connection.2 for broadcast connection (NEW for v2.1 and later).eyelink_close() and eyelink_open() | INT16 eyelink_open | ( | void | ) |
Attempts to open a link connection to the EyeLink tracker. Simple connect to single EyeLink tracker. Equivalent to eyelink_open_node(broadcast_address, 0).
set_eyelink_address(). If this address was "255.255.255.255" the call to eyelink_open() will "broadcast" a request to any tracker, however this may fail if multiple Ethernet cards are installed. For the broadcast option to work use EyeLink I v2.1 or higher, EyeLink II v1.1 or higher. Before using this command, call either open_eyelink_connection(-1) or open_eyelink_system () to prepare the link for use.0 if successful.LINK_INITIALIZE_FAILED if link could not be established.CONNECT_TIMEOUT_FAILED if tracker did not respond.WRONG_LINK_VERSION if the versions of the EyeLink library and tracker are incompatible.Allows the computer to connect to tracker, where the tracker is on the same network.
| node | Must be an address returned by eyelink_poll_trackers() and eyelink_poll_responses() to connect to any tracker. |
| busytest | If non-zero the call to eyelink_open_node() will not disconnect an existing connection. |
0 if successful.LINK_INITIALIZE_FAILED if link could not be established.CONNECT_TIMEOUT_FAILED if tracker did not respond.WRONG_LINK_VERSION if the versions of the EyeLink library and tracker are incompatible.TRACKER_BUSY if <busytest> is set, and tracker is connected to another computer.| INT16 eyelink_poll_remotes | ( | void | ) |
Asks all non-tracker computers (with EyeLink software running) on the network to send their names and node address.
OK_RESULT if successful, otherwise link error. LINK_TERMINATED_RESULT if link error. -1 if broadcast option is not available.Example:
eyelink_poll_responses() and eyelink_poll_trackers() | INT16 eyelink_poll_responses | ( | void | ) |
Returns the count of node addresses received so far following the call of eyelink_poll_remotes() or eyelink_poll_trackers().
0 if no responses.Example: See eyelink_poll_remotes()
eyelink_poll_remotes() and eyelink_poll_trackers() | INT16 eyelink_poll_trackers | ( | void | ) |
Asks all trackers (with EyeLink software running) on the network to send their names and node address.
OK_RESULT if successful, otherwise link error. LINK_TERMINATED_RESULT if link error. -1 if broadcast option is not available.Example: See eyelink_poll_remotes()
eyelink_poll_remotes() and eyelink_poll_responses() Controls the level of control an application has over the tracker.
| mode | 0 to allow all communication.1 to block commands (allows only key presses, messages, and time or variable read requests).2 to disable all commands, requests and messages.-1 to just return current setting. |
Example:
Output:
eyelink_broadcast_open() and eyelink_open() | void eyelink_set_name | ( | char FARTYPE * | name | ) |
Sets the node name of this computer (up to 35 characters).
| name | String to become new name. |
Example:
Output:
| void eyelink_set_special_keys | ( | int | terminate_key_mask, |
| int | terminate_key, | ||
| int | break_key_mask, | ||
| int | break_key, | ||
| int | case_sensitive | ||
| ) |
Sets the alternative for special keys such as CTRL+C, ESC
| terminate_key_mask | mask value for the terminate key |
| terminate_key | Terminate key charecter key that terminate the eyelink applicaiton |
| break_key_mask | mask value for the break key |
| break_key | Break key charecter key that terminate the eyelink applicaiton |
| case_sensitive | flag 1 means case sensitive 0 means not case sensitive |
Example:
Output:
| void eyelink_set_special_keys_ex | ( | int | option, |
| int * | key_mask, | ||
| int * | key, | ||
| int | case_sensitive | ||
| ) |
Sets the alternative for extra special keys such as CTRL+C, ESC for drift correct skip, etc.
| option | . To indicate which function the special key set to |
| key_mask | A list of mask values that is used for the provided option. An array of 4 int are supported. |
| key | A list of key charecter key values that is used for the provided option. An array of 4 int are supported. |
| case_sensitive | flag 1 means case sensitive 0 means not case sensitive \param[in] option
\c 1 especial key for drift correct skip
\c 2 especial key for drift correct accept
|
Example:
Output:
| void eyelink_set_tracker_node | ( | ELINKADDR | node | ) |
Address used for non-connected time requests and message sends. the "proper" way to do this is with the "node" type of functions but we allow a "back door" to simplify higher level support functions. This is also the address used under Windows for looking for tracker (an IP broadcast is used on all other platforms). There is a bug in the Windows networking, causing broadcasts sent on all cards to have the IP source addres of only the first card. This means the tracker sends its connection reply to the wrong address. So the exact address or a subnet broadcast address (i.e. 100.1.1.255 for a subnet mask of 255.255.255.0) needs to be set to that of the tracker.
Initializes the EyeLink library, and opens a connection to the EyeLink tracker.
<mode> to be 1, the connection can be simulated for debugging purposes. Only timing operations and simple tests should be done in simulation mode. This function is intended for networks where a single tracker is connected to the network. By setting <mode> to be 2, the connection is made to the master application instead of the tracker directly. The master and slave application needs to run on the same machine. If the master and slave needs to run on different machines, please see eyelink_broadcast_open().The slave application can send messages and read variable values from the eyelink tracker. However, it cannot send any commands to the tracker nor open or close edf files. Camera setup image previewing is not suppored in slave mode. The messasges that are sent by the slave application will be save in the edf file that was created by the master application.
@param mode Mode of connection:
\arg \c 0 Opens a connection with the eye tracker.
\arg \c 1 Creates a dummy connection for simulation.
\arg \c -1 Initializes the DLL but does not open a connection.
\arg \c 2 Create a slave connection to recieve data from a master eyelink application.
\arg \c 3 Opens a connection to the eye tracker and setup master configuration for the slave application to connect.
@return \c 0 if success, else error code
\b Example 1:
This program illustrates the use of open_eyelink_connection() for a regular eyelink application
Example 2: This program illustrates the use of open_eyelink_connection() for a regular eyelink application that allows to server as the master application for another slave application.
Example 3: This program illustrates an eyelink salve application. Any regular eyelink application, can be connverted to a master application by calling the following functions as descibed above.
For this to work, a master application needs to be running at the time of execution.
Use this function to initialize the EyeLink library. This will also start the millisecond clock. No connection is attempted to the eyetracker yet. It is preferable to call open_eyelink_connection(-1) instead, as this prepares other parts of the DLL for use.
| bufsize | Size of sample buffer. 60000 is the maximum allowed. (0 for default) |
| options | Text specifying initialization options. Currently no options are supported. (NULL or "" for defaults) |
0 if failed, nonzero (-1 or TSR SWI number) if success.Example:
| INT16 set_eyelink_address | ( | char * | addr | ) |
Sets the IP address used for connection to the EyeLink tracker. This is set to "100.1.1.1" in the DLL, but may need to be changed for some network configurations. This must be set before attempting to open a connection to the tracker.
| addr | Pointer to a string containing a "dotted" 4-digit IP address. |
0 if success, -1 if could not parse address string.Example:
eyelink_open(), eyelink_open_node(), text_to_elinkaddr() | ELINKADDR eye_broadcast_address |
The broadcast address for the eye trackers.
| ELINKADDR our_address |
This EyeLink node's address for the link implementation.
| ELINKADDR rem_broadcast_address |
The broadcast address for the remotes.