Host library for controlling a WiConnect enabled Wi-Fi module.

Dependents:   wiconnect-ota_example wiconnect-web_setup_example wiconnect-test-console wiconnect-tcp_server_example ... more

Embed: (wiki syntax)

« Back to documentation index

Methods

Methods
[File]

File methods. More...

Functions

WiconnectResult 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.
WiconnectResult openFile (WiconnectFile &file, const char *name)
 Open a file on the Wiconnect WiFi module filesystem for reading.
WiconnectResult deleteFile (const char *name)
 Delete a file for the Wiconnect WiFi module filesystem.
WiconnectResult deleteFile (const WiconnectFile &file)
 Delete a file for the Wiconnect WiFi module filesystem.
WiconnectResult 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.

Detailed Description

File methods.


Function Documentation

WiconnectResult 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 
) [inherited]

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 deleteFile ( const WiconnectFile file ) [inherited]

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 deleteFile ( const char *  name ) [inherited]

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 listFiles ( FileList list,
const char *  name = NULL,
FileType  type = FILE_TYPE_ANY,
uint32_t  version = 0 
) [inherited]

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 openFile ( WiconnectFile file,
const char *  name 
) [inherited]

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