FS Demos

Overview

The FS demo programs can be found at the following SDK location:

$CAFE_ROOT/system/src/demo/fs/

Descriptions of each demo are given in the table below. We recommend examining them in the given order.

File read demo
fs_read_file.cpp
Demonstrates reading data from a file in /vol/content.
Volume state callback demo
fs_state_change_callback.cpp
Demonstrates notification of the change in volume state. The change in state is indicated via the callback function.
NOTE:
This demo purposely generates fatal file system errors by passing invalid arguments. Expect to see the word "fatal" in the log.
Volume state polling demo
fs_state_change_polling.cpp
Demonstrates polling for the change in volume state. The change in state is indicated via the polling function.
NOTE:
This demo purposely generates fatal file system errors by passing invalid arguments. Expect to see the word "fatal" in the log.
Volume state message demo
fs_state_change_queue.cpp
Demonstrates notification for the change in volume state. The change in state is indicated by the received message.
NOTE:
This demo purposely generates fatal file system errors by passing invalid arguments. Expect to see the word "fatal" in the log.
Directory demo
fs_read_dir.cpp
Demonstrates reading directories and listing file/directory names on the contents therein.
Directory recursive demo
fs_read_dir_recursive.cpp
Demonstrates reading a directory tree recursively and listing file/directory names on the contents therein.
Mount hfio demo
fs_mount_hfio.cpp
Shows how to mount the host file IO (HFIO) volume. HFIO is mountable on a CAT-DEV only. The program mounts HFIO and demonstrates following activities on your PC:
  1. Scan the root of C: drive.
  2. Create a directory under $TEMP.
  3. Get stat and create files under $TEMP.
The program retrieves the environment variable $TEMP set on your PC with ENVGetEnvironmentVariable.
Mount SD card demo
fs_mount_sd.cpp
Shows how to mount an SD card device. The SD card is manual mounting device. The program mounts an SD card and demonstrates accessing files.
Read async demo
fs_read_async.cpp
Shows how to call an async command with a callback function and a message queue. If multiple commands are called and performed in parallel, multiple command blocks have to be used. A command block can be reused after the previous function using the block has finished executing.
Command priority demo
fs_cmd_priority.cpp
Shows how to set/get command priority on command blocks. In this demo, multiple asynchronous read requests are issued in parallel with various priorities and they get processed in order by their priorities.
Error emulation demo for Disc
fs_error_emulation.cpp
Shows how to set/get error code for emulation with the client. This demo also shows how to handle the error while accessing to disc which is auto mounting device. This demo use PAD controller to trigger error emulation.
Error emulation demo for SD card
fs_error_emulation_sd.cpp
Shows how to set/get error code for emulation with the client. This demo also shows how to handle the error while accessing the SD card which is a manual mounting device. This demo use PAD controller to trigger error emulation.

Revision History

2014/09/18 Added error emulation demo for SD Card access.
2013/05/08 Automated cleanup pass.
2012/08/16 Added error emulation demo.
2012/07/31 Added command priority demo.
2012/07/19 Readability cleanup.
2012/05/07 Removed demos that was depending on save directory. Added demos using ENV library in Mount hfio demo.
2010/04/04 Add read async test.
2010/03/30 Description updated.
2010/02/27 Initial version.


CONFIDENTIAL