Atmel Software Framework

avr32/applications/evk1100-control-panel/network/smtpclient/BasicSMTP.c File Reference
#include <string.h>
#include "gpio.h"
#include "FreeRTOS.h"
#include "task.h"
#include "BasicSMTP.h"
#include "semphr.h"
#include "portmacro.h"
#include "intc.h"
#include "fsaccess.h"
#include "conf_explorer.h"
#include "config_file.h"
#include "supervisor.h"
#include "ethernet.h"
#include "lwip/api.h"
#include "lwip/tcpip.h"
#include "lwip/memp.h"
#include "lwip/stats.h"
#include "lwip/opt.h"
#include "lwip/arch.h"
#include "lwip/sys.h"
#include "lwip/sockets.h"
#include "lwip/init.h"

Macros

#define SMTP_ERRMSG_CONFIGURESMTP   "SMTP has not been compiled, please set SMTP_USED to 1 at preprocessor level\r\n"
 define the error string to use SMTP through configuration More...
 

Functions

eExecStatus e_smtpclient_cmd_get_config (eModId xModId, signed short FsNavId, int ac, signed portCHAR *av[], signed portCHAR **ppcStringReply)
 The get smtp client config command: get the SMTP variables. Takes no parameter. More...
 
eExecStatus e_smtpclient_cmd_set_config (eModId xModId, signed short FsNavId, int ac, signed portCHAR *av[], signed portCHAR **ppcStringReply)
 The set smtp client config command: set the SMTP variables. More...
 

#define SMTP_ERRMSG_CONFIGURESMTP   "SMTP has not been compiled, please set SMTP_USED to 1 at preprocessor level\r\n"

define the error string to use SMTP through configuration

Referenced by e_smtpclient_cmd_set_config().

eExecStatus e_smtpclient_cmd_get_config ( eModId  xModId,
signed short  FsNavId,
int  ac,
signed portCHAR *  av[],
signed portCHAR **  ppcStringReply 
)

The get smtp client config command: get the SMTP variables. Takes no parameter.

Note
This function must be of the type eExecStatus defined by the shell module.
Parameters
xModIdInput. The module that is calling this function.
FsNavIdIgnored.
acInput. The argument counter. For this command, should be 1.
avInput. The argument vector.
ppcStringReplyInput/Output. The response string. If Input is NULL, no response string will be output. Else a malloc for the response string is performed here; the caller must free this string.
Returns
the status of the command execution.

References MAX_CONFIG_FILE_SIZE, NULL, pvPortMalloc(), SHELL_ERRMSG_MEMALLOC, SHELL_EXECSTATUS_KO, SHELL_EXECSTATUS_OK, and sprintf().

Referenced by e_syscmds_cmd_get_config().

eExecStatus e_smtpclient_cmd_set_config ( eModId  xModId,
signed short  FsNavId,
int  ac,
signed portCHAR *  av[],
signed portCHAR **  ppcStringReply 
)

The set smtp client config command: set the SMTP variables.

*         Takes 4 parameters :
*                        port=ppppp
*                        server=smtp.domain.com
*                        mailto=recipient@domain.com
*                        mailfrom=sender@domain.com
* 
Note
This function must be of the type eExecStatus defined by the shell module.
Parameters
xModIdInput. The module that is calling this function.
FsNavIdIgnored.
acInput. The argument counter. For this command, should be 1.
avInput. The argument vector.
ppcStringReplyInput/Output. The response string. If Input is NULL, no response string will be output. Else a malloc for the response string is performed here; the caller must free this string.
Returns
the status of the command execution.

References config_file_set_value(), Min, SHELL_ERRMSG_CONFIGERROR, SHELL_EXECSTATUS_KO, SHELL_EXECSTATUS_OK_NO_FREE, SHELL_MSG_CONFIG_SET, and SMTP_ERRMSG_CONFIGURESMTP.

Referenced by e_syscmds_cmd_set_config().