Microchip® Advanced Software Framework

main.h File Reference

Certificate Downloader via OTA (HTTPS) Example.

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

Data Structures

struct  certFileInfo
 

Macros

#define CERTIFICATES_BUFFER_SIZE   (6000)
 
#define IPV4_BYTE(val, index)   ((val >> (index * 8)) & 0xFF)
 IP address parsing. More...
 
#define MAIN_BUFFER_MAX_SIZE   (1446)
 Maximum size for packet buffer. More...
 
#define MAIN_HTTP_FILE_URL   "https://192.168.43.34/"
 Content URI for download. More...
 
#define MAIN_HTTP_PORT_NUMBER   (4443)
 
#define MAIN_MAX_FILE_NAME_LENGTH   (100)
 Maximum file name length. More...
 
#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 AP Settings. More...
 
#define NUM_OF_ROOT_TLS_CHAIN_CERTIFICATES   5
 No of certificates to be written to WINC. More...
 

Enumerations

enum  cert_type_t {
  ROOT_CERT = 1,
  TLS_RSA_CERT = 2,
  TLS_ECC_CERT = 3
}
 
enum  download_state {
  NOT_READY = 0,
  WIFI_CONNECTED = 0x01,
  HTTP_DOWNLOAD_INITIATED = 0x02,
  GET_REQUESTED = 0x04,
  DOWNLOADING = 0x08,
  COMPLETED = 0x10,
  CANCELED = 0x20,
  ROOT_CERT_DOWNLOAD = 0x40,
  TLS_CERT_DOWNLOAD = 0x80
}
 

Variables

certFileInfo root_tls_certs_name [NUM_OF_ROOT_TLS_CHAIN_CERTIFICATES]
 Root Certificates to be uploaded. More...
 

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

IP address parsing.

Referenced by resolve_cb().

#define MAIN_BUFFER_MAX_SIZE   (1446)

Maximum size for packet buffer.

Referenced by configure_http_client(), and http_client_callback().

#define MAIN_HTTP_FILE_URL   "https://192.168.43.34/"

Content URI for download.

Referenced by certificate_download().

#define MAIN_HTTP_PORT_NUMBER   (4443)

Referenced by start_download().

#define MAIN_MAX_FILE_NAME_LENGTH   (100)

Maximum file name length.

#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 AP Settings.

Destination SSID

Referenced by main(), and wifi_cb().

#define NUM_OF_ROOT_TLS_CHAIN_CERTIFICATES   5

No of certificates to be written to WINC.

Referenced by burn_certificates(), and certificate_download().

Enumerator
ROOT_CERT 
TLS_RSA_CERT 
TLS_ECC_CERT 
Enumerator
NOT_READY 

Not ready.

WIFI_CONNECTED 

Wi-Fi is connected.

HTTP_DOWNLOAD_INITIATED 

Start download is called

GET_REQUESTED 

GET request is sent.

DOWNLOADING 

Running to download.

COMPLETED 

Download completed.

CANCELED 

Download canceled.

ROOT_CERT_DOWNLOAD 

Root cert Download.

TLS_CERT_DOWNLOAD 

TLS cert Download.

Initial value:
=
{{ROOT_CERT,0,(uint8_t*)"PROWL_Root.cer"},
{ROOT_CERT,0,(uint8_t*)"NMA_Root.cer"},
{TLS_RSA_CERT,2,(uint8_t*)"winc_rsa.key"},
{TLS_RSA_CERT,0,(uint8_t*)"winc_rsa.cer"},
{TLS_RSA_CERT,0,(uint8_t*)"WincRootCA.cer"}
}
Definition: main.h:77
Definition: main.h:76

Root Certificates to be uploaded.

Chain of TLS Certificates and private key to be uploaded

Referenced by burn_certificates(), and certificate_download().