FileTransfer Sample
Jump to navigation
Jump to search
Introduction
This example demonstrates a simple technique to enable file transfers between the host and target device through the use of helper functions that invoke File Transfer Services APIs. These techniques are particularly useful for devices that don't have externally accessible file systems as a way to transfer large volumes of data to/from the device for the purpose of testing (e.g. media data when testing a media player application).
Source (helper utilities)
s2_filetransfer_util.c / h
These files implement the following functions to read from and write to the host filesystem:
- readFromHost
- reads a specified file path from the host and creates a stdio temporary file handle with the contents of the file.
- writeToHost
- writes the contents of a filehandle to the specified host path.
- FileLoopback
- remotely callable function that takes two paths - the file to read from and the file to write to (will be created). This function is called by our test to cause files to be transferred to/from the host.
Tests Description
s2_filetransfer_testmodule
This test module implements a single test that shows how to invoke a remote helper function to initiate the transfer of files
file_loopback
This test does the following:
- creates a text file containing random characters
TBD