
Macros | |
| #define | BAD_FILENAME -2222 |
| #define | BAD_ARGUMENT -2223 |
| #define | REPLACE_FILE 0x4000 |
| #define | EDFNAME_MAXLENGTH 82 |
| #define | receive_data_file receive_data_file_dialog |
Functions | |
| INT16 | eyelink_request_file_read (const char FARTYPE *src) |
| INT16 | eyelink_get_file_block (void FARTYPE *buf, INT32 FARTYPE *offset) |
| INT16 | eyelink_request_file_block (UINT32 offset) |
| INT16 | eyelink_end_file_transfer (void) |
| INT32 | receive_data_file (const char *src, const char *dest, INT16 options) |
| INT32 | receive_data_file_feedback (const char *src, const char *dest, INT16 dest_is_path, short(*progress)(unsigned int size, unsigned int received)) |
| INT32 | receive_data_file_feedback64 (const char *src, const char *dest, INT16 options, short(*progress)(char *fileName, UINT64 size, UINT64 received)) |
| INT32 | send_data_file_feedback (char *src, char *dest, INT16 options, void(*progress)(unsigned int size, unsigned int received)) |
| INT32 | send_data_file_mem (char *src, char *fname, int file_size, void(*progress)(unsigned int size, unsigned int received)) |
| INT32 | send_data_file (char *src, char *dest, INT16 dest_is_path) |
| INT16 | open_data_file (char *name) |
| INT16 | close_data_file (void) |
| INT16 | eyelink_set_options (const char *options) |
| void | splice_fname (const char *fname, const char *path, char *ffname) |
| int | check_filename_characters (const char *name) |
| int | file_exists (const char *path) |
| int | create_path (const char *path, INT16 create, INT16 is_dir) |
| INT32 | receive_data_file_dialog (char *src, char *dest, INT16 dest_is_path) |
| #define BAD_ARGUMENT -2223 |
Invalid argument
| #define BAD_FILENAME -2222 |
Bad file name
| #define EDFNAME_MAXLENGTH 82 |
Maximum length (in bytes) of an EDF name, including the base name and the .edf file-type suffix. This does not include the terminating null byte.
| #define receive_data_file receive_data_file_dialog |
This macro is introduced so that the old eyelink projects compiled against new libraries, the file transfer behaves the same as the old receive_data_file in win32 platform See receive_data_file_dialog()
| #define REPLACE_FILE 0x4000 |
Replace existing data file(s)
| int check_filename_characters | ( | const char * | name | ) |
Checks file name for legality. Attempts to ensure cross-platform for viewer. No spaces allowed as this interferes with messages. Assume viewer will translate forward/backward slash. Windows: don't allow <>:"/| Also, device names, such as aux, con, lpt1, and prn are not allowed in windows. forward slashes is missed.
| INT16 close_data_file | ( | void | ) |
Closes any open EDF file.
0 if success, else error code. Checks if path exists. Will create directory if 'create'. Creates directory from last name in 'path', unless ends with '\' or 'is_dir' nonzero. Otherwise, last item is assumed to be filename and is dropped.
0 if exists, 1 if created, -1 if failed. | INT16 eyelink_end_file_transfer | ( | void | ) |
Aborts send of file.
0 if OK, else send error. Get next block of file. If <offset> is not NULL, will be filled with block-start offset in file.
NO_REPLY if waiting for packet, else block size (0..512). size is < 512 (can be 0) if at EOF.Ask for next block of file, reads from <offset>.
| INT16 eyelink_request_file_read | ( | const char FARTYPE * | src | ) |
Request send of file "src". If "", gets last data file.
0 if OK, else send error. | INT16 eyelink_set_options | ( | const char * | options | ) |
Set options.
| options | Text specifying options. Currently long edf file name support is supported. Eg. eyelink_set_options("longname=1"). Calling this before open edf file will enable long file name eceeding 8 char limitation. The maximum length of a long EDF name is defined by EDFNAME_MAXLENGTH. |
1 if success, else error code -1 for parsing errors and 0 for no options. | int file_exists | ( | const char * | path | ) |
Checks if file and/or path exists.
0 if does not exist, 1 if exists, -1 if cannot overwrite. | INT16 open_data_file | ( | char * | name | ) |
Opens an EDF file, closes any existing file.
| name | Name of data file,which can only use letters(uppercase and lowercase), numbers(0-9),and underscore(appears from 2nd place). The base file name (no path or file type extension/suffix) should not exceed 8 characters; the name extension can only be .edf. When long EDF names are enabled, using eyelink_set_options("longname=1"), then the maximum length of the EDF base name becomes 78 characters. |
0 if success, else error code. eyelink_set_options( ) , EDFNAME_MAXLENGTH This receives a data file from the EyeLink tracker PC.
| [in] | src | Name of eye tracker file (including extension). If "" (empty string), asks tracker for name of last opened data file. |
| [in] | dest | Name of local file to write to (including extension). This must be a valid file name or directory name. |
| [in] | options | 0 files placed at the same folder where it executes 1 appends file name to <dest> as a directory path. 2 download vFile in addition to edf 3 download vFile & edf and append file name to <dest> as a directory path. 4 download only vFile and place it in the same folder 5 download only vFile and append file name to <dest> as a directory path. 6 download edf file and vFile |
0 if file transfer was cancelled due to edf file missing at tracker.-1 if file size is negative.-2 if cannot create local file.-3 if file transfer was cancelled.-4 if file transfer was aborted.-5 if error occurred while writing file.-6 if link was terminated.open_data_file() close_data_file() and open_data_file() This receives a data file from the EyeLink tracker PC with graphical progressbar. This function only available in Win32 platform.
| [in] | src | Name of eye tracker file (including extension). If "" (empty string), asks tracker for name of last opened data file. |
| [in] | dest | Name of local file to write to (including extension). If "" (empty string), prompts for file name. |
| [in] | dest_is_path | If nonzero, appends file name to <dest> as a directory path. |
0 if file transfer was cancelled.FILE_CANT_OPEN if no such file.FILE_XFER_ABORTED if data error.\sa \c receive_data_file()
| INT32 receive_data_file_feedback | ( | const char * | src, |
| const char * | dest, | ||
| INT16 | dest_is_path, | ||
| short(*)(unsigned int size, unsigned int received) | progress | ||
| ) |
This receives a data file from the EyeLink tracker PC. Exact same as receive_data_file(). except the feedback parameters can be used for showing what is the full size of the edf file and how much is received so far. This function is currently used internally only.
| [in] | src | Name of eye tracker file (including extension). If "" (empty string), asks tracker for name of last opened data file. |
| [in] | dest | Name of local file to write to (including extension). This must be a valid file name or directory name. |
| [in] | dest_is_path | If nonzero, appends file name to <dest> as a directory path. |
| [in] | progress | A function pointer, that takes fileName as string, size and received size integers. This allows, one to display progress bar on edf file transfer. |
0 if file transfer was cancelled due to edf file missing at tracker.-1 if file size is negative.-2 if cannot create local file. -3 if file transfer was cancelled -4 if file transfer was aborted -5 if error occurred while writing file -6 if link was terminated\sa \c receive_data_file, \c close_data_file() and \c open_data_file()
| INT32 receive_data_file_feedback64 | ( | const char * | src, |
| const char * | dest, | ||
| INT16 | options, | ||
| short(*)(char *fileName, UINT64 size, UINT64 received) | progress | ||
| ) |
This receives a data file from the EyeLink tracker.
| [in] | src | Name of eye tracker file (including extension). If "" (empty string), asks tracker for name of last opened data file. |
| [in] | dest | Name of local file to write to (including extension). This must be a valid file name or directory name. |
| [in] | options | 0 files placed at the same folder where it executes. E.g. receive_data_file_feedback64( "Host.edf" , "Local.edf", 0, NULL); 1 appends file name to <dest> as a directory path. E.g. receive_data_file_feedback64( "Host.edf" , "LocalFolder", 1, NULL); 2 download vFile in the folder with the edf file name without the extension in addition to edf 3 download vFile & edf and append file name to <dest> as a directory path. 4 download only vFile and place it in the folder 5 download only vFile and append file name to <dest> as a directory path. 6 download vFile to the folder in the edf file name.directory. E.g. receive_data_file_feedback64( "Host.edf", "LocalFolder/Local.edf", 6, NULL); |
| [in] | progress | - function pointer ((char * fileName, UINT64 size,UINT64 received)) to get progress update |
0 if file transfer was cancelled due to edf file missing at tracker.-1 if file size is negative.-2 if cannot create local file.-3 if file transfer was cancelled.-4 if file transfer was aborted.-5 if error occurred while writing file.-6 if link was terminated.open_data_file() close_data_file() and open_data_file() If vFiles are also requested then name conflict resolution is achieved by creating a new sub-directory in the destination directory of the EDF, then the EDF and vFiles are placed inside of it. The new directory uses the source name (without .edf suffix) plus the date/time suffix. Should local/Host.edf or local/Host/*.evf already exist when transferring Host.edf and its vFile(s) to local/, then a new directory called e.g. local/Host_20250630_141530/ will be created. New copies of Host.edf and the vFiles will be transferred to local/Host_20250630_141530/.
It may be desirable to discard exsiting files instead of renaming the new copies. Naming resolution can be disabled using the bitwise-OR operator to add the REPLACE_FILE flag to the desired value of the options parameter. For instance, REPLACE_FILE | 2 will download the source EDF and its vFile to the current working directory. If any EDF or vFile with the same name already exists then they will first be removed; this removal will be non- recoverable.
The progress function must return a short integer. If a value of 10 is returned while a video file (vFile) is in the process of being transferred then that transfer will be aborted and receive_data_file_feedback64 will return -3. The progress function can safely return a value of 0 without causing a vFile transfer to abort. If linked against eyelink_exptkit20.lib or w32_dialogs.h is included, the behaviour of this function is receive_data_file_dialog().
This function is equivalent to calling send_data_file_feedback() with NULL for the progress parameter. In other words, a file can be sent to the EyeLink tracker without reporting progress. Otherwise, the first three parameters take the same input as send_data_file_feedback(), and the same return values are produced.
| INT32 send_data_file_feedback | ( | char * | src, |
| char * | dest, | ||
| INT16 | options, | ||
| void(*)(unsigned int size, unsigned int received) | progress | ||
| ) |
This function sends a file to the EyeLink tracker. Source destination file name should be given. Using this function, an image or video can be uploaded from the display PC to the host Tracker PC. The image can later be used as a Gaze Cursor Backdrop via a call to eyecmd_printf( "draw_image %s" , dest ), where dest is the same string that was provided to send_data_file_feedback( ).
Files may be transferred once a link to the Tracker software has been established. A transferred file will then be available until the Tracker software has been closed. Then, all transferred files will be automatically removed from the Tracker PC.
This function can transfer one file at a time. A maximum of 100 files may be transferred to the Tracker PC in a given session. Any additional files that are transferred in the same session will replace older ones.
The maximum size of any one image or video file can be 3145728 bytes, while the total sum of all transferred files may not exceed 300 MB.
| src | Name of local file, including any file-type suffix (max length 1024 incl. null byte). |
| dest | String that the host will use to uniquely identify the image/video data (max length 20 printable chars.). |
| options | Reserved for future use. Set to 0 (zero). |
| progress | A function pointer, that takes size and received size integers. This allows, one to display progress bar on file transfer. |
size of file if transferred file size is equal to the real file size. -1 if fail to connect tracker ftpd.-2 if fail to open file.-3 src or dest is invalid i.e. NULL, empty string, or too long.-4 if fail to receive reply from tracker ftpd. -5 if transferred file size is unequal to the real file size. | INT32 send_data_file_mem | ( | char * | src, |
| char * | fname, | ||
| int | file_size, | ||
| void(*)(unsigned int size, unsigned int received) | progress | ||
| ) |
This function is equivalent to send_data_file_feedback(), except that the source of the file is a memory buffer rather than a regular file.
| src | Points to a buffer containing the file that will be transferred to the EyeLink. |
| fname | Name of eye tracker file to write to (including extension). |
| file_size | Size of the file to be transferred, in bytes. |
| progress | A function pointer, that takes size and received size integers. This allows, one to display progress bar on file transfer. |
size of file if transferred file size is equal to the real file size. -1 if fail to connect tracker ftpd.-2 if fail to open file on tracker.-3 if fail to initiate file transfer.-4 if fail during transfer via tracker ftpd. -5 if transferred file size is unequal to the real file size. | void splice_fname | ( | const char * | fname, |
| const char * | path, | ||
| char * | ffname | ||
| ) |
Splice 'path' to 'fname', store in 'ffname'. Tries to create valid concatenation. If 'fname' starts with '\', just adds drive from 'path'. If 'fname' contains drive specifier, it is not changed.