Microchip® Advanced Software Framework

winc3400/host_app/provisioning/http_content.c File Reference

This module contains WINC3400 Host MCU Provisioning implementation.

Copyright (c) 2019 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 
)

Referenced by html_handler().

static char* find_req_name ( char *  req,
char *  name 
)
static

Referenced by construct_http_response().

uint16_t get_content_length ( char *  req)

Referenced by construct_http_response().

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 WINC3400 server.</p>"
"<p>Try Connecting to <a href=\"http://192.168.1.1/provisioning.html\">WINC3400 Provisioning page</a></p>"
"</body></html>"

Referenced by not_found_html_page().

char* pHttpData

Referenced by construct_http_response().

char * pHttpDataNext

Referenced by construct_http_response().

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

Referenced by get_resp_page().