Microchip® Advanced Software Framework

main.h File Reference

MAIN configuration.

Copyright (c) 2016-2018 Microchip Technology Inc. and its subsidiaries.

Macros

#define IPV4_BYTE(val, index)   ((val >> (index * 8)) & 0xFF)
 Using IP address. More...
 
#define MAIN_EMAIL_MSG   "This mail is sent from Send Email Example."
 
#define MAIN_EMAIL_SUBJECT   "Hello from WINC1500!"
 
#define MAIN_FROM_ADDRESS   "sender@gmail.com" /* Set From Email Address */
 
#define MAIN_FROM_PASSWORD   "12345678" /* Set Sender Email Password */
 
#define MAIN_GMAIL_HOST_NAME   "smtp.gmail.com"
 
#define MAIN_GMAIL_HOST_PORT   465
 
#define MAIN_RECIPIENT_RFC   "<recipient@gmail.com>" /* Set Recipient Email Address */
 
#define MAIN_RETRY_COUNT   3
 
#define MAIN_SENDER_RFC   "<sender@gmail.com>" /* Set Sender Email Address */
 
#define MAIN_SMTP_BUF_LEN   1024
 All SMTP defines. More...
 
#define MAIN_TO_ADDRESS   "recipient@gmail.com" /* Set To Email Address */
 
#define MAIN_WAITING_TIME   30000
 
#define MAIN_WLAN_AUTH   M2M_WIFI_SEC_WPA_PSK
 Security manner. More...
 
#define MAIN_WLAN_PSK   "12345678"
 Password for Destination SSID. More...
 
#define MAIN_WLAN_SSID   "DEMO_AP"
 Wi-Fi Settings. More...
 

Enumerations

enum  eMainEmailError {
  MAIN_EMAIL_ERROR_FAILED = -1,
  MAIN_EMAIL_ERROR_NONE = 0,
  MAIN_EMAIL_ERROR_INIT,
  MAIN_EMAIL_ERROR_HELO,
  MAIN_EMAIL_ERROR_AUTH,
  MAIN_EMAIL_ERROR_AUTH_USERNAME,
  MAIN_EMAIL_ERROR_AUTH_PASSWORD,
  MAIN_EMAIL_ERROR_FROM,
  MAIN_EMAIL_ERROR_RCPT,
  MAIN_EMAIL_ERROR_DATA,
  MAIN_EMAIL_ERROR_MESSAGE,
  MAIN_EMAIL_ERROR_QUIT
}
 
enum  eSMTPStatus {
  SMTP_INACTIVE = 0,
  SMTP_INIT,
  SMTP_HELO,
  SMTP_AUTH,
  SMTP_AUTH_USERNAME,
  SMTP_AUTH_PASSWORD,
  SMTP_FROM,
  SMTP_RCPT,
  SMTP_DATA,
  SMTP_MESSAGE_SUBJECT,
  SMTP_MESSAGE_TO,
  SMTP_MESSAGE_FROM,
  SMTP_MESSAGE_CRLF,
  SMTP_MESSAGE_BODY,
  SMTP_MESSAGE_DATAEND,
  SMTP_QUIT,
  SMTP_ERROR
}
 
enum  eSocketStatus {
  SocketInit = 0,
  SocketConnect,
  SocketWaiting,
  SocketComplete,
  SocketError
}
 

Variables

const char cSmtpCodeAuthReply [] = {'3', '3', '4', '\0'}
 
const char cSmtpCodeAuthSuccess [] = {'2', '3', '5', '\0'}
 
const char cSmtpCodeIntermedReply [] = {'3', '5', '4', '\0'}
 
const char cSmtpCodeOkReply [] = {'2', '5', '0', '\0'}
 
const char cSmtpCodeReady [] = {'2', '2', '0', '\0'}
 Return Codes. More...
 
const char cSmtpCrlf [] = "\r\n"
 
const char cSmtpData [] = "DATA"
 
const char cSmtpDataEnd [] = {'\r', '\n', '.', '\r', '\n', '\0'}
 
const char cSmtpFrom [] = "From: "
 
const char cSmtpHelo [] = {'H', 'E', 'L', 'O', '\0'}
 Send Codes. More...
 
const char cSmtpMailFrom [] = {'M', 'A', 'I', 'L', ' ', 'F', 'R', 'O', 'M', ':', ' ', '\0'}
 
const char cSmtpQuit [] = {'Q', 'U', 'I', 'T', '\r', '\n', '\0'}
 
const char cSmtpRcpt [] = {'R', 'C', 'P', 'T', ' ', 'T', 'O', ':', ' ', '\0'}
 
const char cSmtpSubject [] = "Subject: "
 
const char cSmtpTo [] = "To: "
 

#define IPV4_BYTE (   val,
  index 
)    ((val >> (index * 8)) & 0xFF)

Using IP address.

Referenced by resolve_cb().

#define MAIN_EMAIL_MSG   "This mail is sent from Send Email Example."

Referenced by smtpStateHandler().

