Microchip® Advanced Software Framework

winc1500/host_app/provisioning/http_content.c File Reference

This module contains WINC1500 Host MCU Provisioning implementation.

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

#include "asf.h"
#include "http_content.h"
#include "html_page_buf.h"
#include <string.h>

Functions

char * construct_http_response (int cid, char *req, int16_t req_sz, int16_t *rsp_sz, wifiProvisionParams *provInfo)
 
static char * find_req_name (char *req, char *name)
 
uint16_t get_content_length (char *req)
 
static char * get_resp_page (void)
 
static uint16_t get_tls_cert_value (char *buf, const char *tok, uint8_t *value, unsigned int max_sz, const char *term)
 
static unsigned int get_token_value (const char *buf, const char *tok, uint8_t *value, const uint16_t max_sz, const char term)
 
static char * not_found_html_page (char *req)
 
static char * post_main_page (char *req, wifiProvisionParams *provInfo)
 

Variables

static uint16_t content_length = 0
 
static uint16_t content_recv_sz =0
 
static uint8_t http_data_pending_flag = 0
 
static char not_found_html []
 
char * pHttpData
 
char * pHttpDataNext
 
static const char resp_page_html []
 

char* construct_http_response ( int  cid,
char *  req,
int16_t  req_sz,
int16_t *  rsp_sz,
wifiProvisionParams provInfo 
)
static char* find_req_name ( char *  req,
char *  name 
)
static

Referenced by construct_http_response().

uint16_t get_content_length ( char *  req)

References get_token_value().

static char* get_resp_page ( void  )
static
static uint16_t get_tls_cert_value ( char *  buf,
const char *  tok,
uint8_t *  value,
unsigned int  max_sz,
const char *  term 
)
static

References m2m_memcpy(), and printf.

Referenced by post_main_page().

static unsigned int get_token_value ( const char *  buf,
const char *  tok,
uint8_t *  value,
const uint16_t  max_sz,
const char  term 
)
static

References i.

Referenced by get_content_length(), and post_main_page().

static char* not_found_html_page ( char *  req)
static

References not_found_html.

Referenced by construct_http_response().

uint16_t content_length = 0
static

Referenced by construct_http_response().

uint16_t content_recv_sz =0
static

Referenced by construct_http_response().

uint8_t http_data_pending_flag = 0
static

Referenced by construct_http_response().

char not_found_html[]
static
Initial value:
=
"<html><head>"
"<title>404 Not Found</title>"
"</head><body>"
"<h1>Not Found</h1>"
"<p>The requested URL was not found on this WINC1500 server.</p>"
"<p>Try Connecting to <a href=\"https://192.168.1.1/provisioning.html\">WINC1500 Provisioning page</a></p>"
"</body></html>"

Referenced by not_found_html_page().

char* pHttpData
char * pHttpDataNext
const char resp_page_html[]
static
Initial value:
=
"<!DOCTYPE html><html><head><title>WINC1500 Provisioning</title></head>"
"<body><h1>WINC1500 Provisioning Completed</h1>"
"</body></html>"

Referenced by get_resp_page().