ACKme Logo WiConnect Host Library- API Reference Guide
 
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Groups Pages
Methods

File Types. 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...
 

Detailed Description

File Types.

Function Documentation

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.

Parameters
[in]readerCallback to be executed until all file data has been read from the HOST and written to the module
[in]userThis is supplied to the ReaderFunc callback. It is not used by the library. Leave NULL if not needed.
[in]nameThe name of the file to create
[in]sizeThe size in bytes of the file
[in]versionOptional, the version of the file, defaults to 1.0.0.0
[in]typeOptional, the file type, defaults to FILE_TYPE_MISC_FIX_LEN
[in]isEssentialOptional, specify if the file should never be automatically deleted during a firmware upgrade
[in]checksumThe CRC16 checksum of the file data. The module verifies the written data against this checksum
Returns
Result of method. See WiconnectResult
WiconnectResult wiconnect::FileInterface::deleteFile ( const char *  name)

Delete a file for the Wiconnect WiFi module filesystem.

Parameters
[in]nameThe name of the file to delete
Returns
Result of method. See WiconnectResult
WiconnectResult wiconnect::FileInterface::deleteFile ( const WiconnectFile file)

Delete a file for the Wiconnect WiFi module filesystem.

Parameters
[in]fileThe WiconnectFile object of the file to delete
Returns
Result of method. See WiconnectResult
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:

  • name - list files only with given name. If the name started with the wildcard character '*', then only the characters after it are used for filter. Example:
    wiconnect.listFiles(fileList, "*.txt"); // only list files with '.txt' extension
  • type - only list files with given type
  • version - only list file with given version
    Returns
    Result of method. See WiconnectResult
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.

Parameters
[out]fileThe WiconnectFile object to read data from
[in]nameThe name of the file to open
Returns
Result of method. See WiconnectResult