#define MAIN_EMAIL_SUBJECT   "Hello from WINC1500!"

Referenced by smtpStateHandler().

#define MAIN_FROM_ADDRESS   "sender@gmail.com" /* Set From Email Address */

Referenced by smtpStateHandler(), and socket_cb().

#define MAIN_FROM_PASSWORD   "12345678" /* Set Sender Email Password */

Referenced by socket_cb().

#define MAIN_GMAIL_HOST_NAME   "smtp.gmail.com"

Referenced by wifi_cb().

#define MAIN_GMAIL_HOST_PORT   465

Referenced by smtpConnect().

#define MAIN_RECIPIENT_RFC   "<recipient@gmail.com>" /* Set Recipient Email Address */

Referenced by smtpStateHandler().

#define MAIN_RETRY_COUNT   3

Referenced by main().

#define MAIN_SENDER_RFC   "<sender@gmail.com>" /* Set Sender Email Address */

Referenced by smtpStateHandler().

#define MAIN_SMTP_BUF_LEN   1024

All SMTP defines.

Referenced by smtpSendRecv(), and socket_cb().

#define MAIN_TO_ADDRESS   "recipient@gmail.com" /* Set To Email Address */

Referenced by smtpStateHandler().

#define MAIN_WAITING_TIME   30000

Referenced by retry_smtp_server().

#define MAIN_WLAN_AUTH   M2M_WIFI_SEC_WPA_PSK

Security manner.

Referenced by main(), and wifi_cb().

#define MAIN_WLAN_PSK   "12345678"

Password for Destination SSID.

Referenced by main(), and wifi_cb().

#define MAIN_WLAN_SSID   "DEMO_AP"

Wi-Fi Settings.

Destination SSID

Referenced by main(), and wifi_cb().

Enumerator
MAIN_EMAIL_ERROR_FAILED 
MAIN_EMAIL_ERROR_NONE 
MAIN_EMAIL_ERROR_INIT 
MAIN_EMAIL_ERROR_HELO 
MAIN_EMAIL_ERROR_AUTH 
MAIN_EMAIL_ERROR_AUTH_USERNAME 
MAIN_EMAIL_ERROR_AUTH_PASSWORD 
MAIN_EMAIL_ERROR_FROM 
MAIN_EMAIL_ERROR_RCPT 
MAIN_EMAIL_ERROR_DATA 
MAIN_EMAIL_ERROR_MESSAGE 
MAIN_EMAIL_ERROR_QUIT 
Enumerator
SMTP_INACTIVE 
SMTP_INIT 
SMTP_HELO 
SMTP_AUTH 
SMTP_AUTH_USERNAME 
SMTP_AUTH_PASSWORD 
SMTP_FROM 
SMTP_RCPT 
SMTP_DATA 
SMTP_MESSAGE_SUBJECT 
SMTP_MESSAGE_TO 
SMTP_MESSAGE_FROM 
SMTP_MESSAGE_CRLF 
SMTP_MESSAGE_BODY 
SMTP_MESSAGE_DATAEND 
SMTP_QUIT 
SMTP_ERROR 
Enumerator
SocketInit 
SocketConnect 
SocketWaiting 
SocketComplete 
SocketError 

const char cSmtpCodeAuthReply[] = {'3', '3', '4', '\0'}

Referenced by socket_cb().

const char cSmtpCodeAuthSuccess[] = {'2', '3', '5', '\0'}

Referenced by socket_cb().

const char cSmtpCodeIntermedReply[] = {'3', '5', '4', '\0'}

Referenced by socket_cb().

const char cSmtpCodeOkReply[] = {'2', '5', '0', '\0'}

Referenced by socket_cb().

const char cSmtpCodeReady[] = {'2', '2', '0', '\0'}

Return Codes.

Referenced by socket_cb().

const char cSmtpCrlf[] = "\r\n"

Referenced by smtpSendRecv(), and smtpStateHandler().

const char cSmtpData[] = "DATA"

Referenced by smtpStateHandler().

const char cSmtpDataEnd[] = {'\r', '\n', '.', '\r', '\n', '\0'}

Referenced by smtpStateHandler().

const char cSmtpFrom[] = "From: "

Referenced by smtpStateHandler().

const char cSmtpHelo[] = {'H', 'E', 'L', 'O', '\0'}

Send Codes.

const char cSmtpMailFrom[] = {'M', 'A', 'I', 'L', ' ', 'F', 'R', 'O', 'M', ':', ' ', '\0'}

Referenced by smtpStateHandler().

const char cSmtpQuit[] = {'Q', 'U', 'I', 'T', '\r', '\n', '\0'}

Referenced by smtpStateHandler().

const char cSmtpRcpt[] = {'R', 'C', 'P', 'T', ' ', 'T', 'O', ':', ' ', '\0'}

Referenced by smtpStateHandler().

const char cSmtpSubject[] = "Subject: "

Referenced by smtpStateHandler().

const char cSmtpTo[] = "To: "

Referenced by smtpStateHandler().