Network Component  Version 7.11.0
MDK Middleware for IPv4 and IPv6 Networking
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
File System Interface

SMTP client functions that work with a File System. More...

Functions

void * netSMTPc_fopen (const char *fname)
 Open a file for reading in SMTP client. [interface]. More...
 
void netSMTPc_fclose (void *file)
 Close a file previously open in SMTP client. [interface]. More...
 
uint32_t netSMTPc_fread (void *file, uint8_t *buf, uint32_t len)
 Read block of data from a file in SMTP client. [interface]. More...
 

Description

SMTP client functions that work with a File System.

All File System Interface functions are located in SMTP_Client_FS.c, which will be automatically added to your project's Network folder. The file is preconfigured for the File System Component, so no modifications are required. If you wish to use another type of file system, you need to add a similar file to your project.

The following functions are implemented in this module:

Note
File System Interface functions are used with the function netSMTPc_SendMail, if support for email attachments is enabled in the Configuration, otherwise the functions are not used.

Function Documentation

void netSMTPc_fclose ( void *  file)

Close a file previously open in SMTP client. [interface].

Parameters
[in]filepointer to the file to close.
Returns
none.

The function netSMTPc_fclose closes the file identified by the file stream pointer.

The function interfaces to the File System Component and will be called by the Network Component automatically. If another file system will be used, refer to the reference implementation in the SMTP_Client_FS.c module.

void void * netSMTPc_fopen ( const char *  fname)

Open a file for reading in SMTP client. [interface].

Parameters
[in]fnamename of the file to open.
Returns
status information:
  • Pointer to an open file.
  • NULL in case of an error.

The function netSMTPc_fopen opens a file for reading.

The argument fname specifies the name of the file to open.

The function interfaces to the File System Component and will be called by the Network Component automatically. If another file system will be used, refer to the reference implementation in the SMTP_Client_FS.c module.

uint32_t netSMTPc_fread ( void *  file,
uint8_t *  buf,
uint32_t  len 
)

Read block of data from a file in SMTP client. [interface].

Parameters
[in]filepointer to the file to read from.
[out]bufblock of memory to write data to.
[in]lenlength of data to read in bytes.
Returns
number of bytes successfully read.

The function netSMTPc_fread reads len bytes from the file identified by the file stream pointer in the function argument.

The argument buf is a pointer to the buffer where the function stores the data read from the file.

The function interfaces to the File System Component and will be called by the Network Component automatically. If another file system will be used, refer to the reference implementation in the SMTP_Client_FS.c module.

Note
The function must read len bytes. The SMTP client stops reading and closes the file if the return value is less than len bytes.