Initialization:
int num_free = 0;
int num_used = 0;
Get camera's FFS info:
stat = xiGetParamInt(xiH, XI_PRM_FREE_FFS_SIZE, &num_free);
HandleResult(stat,"xiGetParamInt (XI_PRM_FREE_FFS_SIZE)");
stat = xiGetParamInt(xiH, XI_PRM_USED_FFS_SIZE, &num_used);
HandleResult(stat,"xiGetParamInt (XI_PRM_USED_FFS_SIZE)\n\n");
printf("FFS stats:\n");
printf("Free bytes : %d \n", num_free);
printf("Used bytes : %d \n", num_used);
Write file to camera's FFS:
char test_file[MAX_PATH]="test.txt";
char test_text[MAX_PATH]="Example of user text, that can be stored in camera.";
stat = xiSetParamString(xiH, XI_PRM_FFS_FILE_NAME, test_file, MAX_PATH);
HandleResult(stat,"xiSetParamString (XI_PRM_FFS_FILE_NAME)");
stat = xiSetParamString(xiH, XI_PRM_WRITE_FILE_FFS, test_text, MAX_PATH);
HandleResult(stat,"xiSetParamString (XI_PRM_WRITE_FILE_FFS)");
Read data from camera's FFS:
char read_text[MAX_PATH]="";
stat = xiGetParamString(xiH, XI_PRM_READ_FILE_FFS, read_text, MAX_PATH);
HandleResult(stat,"xiSetParamString (XI_PRM_READ_FILE_FFS)");
printf("Text read from FFS:\n%s\n\n", read_text);
Get camera's FFS info:
stat = xiGetParamInt(xiH, XI_PRM_FREE_FFS_SIZE, &num_free);
HandleResult(stat,"xiGetParamInt (XI_PRM_FREE_FFS_SIZE)");
stat = xiGetParamInt(xiH, XI_PRM_USED_FFS_SIZE, &num_used);
HandleResult(stat,"xiGetParamInt (XI_PRM_USED_FFS_SIZE)\n\n");
printf("FFS stats:\n");
printf("Free bytes : %d \n", num_free);
printf("Used bytes : %d \n", num_used);
The complete source code can be downloaded from here: sample_for_working_with_FFS.cpp.