Network Component  
MDK Middleware for IPv4 and IPv6 Networking
 
Loading...
Searching...
No Matches
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].
 
void netSMTPc_fclose (void *file)
 Close a file previously open in SMTP client. [interface].
 
uint32_t netSMTPc_fread (void *file, uint8_t *buf, uint32_t len)
 Read block of data from a file in SMTP client. [interface].
 

Description

SMTP client functions that work with a File System.

All functions of the File System Interface are located in SMTP_Client_FS.c, which is automatically added to the Network folder of your project. The file is preconfigured for the , so no changes are required. If you want to use a different type of file system, you must add a similar file to your project and implement the interface functions yourself.

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

◆ netSMTPc_fclose()

void netSMTPc_fclose ( void *  file)

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

Parameters
[in]filepointer to the file to close.

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.

◆ netSMTPc_fopen()

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.

◆ netSMTPc_fread()

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.