4. The embedded file system
Your Yocto-Display contains a small embedded file system, allowing it to store personalized files for
its own use. You can manipulate the file system thanks to the
yocto_files
library.
4.1. Usage
Interactive usage with the VirtualHub
The
VirtualHub
provides a succinct interface to manipulate the content of the file system: simply click
the
configuration
button corresponding to your module in the
VirtualHub
interface, then the
manage
files
button. The files are listed and you can view them, erase them, or add new ones (downloads).
Because of its small size, the file system does not have an explicit concept of directories. You can
nevertheless use the slash sign "/" inside file names to sort them as if they were in directories.
Programmed usage
Use the
yocto_files
library to manage the file system. Basic functions are available:
•
upload
creates a new file on the module, with a content that you provide;
•
get_list
lists the files on the module, including their content size and CRC32;
•
download
retrieves in a variable the content of a file present on the module;
•
remove
erases a file from the module;
•
format
resets the file system to an empty, not fragmented state.
A piece of software using a well designed file system should always start by making sure that all the
files necessary for its working are available on the module, and if needed upload them on the
module. We can thus transparently manage software updates and application deployment on new
modules. To make file versions easier to detect, the
get_list
method returns for each file a 32 bit
signature called CRC (Cyclic Redundancy Check) which identifies in a reliable manner the file
content. Thus, if the file CRC corresponds, there is less than one chance over 4 billions that the
content is not the correct one. You can even compute in advance in your software the CRC of the
content you want, and therefore check it without having to download the files. The CRC function used
by the Yoctopuce file system is the same as Ethernet, Gzip, PNG, etc. Its characteristic value for the
nine character string "123456789" is 0xCBF43926.
HTTP usage
You can access the files that your have downloaded on your Yocto-Display by HTTP, at the root of
the module (at the same level as the REST API). This allows you to load personalized HTML and
www.yoctopuce.com
13
Содержание Yocto-Display
Страница 1: ...Yocto Display User Manual...
Страница 2: ......
Страница 40: ...34 www yoctopuce com...
Страница 52: ...46 www yoctopuce com...
Страница 84: ...78 www yoctopuce com...
Страница 92: ...86 www yoctopuce com...
Страница 130: ...124 www yoctopuce com...
Страница 158: ...22 High level API Reference 152 www yoctopuce com On failure throws an exception or returns a negative error code...
Страница 422: ...416 www yoctopuce com...
Страница 424: ...24 Characteristics 418 www yoctopuce com...