![]() |
WiConnect Host Library- API Reference Guide | ||
File methods. More...
Functions | |
WiconnectResult | wiconnect::FileInterface::createFile (const ReaderFunc &reader, void *user, const char *name, uint32_t size, uint32_t version=0, FileType type=FILE_TYPE_ANY, bool isEssential=false, int32_t checksum=-1) |
Create a file on the Wiconnect WiFi module filesystem. More... | |
WiconnectResult | wiconnect::FileInterface::openFile (WiconnectFile &file, const char *name) |
Open a file on the Wiconnect WiFi module filesystem for reading. More... | |
WiconnectResult | wiconnect::FileInterface::deleteFile (const char *name) |
Delete a file for the Wiconnect WiFi module filesystem. More... | |
WiconnectResult | wiconnect::FileInterface::deleteFile (const WiconnectFile &file) |
Delete a file for the Wiconnect WiFi module filesystem. More... | |
WiconnectResult | wiconnect::FileInterface::listFiles (FileList &list, const char *name=NULL, FileType type=FILE_TYPE_ANY, uint32_t version=0) |
List the files on the Wiconnect WiFi module filesystem. More... | |
File methods.
WiconnectResult wiconnect::FileInterface::createFile | ( | const ReaderFunc & | reader, |
void * | user, | ||
const char * | name, | ||
uint32_t | size, | ||
uint32_t | version = 0 , |
||
FileType | type = FILE_TYPE_ANY , |
||
bool | isEssential = false , |
||
int32_t | checksum = -1 |
||
) |
Create a file on the Wiconnect WiFi module filesystem.
This creates a file on the module's filesystem. The file's name and size are required. Optionally specify the version, type and if it's essential (i.e. if it should never be automatically deleted, careful with this optional as it could cause the the module to not be able to update its firmware).
When this method is executed, the file is created on the module then the 'reader' parameter callback is called until all the file data is read from the HOST and written to the module file.
[in] | reader | Callback to be executed until all file data has been read from the HOST and written to the module |
[in] | user | This is supplied to the ReaderFunc callback. It is not used by the library. Leave NULL if not needed. |
[in] | name | The name of the file to create |
[in] | size | The size in bytes of the file |
[in] | version | Optional, the version of the file, defaults to 1.0.0.0 |
[in] | type | Optional, the file type, defaults to FILE_TYPE_MISC_FIX_LEN |
[in] | isEssential | Optional, specify if the file should never be automatically deleted during a firmware upgrade |
[in] | checksum | The CRC16 checksum of the file data. The module verifies the written data against this checksum |
WiconnectResult wiconnect::FileInterface::deleteFile | ( | const char * | name | ) |
Delete a file for the Wiconnect WiFi module filesystem.
[in] | name | The name of the file to delete |
WiconnectResult wiconnect::FileInterface::deleteFile | ( | const WiconnectFile & | file | ) |
Delete a file for the Wiconnect WiFi module filesystem.
[in] | file | The WiconnectFile object of the file to delete |
WiconnectResult wiconnect::FileInterface::listFiles | ( | FileList & | list, |
const char * | name = NULL , |
||
FileType | type = FILE_TYPE_ANY , |
||
uint32_t | version = 0 |
||
) |
List the files on the Wiconnect WiFi module filesystem.
This lists all the files on the filesystem. Optionally filter by one or more parameters:
WiconnectResult wiconnect::FileInterface::openFile | ( | WiconnectFile & | file, |
const char * | name | ||
) |
Open a file on the Wiconnect WiFi module filesystem for reading.
Once opened, the returned WiconnectFile object may only be read.
[out] | file | The WiconnectFile object to read data from |
[in] | name | The name of the file to open |