Add avr-atmega128rfa1 platform based on Michael Hartman's board (single LED peripheral)

This commit is contained in:
dak664 2011-02-07 13:15:21 -05:00
parent 587951cf65
commit 62b894e560
42 changed files with 4793 additions and 0 deletions

View file

@ -0,0 +1,59 @@
raven-webserver_src = webserver-nogui.c httpd.c http-strings.c psock.c memb.c \
httpd-fs.c httpd-cgi.c
raven-webserver_dsc = webserver-dsc.c
#Tell platform main routine webserver is present, for parameter display at startup
CFLAGS += -DWEBSERVER
#$(CONTIKI)/apps/webserver/http-strings.c: $(CONTIKI)/apps/webserver/http-strings
# cd $(CONTIKI)/apps/webserver/; $(CONTIKI)/tools/makestrings $<
#
#The default is fixed web content packed in program flash memory. Note the existing httpd-fs read
#code will only work for content in the first 64KB of program flash as the linked list addresses are
#only 16 bit and reads use pgm_read_byte_near.
#For COFFEE_FILES=1 Fixed web content in eeprom memory. Existing files can be rewritten but not extended
#For COFFEE_FILES=2 Initial web content in eeprom memory in a fully writeable coffee file system.
#For COFFEE_FILES=3 Fixed web content in program flash memory. Existing files can be rewritten but not extended
#For COFFEE_FILES=4 Initial webcontent in program flash memory in a fully writeable coffee file system.
#The default web content is in the /httpd-fs directory. Override with $make WEBDIR=another_directory
#If WEBDIR is then dropped from the command line the web content will NOT revert to the default
#unless one of the files in the default directory is changed. This means a .coffeesection may still
#be defined when COFFEE_FILES is dropped from the make, and a section overlap will occur during the link.
#You can always safely restore the default content with $make WEBDIR=default.
.PHONY : force
ifdef WEBDIR
FORCE=force
ifeq ($(WEBDIR),default)
override WEBDIR=$(CONTIKI)/platform/avr-atmega128rfa1/apps/raven-webserver/httpd-fs
endif
else
WEBDIR=$(CONTIKI)/platform/avr-atmega128rfa1/apps/raven-webserver/httpd-fs
endif
WEBCSOURCE=$(CONTIKI)/platform/avr-atmega128rfa1/apps/raven-webserver/
ifdef COFFEE_ADDRESS #for now force whenever present, could test for arg passed in make
FORCE=force
endif
$(WEBCSOURCE)httpd-fs.c: $(WEBCSOURCE)httpd-fsdata.c
$(WEBCSOURCE)httpd-fsdata.c : $(FORCE) $(WEBDIR)/*.*
ifeq ($(COFFEE_FILES), 1) #1=eeprom static
@echo Generating web content for static eeprom coffee file system
$(CONTIKI)/tools/makefsdata -C -A EEPROM -l -f 16 -d $(WEBDIR) -o $(WEBCSOURCE)httpd-fsdata.c
else ifeq ($(COFFEE_FILES), 2) #2=eeprom dynamic
@echo Generating web content for full eeprom coffee file system
$(CONTIKI)/tools/makefsdata -C -A EEPROM -f 20 -d $(WEBDIR) -o $(WEBCSOURCE)httpd-fsdata.c
else ifeq ($(COFFEE_FILES), 3) #3=program flash static
@echo Generating web content for static flash coffee file system
$(CONTIKI)/tools/makefsdata -C -A PROGMEM -l -f 16 -d $(WEBDIR) -o $(WEBCSOURCE)httpd-fsdata.c
else ifeq ($(COFFEE_FILES), 4) #4=program flash dynamic
@echo Generating initial web content for full flash coffee file system
$(CONTIKI)/tools/makefsdata -C -A PROGMEM -c -f 20 -d $(WEBDIR) -o $(WEBCSOURCE)httpd-fsdata.c
else
@echo Generating static web content
$(CONTIKI)/tools/makefsdata -A PROGMEM -l -d $(WEBDIR) -o $(WEBCSOURCE)httpd-fsdata.c
endif

View file

@ -0,0 +1,35 @@
http_http "http://"
http_200 "200 "
http_301 "301 "
http_302 "302 "
http_get "GET "
http_10 "HTTP/1.0"
http_11 "HTTP/1.1"
http_content_type "content-type: "
http_texthtml "text/html"
http_location "location: "
http_host "host: "
http_crnl "\r\n"
http_index_html "/index.html"
http_404_html "/404.html"
http_referer "Referer:"
http_header_200 "HTTP/1.0 200 OK\r\nServer: Contiki/2.0 http://www.sics.se/contiki/\r\nConnection: close\r\n"
http_header_404 "HTTP/1.0 404 Not found\r\nServer: Contiki/2.0 http://www.sics.se/contiki/\r\nConnection: close\r\n"
http_content_type_plain "Content-type: text/plain\r\n\r\n"
http_content_type_html "Content-type: text/html\r\n\r\n"
http_content_type_css "Content-type: text/css\r\n\r\n"
http_content_type_text "Content-type: text/text\r\n\r\n"
http_content_type_png "Content-type: image/png\r\n\r\n"
http_content_type_gif "Content-type: image/gif\r\n\r\n"
http_content_type_jpg "Content-type: image/jpeg\r\n\r\n"
http_content_type_binary "Content-type: application/octet-stream\r\n\r\n"
http_html ".html"
http_shtml ".shtml"
http_htm ".htm"
http_css ".css"
http_png ".png"
http_gif ".gif"
http_jpg ".jpg"
http_text ".text"
http_txt ".txt"

View file

@ -0,0 +1,104 @@
#if 0 /*This file not used when strings reside in flash memory only*/
const char http_http[8] =
/* "http://" */
{0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, };
const char http_200[5] =
/* "200 " */
{0x32, 0x30, 0x30, 0x20, };
const char http_301[5] =
/* "301 " */
{0x33, 0x30, 0x31, 0x20, };
const char http_302[5] =
/* "302 " */
{0x33, 0x30, 0x32, 0x20, };
const char http_get[5] =
/* "GET " */
{0x47, 0x45, 0x54, 0x20, };
const char http_10[9] =
/* "HTTP/1.0" */
{0x48, 0x54, 0x54, 0x50, 0x2f, 0x31, 0x2e, 0x30, };
const char http_11[9] =
/* "HTTP/1.1" */
{0x48, 0x54, 0x54, 0x50, 0x2f, 0x31, 0x2e, 0x31, };
const char http_content_type[15] =
/* "content-type: " */
{0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x3a, 0x20, };
const char http_texthtml[10] =
/* "text/html" */
{0x74, 0x65, 0x78, 0x74, 0x2f, 0x68, 0x74, 0x6d, 0x6c, };
const char http_location[11] =
/* "location: " */
{0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, };
const char http_host[7] =
/* "host: " */
{0x68, 0x6f, 0x73, 0x74, 0x3a, 0x20, };
const char http_crnl[3] =
/* "\r\n" */
{0xd, 0xa, };
const char http_index_html[12] =
/* "/index.html" */
{0x2f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x2e, 0x68, 0x74, 0x6d, 0x6c, };
const char http_404_html[10] =
/* "/404.html" */
{0x2f, 0x34, 0x30, 0x34, 0x2e, 0x68, 0x74, 0x6d, 0x6c, };
const char http_referer[9] =
/* "Referer:" */
{0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x72, 0x3a, };
const char http_header_200[86] =
/* "HTTP/1.0 200 OK\r\nServer: Contiki/2.0 http://www.sics.se/contiki/\r\nConnection: close\r\n" */
{0x48, 0x54, 0x54, 0x50, 0x2f, 0x31, 0x2e, 0x30, 0x20, 0x32, 0x30, 0x30, 0x20, 0x4f, 0x4b, 0xd, 0xa, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x3a, 0x20, 0x43, 0x6f, 0x6e, 0x74, 0x69, 0x6b, 0x69, 0x2f, 0x32, 0x2e, 0x30, 0x20, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x73, 0x69, 0x63, 0x73, 0x2e, 0x73, 0x65, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x69, 0x6b, 0x69, 0x2f, 0xd, 0xa, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x63, 0x6c, 0x6f, 0x73, 0x65, 0xd, 0xa, };
const char http_header_404[93] =
/* "HTTP/1.0 404 Not found\r\nServer: Contiki/2.0 http://www.sics.se/contiki/\r\nConnection: close\r\n" */
{0x48, 0x54, 0x54, 0x50, 0x2f, 0x31, 0x2e, 0x30, 0x20, 0x34, 0x30, 0x34, 0x20, 0x4e, 0x6f, 0x74, 0x20, 0x66, 0x6f, 0x75, 0x6e, 0x64, 0xd, 0xa, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x3a, 0x20, 0x43, 0x6f, 0x6e, 0x74, 0x69, 0x6b, 0x69, 0x2f, 0x32, 0x2e, 0x30, 0x20, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x73, 0x69, 0x63, 0x73, 0x2e, 0x73, 0x65, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x69, 0x6b, 0x69, 0x2f, 0xd, 0xa, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x63, 0x6c, 0x6f, 0x73, 0x65, 0xd, 0xa, };
const char http_content_type_plain[29] =
/* "Content-type: text/plain\r\n\r\n" */
{0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x3a, 0x20, 0x74, 0x65, 0x78, 0x74, 0x2f, 0x70, 0x6c, 0x61, 0x69, 0x6e, 0xd, 0xa, 0xd, 0xa, };
const char http_content_type_html[28] =
/* "Content-type: text/html\r\n\r\n" */
{0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x3a, 0x20, 0x74, 0x65, 0x78, 0x74, 0x2f, 0x68, 0x74, 0x6d, 0x6c, 0xd, 0xa, 0xd, 0xa, };
const char http_content_type_css [27] =
/* "Content-type: text/css\r\n\r\n" */
{0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x3a, 0x20, 0x74, 0x65, 0x78, 0x74, 0x2f, 0x63, 0x73, 0x73, 0xd, 0xa, 0xd, 0xa, };
const char http_content_type_text[28] =
/* "Content-type: text/text\r\n\r\n" */
{0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x3a, 0x20, 0x74, 0x65, 0x78, 0x74, 0x2f, 0x74, 0x65, 0x78, 0x74, 0xd, 0xa, 0xd, 0xa, };
const char http_content_type_png [28] =
/* "Content-type: image/png\r\n\r\n" */
{0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x3a, 0x20, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x2f, 0x70, 0x6e, 0x67, 0xd, 0xa, 0xd, 0xa, };
const char http_content_type_gif [28] =
/* "Content-type: image/gif\r\n\r\n" */
{0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x3a, 0x20, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x2f, 0x67, 0x69, 0x66, 0xd, 0xa, 0xd, 0xa, };
const char http_content_type_jpg [29] =
/* "Content-type: image/jpeg\r\n\r\n" */
{0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x3a, 0x20, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x2f, 0x6a, 0x70, 0x65, 0x67, 0xd, 0xa, 0xd, 0xa, };
const char http_content_type_binary[43] =
/* "Content-type: application/octet-stream\r\n\r\n" */
{0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x3a, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6f, 0x63, 0x74, 0x65, 0x74, 0x2d, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0xd, 0xa, 0xd, 0xa, };
const char http_html[6] =
/* ".html" */
{0x2e, 0x68, 0x74, 0x6d, 0x6c, };
const char http_shtml[7] =
/* ".shtml" */
{0x2e, 0x73, 0x68, 0x74, 0x6d, 0x6c, };
const char http_htm[5] =
/* ".htm" */
{0x2e, 0x68, 0x74, 0x6d, };
const char http_css[5] =
/* ".css" */
{0x2e, 0x63, 0x73, 0x73, };
const char http_png[5] =
/* ".png" */
{0x2e, 0x70, 0x6e, 0x67, };
const char http_gif[5] =
/* ".gif" */
{0x2e, 0x67, 0x69, 0x66, };
const char http_jpg[5] =
/* ".jpg" */
{0x2e, 0x6a, 0x70, 0x67, };
const char http_text[6] =
/* ".text" */
{0x2e, 0x74, 0x65, 0x78, 0x74, };
const char http_txt[5] =
/* ".txt" */
{0x2e, 0x74, 0x78, 0x74, };
#endif

View file

@ -0,0 +1,34 @@
extern const char http_http[8];
extern const char http_200[5];
extern const char http_301[5];
extern const char http_302[5];
extern const char http_get[5];
extern const char http_10[9];
extern const char http_11[9];
extern const char http_content_type[15];
extern const char http_texthtml[10];
extern const char http_location[11];
extern const char http_host[7];
extern const char http_crnl[3];
extern const char http_index_html[12];
extern const char http_404_html[10];
extern const char http_referer[9];
extern const char http_header_200[86];
extern const char http_header_404[93];
extern const char http_content_type_plain[29];
extern const char http_content_type_html[28];
extern const char http_content_type_css [27];
extern const char http_content_type_text[28];
extern const char http_content_type_png [28];
extern const char http_content_type_gif [28];
extern const char http_content_type_jpg [29];
extern const char http_content_type_binary[43];
extern const char http_html[6];
extern const char http_shtml[7];
extern const char http_htm[5];
extern const char http_css[5];
extern const char http_png[5];
extern const char http_gif[5];
extern const char http_jpg[5];
extern const char http_text[6];
extern const char http_txt[5];

View file

@ -0,0 +1,244 @@
/*
* Copyright (c) 2004, Adam Dunkels.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the Institute nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* This file is part of the Contiki operating system.
*
* Author: Adam Dunkels <adam@sics.se>
*
* $Id: httpd-cfs.c,v 1.2 2010/10/19 18:29:05 adamdunkels Exp $
*/
#include <string.h>
#include "contiki-net.h"
#include "webserver.h"
#include "cfs/cfs.h"
#include "lib/petsciiconv.h"
#include "http-strings.h"
#include "httpd-cfs.h"
#ifndef WEBSERVER_CONF_CFS_CONNS
#define CONNS 4
#else /* WEBSERVER_CONF_CFS_CONNS */
#define CONNS WEBSERVER_CONF_CFS_CONNS
#endif /* WEBSERVER_CONF_CFS_CONNS */
#define STATE_WAITING 0
#define STATE_OUTPUT 1
#define SEND_STRING(s, str) PSOCK_SEND(s, (uint8_t *)str, strlen(str))
MEMB(conns, struct httpd_state, CONNS);
#define ISO_nl 0x0a
#define ISO_space 0x20
#define ISO_period 0x2e
#define ISO_slash 0x2f
/*---------------------------------------------------------------------------*/
static
PT_THREAD(send_file(struct httpd_state *s))
{
PSOCK_BEGIN(&s->sout);
do {
/* Read data from file system into buffer */
s->len = cfs_read(s->fd, s->outputbuf, sizeof(s->outputbuf));
/* If there is data in the buffer, send it */
if(s->len > 0) {
PSOCK_SEND(&s->sout, (uint8_t *)s->outputbuf, s->len);
} else {
break;
}
} while(s->len > 0);
PSOCK_END(&s->sout);
}
/*---------------------------------------------------------------------------*/
static
PT_THREAD(send_headers(struct httpd_state *s, const char *statushdr))
{
char *ptr;
PSOCK_BEGIN(&s->sout);
SEND_STRING(&s->sout, statushdr);
ptr = strrchr(s->filename, ISO_period);
if(ptr == NULL) {
SEND_STRING(&s->sout, http_content_type_plain);
} else if(strncmp(http_html, ptr, 5) == 0) {
SEND_STRING(&s->sout, http_content_type_html);
} else if(strncmp(http_css, ptr, 4) == 0) {
SEND_STRING(&s->sout, http_content_type_css);
} else if(strncmp(http_png, ptr, 4) == 0) {
SEND_STRING(&s->sout, http_content_type_png);
} else if(strncmp(http_jpg, ptr, 4) == 0) {
SEND_STRING(&s->sout, http_content_type_jpg);
} else {
SEND_STRING(&s->sout, http_content_type_binary);
}
PSOCK_END(&s->sout);
}
/*---------------------------------------------------------------------------*/
static
PT_THREAD(handle_output(struct httpd_state *s))
{
PT_BEGIN(&s->outputpt);
petsciiconv_topetscii(s->filename, sizeof(s->filename));
s->fd = cfs_open(s->filename, CFS_READ);
petsciiconv_toascii(s->filename, sizeof(s->filename));
if(s->fd < 0) {
s->fd = cfs_open("notfound.html", CFS_READ);
if(s->fd < 0) {
uip_abort();
memb_free(&conns, s);
webserver_log_file(&uip_conn->ripaddr, "reset (no notfound.html)");
PT_EXIT(&s->outputpt);
}
PT_WAIT_THREAD(&s->outputpt,
send_headers(s, http_header_404));
} else {
PT_WAIT_THREAD(&s->outputpt,
send_headers(s, http_header_200));
}
PT_WAIT_THREAD(&s->outputpt, send_file(s));
cfs_close(s->fd);
s->fd = -1;
PSOCK_CLOSE(&s->sout);
PT_END(&s->outputpt);
}
/*---------------------------------------------------------------------------*/
static
PT_THREAD(handle_input(struct httpd_state *s))
{
PSOCK_BEGIN(&s->sin);
PSOCK_READTO(&s->sin, ISO_space);
if(strncmp(s->inputbuf, http_get, 4) != 0) {
PSOCK_CLOSE_EXIT(&s->sin);
}
PSOCK_READTO(&s->sin, ISO_space);
if(s->inputbuf[0] != ISO_slash) {
PSOCK_CLOSE_EXIT(&s->sin);
}
if(s->inputbuf[1] == ISO_space) {
strncpy(s->filename, &http_index_html[1], sizeof(s->filename));
} else {
s->inputbuf[PSOCK_DATALEN(&s->sin) - 1] = 0;
strncpy(s->filename, &s->inputbuf[1], sizeof(s->filename));
}
petsciiconv_topetscii(s->filename, sizeof(s->filename));
webserver_log_file(&uip_conn->ripaddr, s->filename);
petsciiconv_toascii(s->filename, sizeof(s->filename));
s->state = STATE_OUTPUT;
while(1) {
PSOCK_READTO(&s->sin, ISO_nl);
if(strncmp(s->inputbuf, http_referer, 8) == 0) {
s->inputbuf[PSOCK_DATALEN(&s->sin) - 2] = 0;
petsciiconv_topetscii(s->inputbuf, PSOCK_DATALEN(&s->sin) - 2);
webserver_log(s->inputbuf);
}
}
PSOCK_END(&s->sin);
}
/*---------------------------------------------------------------------------*/
static void
handle_connection(struct httpd_state *s)
{
handle_input(s);
if(s->state == STATE_OUTPUT) {
handle_output(s);
}
}
/*---------------------------------------------------------------------------*/
void
httpd_appcall(void *state)
{
struct httpd_state *s = (struct httpd_state *)state;
if(uip_closed() || uip_aborted() || uip_timedout()) {
if(s != NULL) {
if(s->fd >= 0) {
cfs_close(s->fd);
s->fd = -1;
}
memb_free(&conns, s);
}
} else if(uip_connected()) {
s = (struct httpd_state *)memb_alloc(&conns);
if(s == NULL) {
uip_abort();
webserver_log_file(&uip_conn->ripaddr, "reset (no memory block)");
return;
}
tcp_markconn(uip_conn, s);
PSOCK_INIT(&s->sin, (uint8_t *)s->inputbuf, sizeof(s->inputbuf) - 1);
PSOCK_INIT(&s->sout, (uint8_t *)s->inputbuf, sizeof(s->inputbuf) - 1);
PT_INIT(&s->outputpt);
s->fd = -1;
s->state = STATE_WAITING;
timer_set(&s->timer, CLOCK_SECOND * 10);
handle_connection(s);
} else if(s != NULL) {
if(uip_poll()) {
if(timer_expired(&s->timer)) {
uip_abort();
if(s->fd >= 0) {
cfs_close(s->fd);
s->fd = -1;
}
memb_free(&conns, s);
webserver_log_file(&uip_conn->ripaddr, "reset (timeout)");
}
} else {
timer_reset(&s->timer);
}
handle_connection(s);
} else {
uip_abort();
}
}
/*---------------------------------------------------------------------------*/
void
httpd_init(void)
{
tcp_listen(UIP_HTONS(80));
memb_init(&conns);
}
/*---------------------------------------------------------------------------*/

View file

@ -0,0 +1,56 @@
/*
* Copyright (c) 2001, Adam Dunkels.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote
* products derived from this software without specific prior
* written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This file is part of the uIP TCP/IP stack.
*
* $Id: httpd-cfs.h,v 1.1 2009/03/12 19:15:25 adamdunkels Exp $
*
*/
#ifndef __HTTPD_CFS_H__
#define __HTTPD_CFS_H__
#include "contiki-net.h"
struct httpd_state {
struct timer timer;
struct psock sin, sout;
struct pt outputpt;
char inputbuf[50];
char outputbuf[UIP_TCP_MSS];
char filename[20];
char state;
int fd;
int len;
};
void httpd_init(void);
void httpd_appcall(void *state);
#endif /* __HTTPD_CFS_H__ */

View file

@ -0,0 +1,602 @@
/*
* Copyright (c) 2001, Adam Dunkels.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote
* products derived from this software without specific prior
* written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This file is part of the uIP TCP/IP stack.
*
* $Id: httpd-cgi.c,v 1.13 2010/12/23 19:41:07 dak664 Exp $
*
*/
#include <util/delay.h>
#define delay_us( us ) ( _delay_us( ( us ) ) )
/*
* This file includes functions that are called by the web server
* scripts. The functions takes no argument, and the return value is
* interpreted as follows. A zero means that the function did not
* complete and should be invoked for the next packet as well. A
* non-zero value indicates that the function has completed and that
* the web server should move along to the next script line.
*
*/
#include <stdio.h>
#include <string.h>
#include "contiki-net.h"
#include "httpd.h"
#include "httpd-cgi.h"
#include "httpd-fs.h"
#include "httpd-fsdata.h"
#include "lib/petsciiconv.h"
#include "sensors.h"
#define DEBUGLOGIC 0 //See httpd.c, if 1 must also set it there!
#if DEBUGLOGIC
#define uip_mss(...) 512
#define uip_appdata TCPBUF
extern char TCPBUF[512];
#endif
/* RADIOSTATS must also be set in clock.c and the radio driver */
#if RF230BB
#define RADIOSTATS 1
#endif
static struct httpd_cgi_call *calls = NULL;
/*cgi function names*/
#if HTTPD_FS_STATISTICS
static const char file_name[] HTTPD_STRING_ATTR = "file-stats";
#endif
static const char tcp_name[] HTTPD_STRING_ATTR = "tcp-connections";
static const char proc_name[] HTTPD_STRING_ATTR = "processes";
static const char sensor_name[] HTTPD_STRING_ATTR = "sensors";
static const char adrs_name[] HTTPD_STRING_ATTR = "addresses";
static const char nbrs_name[] HTTPD_STRING_ATTR = "neighbors";
static const char rtes_name[] HTTPD_STRING_ATTR = "routes";
/*Process states for processes cgi*/
static const char closed[] HTTPD_STRING_ATTR = "CLOSED";
static const char syn_rcvd[] HTTPD_STRING_ATTR = "SYN-RCVD";
static const char syn_sent[] HTTPD_STRING_ATTR = "SYN-SENT";
static const char established[] HTTPD_STRING_ATTR = "ESTABLISHED";
static const char fin_wait_1[] HTTPD_STRING_ATTR = "FIN-WAIT-1";
static const char fin_wait_2[] HTTPD_STRING_ATTR = "FIN-WAIT-2";
static const char closing[] HTTPD_STRING_ATTR = "CLOSING";
static const char time_wait[] HTTPD_STRING_ATTR = "TIME-WAIT";
static const char last_ack[] HTTPD_STRING_ATTR = "LAST-ACK";
static const char none[] HTTPD_STRING_ATTR = "NONE";
static const char running[] HTTPD_STRING_ATTR = "RUNNING";
static const char called[] HTTPD_STRING_ATTR = "CALLED";
static const char *states[] = {
closed,
syn_rcvd,
syn_sent,
established,
fin_wait_1,
fin_wait_2,
closing,
time_wait,
last_ack,
none,
running,
called};
static char sensor_temperature[12]="Not Enabled";
static char sensor_extvoltage[12]="Not Enabled";
// static unsigned long last_tempupdate,last_extvoltageupdate;
extern unsigned long seconds, sleepseconds;
#if RADIOSTATS
extern unsigned long radioontime;
static unsigned long savedradioontime;
extern uint8_t RF230_radio_on, rf230_last_rssi;
extern uint16_t RF230_sendpackets,RF230_receivepackets,RF230_sendfail,RF230_receivefail;
#endif
#if 0
void
web_set_temp(char *s)
{
strcpy(sensor_temperature, s);
last_tempupdate=seconds;
}
void
web_set_voltage(char *s)
{
strcpy(sensor_extvoltage, s);
last_extvoltageupdate=seconds;
}
#endif
/*---------------------------------------------------------------------------*/
static
PT_THREAD(nullfunction(struct httpd_state *s, char *ptr))
{
PSOCK_BEGIN(&s->sout);
PSOCK_END(&s->sout);
}
/*---------------------------------------------------------------------------*/
httpd_cgifunction
httpd_cgi(char *name)
{
struct httpd_cgi_call *f;
/* Find the matching name in the table, return the function. */
for(f = calls; f != NULL; f = f->next) {
if(httpd_strncmp(name, f->name, httpd_strlen(f->name)) == 0) {
return f->function;
}
}
return nullfunction;
}
#if HTTPD_FS_STATISTICS
static char *thisfilename;
/*---------------------------------------------------------------------------*/
static unsigned short
generate_file_stats(void *arg)
{
static const char httpd_cgi_filestat1[] HTTPD_STRING_ATTR = "<p class=right><br><br><i>This page has been sent %u times</i></div></body></html>";
static const char httpd_cgi_filestat2[] HTTPD_STRING_ATTR = "<tr><td><a href=\"%s\">%s</a></td><td>%d</td>";
static const char httpd_cgi_filestat3[] HTTPD_STRING_ATTR = "%5u";
char tmp[20];
struct httpd_fsdata_file_noconst *f,fram;
u16_t i;
unsigned short numprinted;
/* Transfer arg from whichever flash that contains the html file to RAM */
httpd_fs_cpy(&tmp, (char *)arg, 20);
/* Count for this page, with common page footer */
if (tmp[0]=='.') {
numprinted=httpd_snprintf((char *)uip_appdata, uip_mss(), httpd_cgi_filestat1, httpd_fs_open(thisfilename, 0));
/* Count for all files */
/* Note buffer will overflow if there are too many files! */
} else if (tmp[0]=='*') {
i=0;numprinted=0;
for(f = (struct httpd_fsdata_file_noconst *)httpd_fs_get_root();
f != NULL;
f = (struct httpd_fsdata_file_noconst *)fram.next) {
/* Get the linked list file entry into RAM from from wherever it is*/
httpd_memcpy(&fram,f,sizeof(fram));
/* Get the file name from whatever memory it is in */
httpd_fs_cpy(&tmp, fram.name, sizeof(tmp));
#if HTTPD_FS_STATISTICS==1
numprinted+=httpd_snprintf((char *)uip_appdata+numprinted, uip_mss()-numprinted, httpd_cgi_filestat2, tmp, tmp, f->count);
#elif HTTPD_FS_STATISTICS==2
numprinted+=httpd_snprintf((char *)uip_appdata+numprinted, uip_mss()-numprinted, httpd_cgi_filestat2, tmp, tmp, httpd_filecount[i]);
#endif
i++;
}
/* Count for specified file */
} else {
numprinted=httpd_snprintf((char *)uip_appdata, uip_mss(), httpd_cgi_filestat3, httpd_fs_open(tmp, 0));
}
#if DEBUGLOGIC
return 0;
#endif
return numprinted;
}
/*---------------------------------------------------------------------------*/
static
PT_THREAD(file_stats(struct httpd_state *s, char *ptr))
{
PSOCK_BEGIN(&s->sout);
thisfilename=&s->filename[0]; //temporary way to pass filename to generate_file_stats
PSOCK_GENERATOR_SEND(&s->sout, generate_file_stats, (void *) ptr);
PSOCK_END(&s->sout);
}
#endif /*HTTPD_FS_STATISTICS*/
/*---------------------------------------------------------------------------*/
static unsigned short
make_tcp_stats(void *arg)
{
static const char httpd_cgi_tcpstat1[] HTTPD_STRING_ATTR = "<tr align=\"center\"><td>%d</td><td>";
static const char httpd_cgi_tcpstat2[] HTTPD_STRING_ATTR = "-%u</td><td>%s</td><td>%u</td><td>%u</td><td>%c %c</td></tr>\r\n";
struct uip_conn *conn;
struct httpd_state *s = (struct httpd_state *)arg;
char tstate[20];
uint16_t numprinted;
conn = &uip_conns[s->u.count];
numprinted = httpd_snprintf((char *)uip_appdata, uip_mss(), httpd_cgi_tcpstat1, uip_htons(conn->lport));
numprinted += httpd_cgi_sprint_ip6(conn->ripaddr, uip_appdata + numprinted);
httpd_strcpy(tstate,states[conn->tcpstateflags & UIP_TS_MASK]);
numprinted += httpd_snprintf((char *)uip_appdata + numprinted, uip_mss() - numprinted,
httpd_cgi_tcpstat2,
uip_htons(conn->rport),
tstate,
conn->nrtx,
conn->timer,
(uip_outstanding(conn))? '*':' ',
(uip_stopped(conn))? '!':' ');
return numprinted;
}
/*---------------------------------------------------------------------------*/
static
PT_THREAD(tcp_stats(struct httpd_state *s, char *ptr))
{
PSOCK_BEGIN(&s->sout);
for(s->u.count = 0; s->u.count < UIP_CONNS; ++s->u.count) {
if((uip_conns[s->u.count].tcpstateflags & UIP_TS_MASK) != UIP_CLOSED) {
PSOCK_GENERATOR_SEND(&s->sout, make_tcp_stats, s);
}
}
PSOCK_END(&s->sout);
}
/*---------------------------------------------------------------------------*/
static unsigned short
make_processes(void *p)
{
static const char httpd_cgi_proc[] HTTPD_STRING_ATTR = "<tr align=\"center\"><td>%p</td><td>%s</td><td>%p</td><td>%s</td></tr>\r\n";
char name[40],tstate[20];
strncpy(name, ((struct process *)p)->name, 40);
petsciiconv_toascii(name, 40);
httpd_strcpy(tstate,states[9 + ((struct process *)p)->state]);
return httpd_snprintf((char *)uip_appdata, uip_mss(), httpd_cgi_proc, p, name,
*(char *)(&(((struct process *)p)->thread)),
tstate);
}
/*---------------------------------------------------------------------------*/
static
PT_THREAD(processes(struct httpd_state *s, char *ptr))
{
PSOCK_BEGIN(&s->sout);
for(s->u.ptr = PROCESS_LIST(); s->u.ptr != NULL; s->u.ptr = ((struct process *)s->u.ptr)->next) {
PSOCK_GENERATOR_SEND(&s->sout, make_processes, s->u.ptr);
}
PSOCK_END(&s->sout);
}
/*---------------------------------------------------------------------------*/
static const char httpd_cgi_addrh[] HTTPD_STRING_ATTR = "<code>";
static const char httpd_cgi_addrf[] HTTPD_STRING_ATTR = "</code>[Room for %u more]";
static const char httpd_cgi_addrb[] HTTPD_STRING_ATTR = "<br>";
static const char httpd_cgi_addrn[] HTTPD_STRING_ATTR = "(none)<br>";
extern uip_ds6_nbr_t uip_ds6_nbr_cache[];
extern uip_ds6_route_t uip_ds6_routing_table[];
extern uip_ds6_netif_t uip_ds6_if;
static unsigned short
make_addresses(void *p)
{
uint8_t i,j=0;
uint16_t numprinted;
numprinted = httpd_snprintf((char *)uip_appdata, uip_mss(),httpd_cgi_addrh);
for (i=0; i<UIP_DS6_ADDR_NB;i++) {
if (uip_ds6_if.addr_list[i].isused) {
j++;
numprinted += httpd_cgi_sprint_ip6(uip_ds6_if.addr_list[i].ipaddr, uip_appdata + numprinted);
numprinted += httpd_snprintf((char *)uip_appdata+numprinted, uip_mss()-numprinted, httpd_cgi_addrb);
}
}
//if (j==0) numprinted += httpd_snprintf((char *)uip_appdata+numprinted, uip_mss()-numprinted, httpd_cgi_addrn);
numprinted += httpd_snprintf((char *)uip_appdata+numprinted, uip_mss()-numprinted, httpd_cgi_addrf, UIP_DS6_ADDR_NB-j);
return numprinted;
}
/*---------------------------------------------------------------------------*/
static
PT_THREAD(addresses(struct httpd_state *s, char *ptr))
{
PSOCK_BEGIN(&s->sout);
PSOCK_GENERATOR_SEND(&s->sout, make_addresses, s->u.ptr);
PSOCK_END(&s->sout);
}
/*---------------------------------------------------------------------------*/
static unsigned short
make_neighbors(void *p)
{
uint8_t i,j=0;
uint16_t numprinted;
numprinted = httpd_snprintf((char *)uip_appdata, uip_mss(),httpd_cgi_addrh);
for (i=0; i<UIP_DS6_NBR_NB;i++) {
if (uip_ds6_nbr_cache[i].isused) {
j++;
numprinted += httpd_cgi_sprint_ip6(uip_ds6_nbr_cache[i].ipaddr, uip_appdata + numprinted);
numprinted += httpd_snprintf((char *)uip_appdata+numprinted, uip_mss()-numprinted, httpd_cgi_addrb);
}
}
//if (j==0) numprinted += httpd_snprintf((char *)uip_appdata+numprinted, uip_mss()-numprinted, httpd_cgi_addrn);
numprinted += httpd_snprintf((char *)uip_appdata+numprinted, uip_mss()-numprinted, httpd_cgi_addrf,UIP_DS6_NBR_NB-j);
return numprinted;
}
/*---------------------------------------------------------------------------*/
static
PT_THREAD(neighbors(struct httpd_state *s, char *ptr))
{
PSOCK_BEGIN(&s->sout);
PSOCK_GENERATOR_SEND(&s->sout, make_neighbors, s->u.ptr);
PSOCK_END(&s->sout);
}
/*---------------------------------------------------------------------------*/
static unsigned short
make_routes(void *p)
{
static const char httpd_cgi_rtes1[] HTTPD_STRING_ATTR = "(%u (via ";
static const char httpd_cgi_rtes2[] HTTPD_STRING_ATTR = ") %lus<br>";
static const char httpd_cgi_rtes3[] HTTPD_STRING_ATTR = ")<br>";
uint8_t i,j=0;
uint16_t numprinted;
numprinted = httpd_snprintf((char *)uip_appdata, uip_mss(),httpd_cgi_addrh);
for (i=0; i<UIP_DS6_ROUTE_NB;i++) {
if (uip_ds6_routing_table[i].isused) {
j++;
numprinted += httpd_cgi_sprint_ip6(uip_ds6_routing_table[i].ipaddr, uip_appdata + numprinted);
numprinted += httpd_snprintf((char *)uip_appdata+numprinted, uip_mss()-numprinted, httpd_cgi_rtes1, uip_ds6_routing_table[i].length);
numprinted += httpd_cgi_sprint_ip6(uip_ds6_routing_table[i].nexthop, uip_appdata + numprinted);
if(uip_ds6_routing_table[i].state.lifetime < 3600) {
numprinted += httpd_snprintf((char *)uip_appdata+numprinted, uip_mss()-numprinted, httpd_cgi_rtes2, uip_ds6_routing_table[i].state.lifetime);
} else {
numprinted += httpd_snprintf((char *)uip_appdata+numprinted, uip_mss()-numprinted, httpd_cgi_rtes3);
}
}
}
if (j==0) numprinted += httpd_snprintf((char *)uip_appdata+numprinted, uip_mss()-numprinted, httpd_cgi_addrn);
numprinted += httpd_snprintf((char *)uip_appdata+numprinted, uip_mss()-numprinted, httpd_cgi_addrf,UIP_DS6_ROUTE_NB-j);
return numprinted;
}
/*---------------------------------------------------------------------------*/
static
PT_THREAD(routes(struct httpd_state *s, char *ptr))
{
PSOCK_BEGIN(&s->sout);
PSOCK_GENERATOR_SEND(&s->sout, make_routes, s->u.ptr);
PSOCK_END(&s->sout);
}
/*---------------------------------------------------------------------------*/
static unsigned short
generate_sensor_readings(void *arg)
{
uint16_t numprinted;
uint16_t h,m,s;
uint8_t p1;
// static const char httpd_cgi_sensor0[] HTTPD_STRING_ATTR = "[Updated %d seconds ago]<br><br>";
// static const char httpd_cgi_sensor1[] HTTPD_STRING_ATTR = "<em>Temperature:</em> %s<br>";
// static const char httpd_cgi_sensor2[] HTTPD_STRING_ATTR = "<em>Battery:</em> %s<br>";
static const char httpd_cgi_sensor1_printf[] HTTPD_STRING_ATTR = "%d.%d C";
static const char httpd_cgi_sensor2_printf[] HTTPD_STRING_ATTR = "%d mv";
static const char httpd_cgi_sensr12[] HTTPD_STRING_ATTR = "<em>Temperature:</em> %s <em>Battery:<em> %s<br>";
static const char httpd_cgi_sensor3[] HTTPD_STRING_ATTR = "<em>Elapsed timer :</em> %02d:%02d:%02d<br>";
static const char httpd_cgi_sensor4[] HTTPD_STRING_ATTR = "<em>Sleeping time :</em> %02d:%02d:%02d (%d%%)<br>";
numprinted=0;
// if (last_tempupdate) {
// numprinted =httpd_snprintf((char *)uip_appdata, uip_mss(), httpd_cgi_sensor0,seconds-last_tempupdate);
// }
BATMON = 16; //give BATMON time to stabilize at highest range and lowest voltage
/* Measure internal temperature sensor, see atmega128rfa1 datasheet */
/* This code disabled by default for safety. Selecting an internal reference will short it to
anything connected to the AREF pin!
*/
#if 1
ADCSRB|=1<<MUX5; //this bit buffered till ADMUX written to!
ADMUX =0xc9; // Select internal 1.6 volt ref, temperature sensor ADC channel
ADCSRA=0x85; //Enable ADC, not free running, interrupt disabled, clock divider 32 (250 KHz@ 8 MHz)
// while ((ADCSRB&(1<<AVDDOK))==0); //wait for AVDD ok
// while ((ADCSRB&(1<<REFOK))==0); //wait for ref ok
ADCSRA|=1<<ADSC; //Start throwaway conversion
while (ADCSRA&(1<<ADSC)); //Wait till done
ADCSRA|=1<<ADSC; //Start another conversion
while (ADCSRA&(1<<ADSC)); //Wait till done
h=ADC; //Read adc
h=11*h-2728+(h>>2); //Convert to celcius*10 (should be 11.3*h, approximate with 11.25*h)
ADCSRA=0; //disable ADC
ADMUX=0; //turn off internal vref
m=h/10;s=h-10*m;
httpd_snprintf(sensor_temperature,sizeof(sensor_temperature),httpd_cgi_sensor1_printf,m,s);
#endif
/* Bandgap can't be measured against supply voltage in this chip. */
/* Use BATMON register instead */
for ( p1=16; p1<31; p1++) {
BATMON = p1;
// delay_us(100); //delay needed?
if ((BATMON&(1<<BATMON_OK))==0) break;
}
h=2550-75*16-75+75*p1; //-75 to take the floor of the 75 mv transition window
httpd_snprintf(sensor_extvoltage,sizeof(sensor_extvoltage),httpd_cgi_sensor2_printf,h);
numprinted+=httpd_snprintf((char *)uip_appdata+numprinted, uip_mss()-numprinted, httpd_cgi_sensr12, sensor_temperature,sensor_extvoltage);
// numprinted+=httpd_snprintf((char *)uip_appdata+numprinted, uip_mss()-numprinted, httpd_cgi_sensor2, sensor_extvoltage);
#if RADIOSTATS
/* Remember radioontime for display below - slow connection might make it report longer than cpu ontime! */
savedradioontime = radioontime;
#endif
h=seconds/3600;
s=seconds-h*3600;
m=s/60;
s=s-m*60;
numprinted+=httpd_snprintf((char *)uip_appdata + numprinted, uip_mss() - numprinted, httpd_cgi_sensor3, h,m,s);
if (sleepseconds) {
p1=100UL*sleepseconds/seconds;
h=sleepseconds/3600;
s=sleepseconds-h*3600;
m=s/60;
s=s-m*60;
numprinted+=httpd_snprintf((char *)uip_appdata + numprinted, uip_mss() - numprinted, httpd_cgi_sensor4, h,m,s,p1);
}
return numprinted;
}
#if RADIOSTATS
/*---------------------------------------------------------------------------*/
static unsigned short
generate_radio_stats(void *arg)
{
uint16_t numprinted;
uint16_t h,m,s;
uint8_t p1,p2;
static const char httpd_cgi_sensor10[] HTTPD_STRING_ATTR = "<em>Radio on time :</em> %02d:%02d:%02d (%d.%02d%%)<br>";
static const char httpd_cgi_sensor11[] HTTPD_STRING_ATTR = "<em>Packets:</em> Tx=%5d Rx=%5d TxL=%5d RxL=%5d RSSI=%2ddBm\n";
s=(10000UL*savedradioontime)/seconds;
p1=s/100;
p2=s-p1*100;
h=savedradioontime/3600;
s=savedradioontime-h*3600;
m=s/60;
s=s-m*60;
numprinted =httpd_snprintf((char *)uip_appdata , uip_mss() , httpd_cgi_sensor10,\
h,m,s,p1,p2);
#if RF230BB
numprinted+=httpd_snprintf((char *)uip_appdata + numprinted, uip_mss() - numprinted, httpd_cgi_sensor11,\
RF230_sendpackets,RF230_receivepackets,RF230_sendfail,RF230_receivefail,-92+rf230_last_rssi);
#else
p1=0;
radio_get_rssi_value(&p1);
p1 = -91*3(p1-1);
numprinted+=httpd_snprintf((char *)uip_appdata + numprinted, uip_mss() - numprinted, httpd_cgi_sensor11,\
RF230_sendpackets,RF230_receivepackets,RF230_sendfail,RF230_receivefail,p1);
#endif
return numprinted;
}
#endif
/*---------------------------------------------------------------------------*/
static
PT_THREAD(sensor_readings(struct httpd_state *s, char *ptr))
{
PSOCK_BEGIN(&s->sout);
PSOCK_GENERATOR_SEND(&s->sout, generate_sensor_readings, s);
#if RADIOSTATS
PSOCK_GENERATOR_SEND(&s->sout, generate_radio_stats, s);
#endif
PSOCK_END(&s->sout);
}
/*---------------------------------------------------------------------------*/
void
httpd_cgi_add(struct httpd_cgi_call *c)
{
struct httpd_cgi_call *l;
c->next = NULL;
if(calls == NULL) {
calls = c;
} else {
for(l = calls; l->next != NULL; l = l->next);
l->next = c;
}
}
/*---------------------------------------------------------------------------*/
#if HTTPD_FS_STATISTICS
HTTPD_CGI_CALL( file, file_name, file_stats);
#endif
HTTPD_CGI_CALL( tcp, tcp_name, tcp_stats );
HTTPD_CGI_CALL( proc, proc_name, processes );
HTTPD_CGI_CALL( adrs, adrs_name, addresses );
HTTPD_CGI_CALL( nbrs, nbrs_name, neighbors );
HTTPD_CGI_CALL( rtes, rtes_name, routes );
HTTPD_CGI_CALL(sensors, sensor_name, sensor_readings);
void
httpd_cgi_init(void)
{
#if HTTPD_FS_STATISTICS
httpd_cgi_add( &file);
#endif
httpd_cgi_add( &tcp);
httpd_cgi_add( &proc);
httpd_cgi_add( &adrs);
httpd_cgi_add( &nbrs);
httpd_cgi_add( &rtes);
httpd_cgi_add(&sensors);
}
/*---------------------------------------------------------------------------*/
uint8_t httpd_cgi_sprint_ip6(uip_ip6addr_t addr, char * result)
{
unsigned char zerocnt = 0;
unsigned char numprinted = 0;
char * starting = result;
unsigned char i = 0;
while (numprinted < 8)
{
//Address is zero, have we used our ability to
//replace a bunch with : yet?
if ((addr.u16[i] == 0) && (zerocnt == 0))
{
//How mant zeros?
zerocnt = 0;
while(addr.u16[zerocnt + i] == 0)
zerocnt++;
//just one, don't waste our zeros...
if (zerocnt == 1)
{
*result++ = '0';
numprinted++;
break;
}
//Cool - can replace a bunch of zeros
i += zerocnt;
numprinted += zerocnt;
}
//Normal address, just print it
else
{
result += sprintf(result, "%x", (unsigned int)(uip_ntohs(addr.u16[i])));
i++;
numprinted++;
}
//Don't print : on last one
if (numprinted != 8)
*result++ = ':';
}
return (result - starting);
}

View file

@ -0,0 +1,61 @@
/*
* Copyright (c) 2001, Adam Dunkels.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote
* products derived from this software without specific prior
* written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This file is part of the uIP TCP/IP stack.
*
* $Id: httpd-cgi.h,v 1.3 2010/02/12 16:42:59 dak664 Exp $
*
*/
#ifndef __HTTPD_CGI_H__
#define __HTTPD_CGI_H__
#include "contiki.h"
#include "httpd.h"
typedef PT_THREAD((* httpd_cgifunction)(struct httpd_state *, char *));
httpd_cgifunction httpd_cgi(char *name);
struct httpd_cgi_call {
struct httpd_cgi_call *next;
const char *name;
httpd_cgifunction function;
};
void httpd_cgi_add(struct httpd_cgi_call *c);
#define HTTPD_CGI_CALL(name, str, function) \
static struct httpd_cgi_call name = {NULL, str, function}
void httpd_cgi_init(void);
void web_set_temp(char *s);
void web_set_voltage(char *s);
uint8_t httpd_cgi_sprint_ip6(uip_ip6addr_t addr, char * result);
#endif /* __HTTPD_CGI_H__ */

View file

@ -0,0 +1,137 @@
/*
* Copyright (c) 2001, Swedish Institute of Computer Science.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the Institute nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* This file is part of the lwIP TCP/IP stack.
*
* Author: Adam Dunkels <adam@sics.se>
*
* $Id: httpd-fs.c,v 1.4 2009/07/24 15:41:52 dak664 Exp $
*/
#include "contiki-net.h"
#include "httpd.h"
#include "httpd-fs.h"
#include "httpd-fsdata.h"
#include "httpd-fsdata.c"
#if HTTPD_FS_STATISTICS==2
u16_t httpd_filecount[HTTPD_FS_NUMFILES];
#endif /* HTTPD_FS_STATISTICS */
/*-----------------------------------------------------------------------------------*/
void *
httpd_fs_get_root()
{
return (void *)HTTPD_FS_ROOT;
}
/*-----------------------------------------------------------------------------------*/
u16_t
httpd_fs_get_size()
{
return HTTPD_FS_SIZE;
}
/*-----------------------------------------------------------------------------------*/
u16_t
httpd_fs_open(const char *name, struct httpd_fs_file *file)
{
#if HTTPD_FS_STATISTICS
u16_t i = 0;
#endif /* HTTPD_FS_STATISTICS */
struct httpd_fsdata_file_noconst *f,fram;
for(f = (struct httpd_fsdata_file_noconst *)HTTPD_FS_ROOT;
f != NULL;
f = (struct httpd_fsdata_file_noconst *)fram.next) {
/*Get the linked list entry into ram from wherever it is */
httpd_memcpy(&fram,f,sizeof(fram));
/*Compare name passed in RAM with name in whatever flash the file is in */
if(httpd_fs_strcmp((char *)name, fram.name) == 0) {
if (file) {
file->data = fram.data;
file->len = fram.len;
#if HTTPD_FS_STATISTICS==1 //increment count in linked list field if it is in RAM
f->count++;
}
return f->count;
}
++i
#elif HTTPD_FS_STATISTICS==2 //increment count in RAM array when linked list is in flash
++httpd_filecount[i];
}
return httpd_filecount[i];
}
++i;
#else //no file statistics
}
return 1;
}
#endif /*HTTPD_FS_STATISTICS*/
}
return 0;
}
/*-----------------------------------------------------------------------------------*/
void
httpd_fs_init(void)
{
#if HTTPD_FS_STATISTICS && 0 //count will already be zero at boot
u16_t i;
for(i = 0; i < HTTPD_FS_NUMFILES; i++) {
count[i] = 0;
}
#endif /* HTTPD_FS_STATISTICS */
}
/*-----------------------------------------------------------------------------------*/
#if HTTPD_FS_STATISTICS && 0 //Not needed, httpd_fs_open returns count
u16_t
httpd_fs_count(char *name)
{
struct httpd_fsdata_file_noconst *f,fram;
u16_t i;
i = 0;
for(f = (struct httpd_fsdata_file_noconst *)HTTPD_FS_ROOT;
f != NULL;
f = (struct httpd_fsdata_file_noconst *)fram.next) {
httpd_memcpy(&fram,f,sizeof(fram));
if(httpd_strcmp(name, fram.name) == 0) {
#if HTTPD_FS_STATISTICS==1
return f->count;
#elif HTTPD_FS_STATISTICS==2
return count[i];
#endif
}
++i;
}
return 0;
}
#endif /* HTTPD_FS_STATISTICS */
/*-----------------------------------------------------------------------------------*/

View file

@ -0,0 +1,87 @@
/*
* Copyright (c) 2001, Swedish Institute of Computer Science.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the Institute nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* This file is part of the lwIP TCP/IP stack.
*
* Author: Adam Dunkels <adam@sics.se>
*
* $Id: httpd-fs.h,v 1.3 2009/07/23 16:16:07 dak664 Exp $
*/
#ifndef __HTTPD_FS_H__
#define __HTTPD_FS_H__
#include "contiki-net.h"
//#define HTTPD_FS_STATISTICS 1 //Puts count in file system
#define HTTPD_FS_STATISTICS 2 //Puts count in RAM array
#if HTTPD_FS_STATISTICS==2
extern u16_t httpd_filecount[];
#endif /* HTTPD_FS_STATISTICS */
#include <avr/pgmspace.h>
#if COFFEE_FILES
#include "cfs-coffee-arch.h"
#include <string.h>
#endif
struct httpd_fs_file {
char *data;
int len;
};
/* Initialize the file system and set statistics to zero */
void httpd_fs_init(void);
/* Returns root of http files in program flash */
void* httpd_fs_get_root();
/* Returns size of http files in any flash */
u16_t httpd_fs_get_size();
/* Open a file in any flash and return statistics if enabled.
If file is allocated by caller it will be filled in.
If NULL, just file stats are returned.
*/
u16_t httpd_fs_open(const char *name, struct httpd_fs_file *file);
#if COFFEE_FILES
/* Coffee file system can be static or dynamic. If static, new files
can not be created and rewrites of an existing file can not be
made beyond the initial allocation.
*/
#define httpd_fs_cpy avr_httpd_fs_cpy
#define httpd_fs_getchar avr_httpd_fs_getchar
#define httpd_fs_strcmp avr_httpd_fs_strcmp
#define httpd_fs_strchr avr_httpd_fs_strchr
#else
/* These will fail if the web content is above 64K in program flash */
#define httpd_fs_cpy memcpy_P
#define httpd_fs_strcmp strcmp_P
#define httpd_fs_strchr strchr_P
#define httpd_fs_getchar(x) pgm_read_byte(x)
#endif
#endif /* __HTTPD_FS_H__ */

View file

@ -0,0 +1 @@
<html><body bgcolor="white"><center><h1>404 - file not found</h1><h3>Go <a href="/">here</a> instead.</h3></center></body></html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 353 B

View file

@ -0,0 +1,5 @@
%!: /header.html
<h1>File statistics</h1><br><table width="100%"><tr align="left"><th>Name</th><th>Accesses</th></tr>
%! file-stats *
</table>
%!: /footer.html

View file

@ -0,0 +1 @@
</div></body></html>

View file

@ -0,0 +1,6 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><head><title>Welcome to the Contiki-demo server!</title>
<link rel="stylesheet" type="text/css" href="/style.css"><link rel="icon" href="favicon.png" type="image/png">
</head><body bgcolor="#fffeec" text="black">
<div class="menublock"><div class="menu"><p class="border-title">Menu</p><p class="menu"><a href="/">Front page</a><br><a href="status.shtml">Status</a><br><a href="files.shtml">File statistics</a><br><a href="tcp.shtml">Network connections</a><br><a href="processes.shtml">System processes</a><br><a href="sensor.shtml">Sensor Readings</a></p></div></div>
<div class="contentblock"><p class="border-title">Welcome to the <a href="http://www.sics.se/contiki/">Contiki</a> web server!</p>

View file

@ -0,0 +1,3 @@
%!: /header.html
<p class="intro">These pages are from a webserver running under the <a href="http://www.sics.se/contiki/">Contiki operating system</a>.
%! file-stats .

View file

@ -0,0 +1,7 @@
#include <avr/eeprom.h>
/* Link layer ipv6 address will become fe80::11:22ff:fe33:4455 */
uint8_t mac_address[8] EEMEM = {0x02, 0x11, 0x22, 0xff, 0xfe, 0x33, 0x44, 0x55};
uint8_t server_name[16] EEMEM = "Contiki-Raven";
uint8_t domain_name[30] EEMEM = "localhost";

View file

@ -0,0 +1,5 @@
%!: /header.html
<h1>System processes</h1><br><table width="100%"><tr><th>ID</th><th>Name</th><th>Thread</th><th>Process state</th></tr>
%! processes
</table>
%! file-stats .

View file

@ -0,0 +1,2 @@
user-agent: *
Disallow: /

View file

@ -0,0 +1,4 @@
%!: /header.html
<h1>Sensor Readings</h1><br>
%! sensors
%! file-stats .

View file

@ -0,0 +1,11 @@
%!: /header.html
<h4>Addresses</h4>
%! addresses
<h4>Neighbors</h4>
%! neighbors
<h4>Routes</h4>
%! routes
<h4>Sensors</h4>
%! sensors
</table>
%! file-stats .

View file

@ -0,0 +1,22 @@
h1{text-align:center;font-size:14pt;font-family:arial,helvetica;font-weight:bold;padding:10px;}
body{background-color:#fffeec;color:black;font-size:8pt;font-family:arial,helvetica;}
.wrap{width:98%;margin:0 auto;text-align:left;font-family:arial,helvetica;}
.menublock{margin:4px;width:15%;float:left;padding:10px;border:solid 1px;background-color:#fffcd2;text-align:left;font-size:9pt;font-family:arial,helvetica;}
.contentblock{margin:4px;width:50%;float:left;padding:10px;border:1px dotted;background-color:white;font-size:8pt;font-family:arial,helvetica;}
.newsblock{margin:4px;width:24%;float:left;padding:10px;border:solid 1px;background-color:#fffcd2;text-align:left;font-size:8pt;font-family:arial,helvetica;}
.printable{margin:4px;width:24%;float:left;padding:10px;border:0;background-color:#fffeec;text-align:right;font-size:8pt;font-family:arial,helvetica;}
div.rfig{border:solid 1px; text-align:left;padding:10px;margin:10px;font-size:8pt;float:right;}
pre.example{border:solid 1px; padding:10px;margin:10px;text-align:left;font-size:8pt;font-family:arial,helvetica;white-space:pre;}
p.intro{margin-left:20px;margin-right:20px;font-size:10pt;font-family:arial,helvetica;}
p.clink{font-size:12pt;font-family:courier,monospace; text-align:center;}
p.clink9{font-size:9pt;font-family:courier,monospace;text-align:center;}
p.related{font-size:10pt;font-family:arial,helvetica;text-align:center;}
img.right{float:right;margin:10px;}
img.left{float:left;margin:10px;}
p.fig{border:solid 1px;text-align:center;padding:10px;margin:10px;font-size:7pt;}
p.rfig{border:solid 1px;text-align:center;padding:10px;margin:10px;font-size:7pt;float:right;}
p.lfig{border:solid 1px;text-align:center;padding:10px;margin:10px;font-size:7pt;float:left;}
p{padding-left:10px;}
p.mailaddr{padding-left:10px;font-size:7pt;font-family:courier,terminal;text-align:right;}
p.right{text-align:right;}
p.border-title{text-align:center;font-size:14pt;padding:0px;margin:4px;margin-bottom:10px;color:black;background-color:#fffcba;border:solid 1px;}

View file

@ -0,0 +1,5 @@
%!: /header.html
<h1>Current connections</h1><br><table width="100%"><tr><th>Local</th><th>Remote</th><th>State</th><th>Retransmissions</th><th>Timer</th><th>Flags</th></tr>
%! tcp-connections
</table>
%! file-stats .

View file

@ -0,0 +1 @@
<html><body><form action="upload.html" enctype="multipart/form-data" method="post"><input name="userfile" type="file" size="50" /><input value="Upload" type="submit" /></form></body></html>

View file

@ -0,0 +1,643 @@
/*********Generated by contiki/tools/makefsdata on 2011-02-06*********/
#include <avr/eeprom.h>
/* Link layer ipv6 address will become fe80::2 */
uint8_t mac_address[8] EEMEM = {0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02};
uint8_t server_name[16] EEMEM = "huginn";
uint8_t domain_name[30] EEMEM = "localhost";
const char data_404_html[140] PROGMEM = {
/* /404.html */
0x2f, 0x34, 0x30, 0x34, 0x2e, 0x68, 0x74, 0x6d, 0x6c, 0x00,
0x3c, 0x68, 0x74, 0x6d, 0x6c, 0x3e, 0x3c, 0x62, 0x6f, 0x64,
0x79, 0x20, 0x62, 0x67, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x3d,
0x22, 0x77, 0x68, 0x69, 0x74, 0x65, 0x22, 0x3e, 0x3c, 0x63,
0x65, 0x6e, 0x74, 0x65, 0x72, 0x3e, 0x3c, 0x68, 0x31, 0x3e,
0x34, 0x30, 0x34, 0x20, 0x2d, 0x20, 0x66, 0x69, 0x6c, 0x65,
0x20, 0x6e, 0x6f, 0x74, 0x20, 0x66, 0x6f, 0x75, 0x6e, 0x64,
0x3c, 0x2f, 0x68, 0x31, 0x3e, 0x3c, 0x68, 0x33, 0x3e, 0x47,
0x6f, 0x20, 0x3c, 0x61, 0x20, 0x68, 0x72, 0x65, 0x66, 0x3d,
0x22, 0x2f, 0x22, 0x3e, 0x68, 0x65, 0x72, 0x65, 0x3c, 0x2f,
0x61, 0x3e, 0x20, 0x69, 0x6e, 0x73, 0x74, 0x65, 0x61, 0x64,
0x2e, 0x3c, 0x2f, 0x68, 0x33, 0x3e, 0x3c, 0x2f, 0x63, 0x65,
0x6e, 0x74, 0x65, 0x72, 0x3e, 0x3c, 0x2f, 0x62, 0x6f, 0x64,
0x79, 0x3e, 0x3c, 0x2f, 0x68, 0x74, 0x6d, 0x6c, 0x3e, 0x00};
const char data_favicon_png[367] PROGMEM = {
/* /favicon.png */
0x2f, 0x66, 0x61, 0x76, 0x69, 0x63, 0x6f, 0x6e, 0x2e, 0x70, 0x6e, 0x67, 0x00,
0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00,
0x00, 0x0d, 0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x10,
0x00, 0x00, 0x00, 0x10, 0x08, 0x06, 0x00, 0x00, 0x00, 0x1f,
0xf3, 0xff, 0x61, 0x00, 0x00, 0x01, 0x28, 0x49, 0x44, 0x41,
0x54, 0x78, 0xda, 0x63, 0xf8, 0x4f, 0x21, 0x60, 0x18, 0x7a,
0x06, 0xbc, 0xff, 0xfc, 0xfe, 0xff, 0xb1, 0xc3, 0x7b, 0xff,
0x6f, 0xdd, 0xb6, 0xf5, 0xff, 0xf3, 0xc7, 0xf7, 0x70, 0x18,
0xf0, 0x1b, 0x53, 0x68, 0xce, 0xbc, 0x39, 0xff, 0xa3, 0x12,
0x93, 0xff, 0x7b, 0x05, 0x06, 0xfd, 0xf7, 0xf2, 0x75, 0xfa,
0x5f, 0x5c, 0x99, 0xfd, 0x7f, 0xef, 0xbe, 0xbd, 0xd8, 0x0d,
0xf8, 0xfe, 0xfd, 0xfb, 0xff, 0x96, 0xb6, 0x9e, 0xff, 0xd7,
0x6e, 0xdf, 0x03, 0x1b, 0xd6, 0xd2, 0xd5, 0xf3, 0xdf, 0xd0,
0xc6, 0xf2, 0xbf, 0x93, 0xab, 0xd3, 0xff, 0xa8, 0xd8, 0xa0,
0xff, 0xc5, 0xa5, 0xd9, 0xff, 0xcf, 0x9d, 0x3e, 0x06, 0x96,
0xc3, 0xe9, 0x85, 0xec, 0xc2, 0x62, 0xa0, 0x6d, 0x51, 0xff,
0xbd, 0x42, 0xa3, 0xfe, 0x6b, 0x1a, 0x68, 0x82, 0x6d, 0xcd,
0xce, 0x4d, 0xfe, 0xbf, 0x76, 0xd5, 0x52, 0x14, 0x17, 0x62,
0x18, 0x70, 0xef, 0xfe, 0xf3, 0xff, 0x4b, 0x57, 0xad, 0x05,
0x3b, 0x57, 0x51, 0x43, 0x13, 0x8c, 0x2d, 0x81, 0xb6, 0x67,
0x17, 0x02, 0x9d, 0xbc, 0x6b, 0x2b, 0xfe, 0x40, 0x04, 0x05,
0x8c, 0x93, 0xa7, 0x17, 0xd8, 0xb9, 0x86, 0x26, 0x86, 0x40,
0x8d, 0x4e, 0x40, 0xdb, 0x0d, 0xff, 0x27, 0x67, 0x66, 0xff,
0xff, 0xfe, 0xf9, 0x3b, 0xfe, 0x58, 0x80, 0x6b, 0xb6, 0x00,
0xfa, 0xd5, 0x17, 0xe4, 0xd7, 0xa8, 0xff, 0x53, 0x66, 0x4d,
0x01, 0x7b, 0x45, 0x51, 0x47, 0xf3, 0x7f, 0x4b, 0x53, 0xcb,
0xff, 0xe7, 0xcf, 0x9f, 0x63, 0x37, 0x60, 0xe9, 0xb2, 0xa5,
0x40, 0xff, 0x7a, 0x01, 0xfd, 0xe9, 0xf5, 0x3f, 0x39, 0x35,
0xf9, 0x7f, 0x4f, 0x1f, 0x30, 0x00, 0xaf, 0x5f, 0x03, 0x2b,
0x68, 0xe9, 0x6a, 0x81, 0xba, 0xc6, 0xf2, 0x7f, 0x0f, 0x30,
0x30, 0xb1, 0x1a, 0x00, 0xf2, 0xdb, 0x94, 0x49, 0x3d, 0xff,
0xb7, 0x02, 0x69, 0x74, 0xa7, 0x2e, 0x5d, 0x36, 0x07, 0x1c,
0xea, 0xc9, 0x99, 0xc9, 0xc0, 0xf8, 0x3f, 0x46, 0x5e, 0x42,
0xfa, 0x0e, 0x4c, 0x3c, 0xd8, 0x9c, 0x3f, 0x44, 0xf3, 0x02,
0x3a, 0x00, 0x00, 0x23, 0x68, 0x91, 0xf2, 0x33, 0xf4, 0xe6,
0x2c, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae,
0x42, 0x60, 0x82, 0x00};
const char data_files_shtml[179] PROGMEM = {
/* /files.shtml */
0x2f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x2e, 0x73, 0x68, 0x74, 0x6d, 0x6c, 0x00,
0x25, 0x21, 0x3a, 0x20, 0x2f, 0x68, 0x65, 0x61, 0x64, 0x65,
0x72, 0x2e, 0x68, 0x74, 0x6d, 0x6c, 0x0d, 0x0a, 0x3c, 0x68,
0x31, 0x3e, 0x46, 0x69, 0x6c, 0x65, 0x20, 0x73, 0x74, 0x61,
0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, 0x3c, 0x2f, 0x68,
0x31, 0x3e, 0x3c, 0x62, 0x72, 0x3e, 0x3c, 0x74, 0x61, 0x62,
0x6c, 0x65, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22,
0x31, 0x30, 0x30, 0x25, 0x22, 0x3e, 0x3c, 0x74, 0x72, 0x20,
0x61, 0x6c, 0x69, 0x67, 0x6e, 0x3d, 0x22, 0x6c, 0x65, 0x66,
0x74, 0x22, 0x3e, 0x3c, 0x74, 0x68, 0x3e, 0x4e, 0x61, 0x6d,
0x65, 0x3c, 0x2f, 0x74, 0x68, 0x3e, 0x3c, 0x74, 0x68, 0x3e,
0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x65, 0x73, 0x3c, 0x2f,
0x74, 0x68, 0x3e, 0x3c, 0x2f, 0x74, 0x72, 0x3e, 0x0d, 0x0a,
0x25, 0x21, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x2d, 0x73, 0x74,
0x61, 0x74, 0x73, 0x20, 0x2a, 0x0d, 0x0a, 0x3c, 0x2f, 0x74,
0x61, 0x62, 0x6c, 0x65, 0x3e, 0x0d, 0x0a, 0x25, 0x21, 0x3a,
0x20, 0x2f, 0x66, 0x6f, 0x6f, 0x74, 0x65, 0x72, 0x2e, 0x68,
0x74, 0x6d, 0x6c, 0x0d, 0x0a, 0x00};
const char data_footer_html[34] PROGMEM = {
/* /footer.html */
0x2f, 0x66, 0x6f, 0x6f, 0x74, 0x65, 0x72, 0x2e, 0x68, 0x74, 0x6d, 0x6c, 0x00,
0x3c, 0x2f, 0x64, 0x69, 0x76, 0x3e, 0x3c, 0x2f, 0x62, 0x6f,
0x64, 0x79, 0x3e, 0x3c, 0x2f, 0x68, 0x74, 0x6d, 0x6c, 0x3e,
0x00};
const char data_header_html[809] PROGMEM = {
/* /header.html */
0x2f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x2e, 0x68, 0x74, 0x6d, 0x6c, 0x00,
0x3c, 0x21, 0x44, 0x4f, 0x43, 0x54, 0x59, 0x50, 0x45, 0x20,
0x48, 0x54, 0x4d, 0x4c, 0x20, 0x50, 0x55, 0x42, 0x4c, 0x49,
0x43, 0x20, 0x22, 0x2d, 0x2f, 0x2f, 0x57, 0x33, 0x43, 0x2f,
0x2f, 0x44, 0x54, 0x44, 0x20, 0x48, 0x54, 0x4d, 0x4c, 0x20,
0x34, 0x2e, 0x30, 0x31, 0x20, 0x54, 0x72, 0x61, 0x6e, 0x73,
0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x2f, 0x2f, 0x45,
0x4e, 0x22, 0x20, 0x22, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f,
0x2f, 0x77, 0x77, 0x77, 0x2e, 0x77, 0x33, 0x2e, 0x6f, 0x72,
0x67, 0x2f, 0x54, 0x52, 0x2f, 0x68, 0x74, 0x6d, 0x6c, 0x34,
0x2f, 0x6c, 0x6f, 0x6f, 0x73, 0x65, 0x2e, 0x64, 0x74, 0x64,
0x22, 0x3e, 0x0d, 0x0a, 0x3c, 0x68, 0x74, 0x6d, 0x6c, 0x3e,
0x3c, 0x68, 0x65, 0x61, 0x64, 0x3e, 0x3c, 0x74, 0x69, 0x74,
0x6c, 0x65, 0x3e, 0x48, 0x75, 0x67, 0x69, 0x6e, 0x6e, 0x3c,
0x2f, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x3e, 0x0d, 0x0a, 0x3c,
0x6c, 0x69, 0x6e, 0x6b, 0x20, 0x72, 0x65, 0x6c, 0x3d, 0x22,
0x73, 0x74, 0x79, 0x6c, 0x65, 0x73, 0x68, 0x65, 0x65, 0x74,
0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x74, 0x65,
0x78, 0x74, 0x2f, 0x63, 0x73, 0x73, 0x22, 0x20, 0x68, 0x72,
0x65, 0x66, 0x3d, 0x22, 0x2f, 0x73, 0x74, 0x79, 0x6c, 0x65,
0x2e, 0x63, 0x73, 0x73, 0x22, 0x3e, 0x3c, 0x6c, 0x69, 0x6e,
0x6b, 0x20, 0x72, 0x65, 0x6c, 0x3d, 0x22, 0x69, 0x63, 0x6f,
0x6e, 0x22, 0x20, 0x68, 0x72, 0x65, 0x66, 0x3d, 0x22, 0x66,
0x61, 0x76, 0x69, 0x63, 0x6f, 0x6e, 0x2e, 0x70, 0x6e, 0x67,
0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x69, 0x6d,
0x61, 0x67, 0x65, 0x2f, 0x70, 0x6e, 0x67, 0x22, 0x3e, 0x0d,
0x0a, 0x3c, 0x2f, 0x68, 0x65, 0x61, 0x64, 0x3e, 0x3c, 0x62,
0x6f, 0x64, 0x79, 0x20, 0x62, 0x67, 0x63, 0x6f, 0x6c, 0x6f,
0x72, 0x3d, 0x22, 0x23, 0x66, 0x66, 0x66, 0x65, 0x65, 0x63,
0x22, 0x20, 0x74, 0x65, 0x78, 0x74, 0x3d, 0x22, 0x62, 0x6c,
0x61, 0x63, 0x6b, 0x22, 0x3e, 0x0d, 0x0a, 0x3c, 0x64, 0x69,
0x76, 0x20, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x3d, 0x22, 0x6d,
0x65, 0x6e, 0x75, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x22, 0x3e,
0x3c, 0x64, 0x69, 0x76, 0x20, 0x63, 0x6c, 0x61, 0x73, 0x73,
0x3d, 0x22, 0x6d, 0x65, 0x6e, 0x75, 0x22, 0x3e, 0x3c, 0x70,
0x20, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x3d, 0x22, 0x62, 0x6f,
0x72, 0x64, 0x65, 0x72, 0x2d, 0x74, 0x69, 0x74, 0x6c, 0x65,
0x22, 0x3e, 0x4d, 0x65, 0x6e, 0x75, 0x3c, 0x2f, 0x70, 0x3e,
0x3c, 0x70, 0x20, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x3d, 0x22,
0x6d, 0x65, 0x6e, 0x75, 0x22, 0x3e, 0x3c, 0x61, 0x20, 0x68,
0x72, 0x65, 0x66, 0x3d, 0x22, 0x2f, 0x22, 0x3e, 0x46, 0x72,
0x6f, 0x6e, 0x74, 0x20, 0x70, 0x61, 0x67, 0x65, 0x3c, 0x2f,
0x61, 0x3e, 0x3c, 0x62, 0x72, 0x3e, 0x3c, 0x61, 0x20, 0x68,
0x72, 0x65, 0x66, 0x3d, 0x22, 0x73, 0x74, 0x61, 0x74, 0x75,
0x73, 0x2e, 0x73, 0x68, 0x74, 0x6d, 0x6c, 0x22, 0x3e, 0x53,
0x74, 0x61, 0x74, 0x75, 0x73, 0x3c, 0x2f, 0x61, 0x3e, 0x3c,
0x62, 0x72, 0x3e, 0x3c, 0x61, 0x20, 0x68, 0x72, 0x65, 0x66,
0x3d, 0x22, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x2e, 0x73, 0x68,
0x74, 0x6d, 0x6c, 0x22, 0x3e, 0x46, 0x69, 0x6c, 0x65, 0x20,
0x73, 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x73,
0x3c, 0x2f, 0x61, 0x3e, 0x3c, 0x62, 0x72, 0x3e, 0x3c, 0x61,
0x20, 0x68, 0x72, 0x65, 0x66, 0x3d, 0x22, 0x74, 0x63, 0x70,
0x2e, 0x73, 0x68, 0x74, 0x6d, 0x6c, 0x22, 0x3e, 0x4e, 0x65,
0x74, 0x77, 0x6f, 0x72, 0x6b, 0x20, 0x63, 0x6f, 0x6e, 0x6e,
0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x3c, 0x2f, 0x61,
0x3e, 0x3c, 0x62, 0x72, 0x3e, 0x3c, 0x61, 0x20, 0x68, 0x72,
0x65, 0x66, 0x3d, 0x22, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73,
0x73, 0x2e, 0x73, 0x68, 0x74, 0x6d, 0x6c, 0x22, 0x3e, 0x53,
0x79, 0x73, 0x74, 0x65, 0x6d, 0x20, 0x70, 0x72, 0x6f, 0x63,
0x65, 0x73, 0x73, 0x65, 0x73, 0x3c, 0x2f, 0x61, 0x3e, 0x3c,
0x62, 0x72, 0x3e, 0x3c, 0x61, 0x20, 0x68, 0x72, 0x65, 0x66,
0x3d, 0x22, 0x73, 0x65, 0x6e, 0x73, 0x6f, 0x72, 0x2e, 0x73,
0x68, 0x74, 0x6d, 0x6c, 0x22, 0x3e, 0x53, 0x65, 0x6e, 0x73,
0x6f, 0x72, 0x20, 0x52, 0x65, 0x61, 0x64, 0x69, 0x6e, 0x67,
0x73, 0x3c, 0x2f, 0x61, 0x3e, 0x3c, 0x2f, 0x70, 0x3e, 0x3c,
0x2f, 0x64, 0x69, 0x76, 0x3e, 0x3c, 0x2f, 0x64, 0x69, 0x76,
0x3e, 0x0d, 0x0a, 0x3c, 0x64, 0x69, 0x76, 0x20, 0x63, 0x6c,
0x61, 0x73, 0x73, 0x3d, 0x22, 0x63, 0x6f, 0x6e, 0x74, 0x65,
0x6e, 0x74, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x22, 0x3e, 0x3c,
0x70, 0x20, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x3d, 0x22, 0x62,
0x6f, 0x72, 0x64, 0x65, 0x72, 0x2d, 0x74, 0x69, 0x74, 0x6c,
0x65, 0x22, 0x3e, 0x57, 0x65, 0x6c, 0x63, 0x6f, 0x6d, 0x65,
0x20, 0x74, 0x6f, 0x20, 0x74, 0x68, 0x65, 0x20, 0x3c, 0x61,
0x20, 0x68, 0x72, 0x65, 0x66, 0x3d, 0x22, 0x68, 0x74, 0x74,
0x70, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x73, 0x69,
0x63, 0x73, 0x2e, 0x73, 0x65, 0x2f, 0x63, 0x6f, 0x6e, 0x74,
0x69, 0x6b, 0x69, 0x2f, 0x22, 0x3e, 0x43, 0x6f, 0x6e, 0x74,
0x69, 0x6b, 0x69, 0x3c, 0x2f, 0x61, 0x3e, 0x20, 0x77, 0x65,
0x62, 0x20, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x6f,
0x6e, 0x20, 0x48, 0x75, 0x67, 0x69, 0x6e, 0x6e, 0x21, 0x3c,
0x2f, 0x70, 0x3e, 0x0d, 0x0a, 0x00};
const char data_index_html[1053] PROGMEM = {
/* /index.html */
0x2f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x2e, 0x68, 0x74, 0x6d, 0x6c, 0x00,
0x25, 0x21, 0x3a, 0x2f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72,
0x2e, 0x68, 0x74, 0x6d, 0x6c, 0x0d, 0x0a, 0x3c, 0x70, 0x20,
0x63, 0x6c, 0x61, 0x73, 0x73, 0x3d, 0x22, 0x69, 0x6e, 0x74,
0x72, 0x6f, 0x22, 0x3e, 0x49, 0x20, 0x61, 0x6d, 0x20, 0x61,
0x6e, 0x20, 0x20, 0x3c, 0x61, 0x20, 0x68, 0x72, 0x65, 0x66,
0x3d, 0x22, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x77,
0x77, 0x77, 0x2e, 0x61, 0x74, 0x6d, 0x65, 0x6c, 0x2e, 0x63,
0x6f, 0x6d, 0x2f, 0x64, 0x79, 0x6e, 0x2f, 0x70, 0x72, 0x6f,
0x64, 0x75, 0x63, 0x74, 0x73, 0x2f, 0x74, 0x6f, 0x6f, 0x6c,
0x73, 0x5f, 0x63, 0x61, 0x72, 0x64, 0x2e, 0x61, 0x73, 0x70,
0x3f, 0x66, 0x61, 0x6d, 0x69, 0x6c, 0x79, 0x5f, 0x69, 0x64,
0x3d, 0x36, 0x37, 0x36, 0x26, 0x66, 0x61, 0x6d, 0x69, 0x6c,
0x79, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x4d, 0x43, 0x55,
0x2b, 0x57, 0x69, 0x72, 0x65, 0x6c, 0x65, 0x73, 0x73, 0x26,
0x74, 0x6f, 0x6f, 0x6c, 0x5f, 0x69, 0x64, 0x3d, 0x34, 0x33,
0x39, 0x35, 0x22, 0x3e, 0x41, 0x74, 0x6d, 0x65, 0x6c, 0x20,
0x52, 0x61, 0x76, 0x65, 0x6e, 0x3c, 0x2f, 0x61, 0x3e, 0x0d,
0x0a, 0x20, 0x72, 0x75, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x20,
0x74, 0x68, 0x65, 0x20, 0x20, 0x3c, 0x61, 0x20, 0x68, 0x72,
0x65, 0x66, 0x3d, 0x22, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f,
0x2f, 0x77, 0x77, 0x77, 0x2e, 0x73, 0x69, 0x63, 0x73, 0x2e,
0x73, 0x65, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x69, 0x6b, 0x69,
0x2f, 0x22, 0x3e, 0x43, 0x6f, 0x6e, 0x74, 0x69, 0x6b, 0x69,
0x3c, 0x2f, 0x61, 0x3e, 0x20, 0x6f, 0x70, 0x65, 0x72, 0x61,
0x74, 0x69, 0x6e, 0x67, 0x20, 0x73, 0x79, 0x73, 0x74, 0x65,
0x6d, 0x2e, 0x20, 0x49, 0x20, 0x68, 0x61, 0x76, 0x65, 0x20,
0x61, 0x20, 0x73, 0x6d, 0x61, 0x6c, 0x6c, 0x20, 0x31, 0x35,
0x30, 0x4b, 0x42, 0x20, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79,
0x20, 0x62, 0x75, 0x74, 0x20, 0x49, 0x20, 0x61, 0x6d, 0x20,
0x76, 0x65, 0x72, 0x79, 0x20, 0x66, 0x61, 0x73, 0x74, 0x21,
0x0d, 0x0a, 0x3c, 0x62, 0x72, 0x3e, 0x49, 0x20, 0x61, 0x6d,
0x20, 0x6e, 0x61, 0x6d, 0x65, 0x64, 0x20, 0x61, 0x66, 0x74,
0x65, 0x72, 0x20, 0x3c, 0x61, 0x20, 0x68, 0x72, 0x65, 0x66,
0x3d, 0x22, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x65,
0x6e, 0x2e, 0x77, 0x69, 0x6b, 0x69, 0x70, 0x65, 0x64, 0x69,
0x61, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x77, 0x69, 0x6b, 0x69,
0x2f, 0x48, 0x75, 0x67, 0x69, 0x6e, 0x6e, 0x5f, 0x61, 0x6e,
0x64, 0x5f, 0x4d, 0x75, 0x6e, 0x69, 0x6e, 0x6e, 0x22, 0x3e,
0x61, 0x20, 0x6d, 0x79, 0x74, 0x68, 0x69, 0x63, 0x61, 0x6c,
0x20, 0x72, 0x61, 0x76, 0x65, 0x6e, 0x3c, 0x2f, 0x61, 0x3e,
0x20, 0x77, 0x68, 0x6f, 0x20, 0x67, 0x61, 0x74, 0x68, 0x65,
0x72, 0x65, 0x64, 0x20, 0x69, 0x6e, 0x66, 0x6f, 0x72, 0x6d,
0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x66, 0x6f, 0x72, 0x20,
0x74, 0x68, 0x65, 0x20, 0x3c, 0x61, 0x20, 0x68, 0x72, 0x65,
0x66, 0x3d, 0x22, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f,
0x65, 0x6e, 0x2e, 0x77, 0x69, 0x6b, 0x69, 0x70, 0x65, 0x64,
0x69, 0x61, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x77, 0x69, 0x6b,
0x69, 0x2f, 0x4f, 0x64, 0x69, 0x6e, 0x22, 0x3e, 0x4e, 0x6f,
0x72, 0x73, 0x65, 0x20, 0x47, 0x6f, 0x64, 0x20, 0x4f, 0x64,
0x69, 0x6e, 0x3c, 0x2f, 0x61, 0x3e, 0x2e, 0x0d, 0x0a, 0x3c,
0x62, 0x72, 0x3e, 0x3c, 0x62, 0x72, 0x3e, 0x59, 0x6f, 0x75,
0x20, 0x6d, 0x69, 0x67, 0x68, 0x74, 0x20, 0x61, 0x6c, 0x73,
0x6f, 0x20, 0x77, 0x61, 0x6e, 0x74, 0x20, 0x74, 0x6f, 0x20,
0x76, 0x69, 0x73, 0x69, 0x74, 0x20, 0x6d, 0x79, 0x20, 0x63,
0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x69, 0x6f, 0x6e, 0x20, 0x3c,
0x61, 0x20, 0x68, 0x72, 0x65, 0x66, 0x3d, 0x68, 0x74, 0x74,
0x70, 0x3a, 0x2f, 0x2f, 0x6d, 0x75, 0x6e, 0x69, 0x6e, 0x6e,
0x2e, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x68, 0x6f, 0x73, 0x74,
0x3e, 0x4d, 0x75, 0x6e, 0x69, 0x6e, 0x6e, 0x3c, 0x2f, 0x61,
0x3e, 0x2e, 0x0d, 0x0a, 0x3c, 0x62, 0x72, 0x3e, 0x57, 0x65,
0x20, 0x73, 0x68, 0x61, 0x72, 0x65, 0x20, 0x69, 0x6e, 0x66,
0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x75,
0x73, 0x69, 0x6e, 0x67, 0x20, 0x3c, 0x61, 0x20, 0x68, 0x72,
0x65, 0x66, 0x3d, 0x22, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f,
0x2f, 0x77, 0x77, 0x77, 0x2e, 0x69, 0x70, 0x76, 0x36, 0x2e,
0x6f, 0x72, 0x67, 0x22, 0x3e, 0x69, 0x70, 0x76, 0x36, 0x3c,
0x2f, 0x61, 0x3e, 0x0d, 0x0a, 0x20, 0x74, 0x68, 0x72, 0x6f,
0x75, 0x67, 0x68, 0x20, 0x61, 0x20, 0x6c, 0x6f, 0x77, 0x20,
0x70, 0x6f, 0x77, 0x65, 0x72, 0x20, 0x20, 0x3c, 0x61, 0x20,
0x68, 0x72, 0x65, 0x66, 0x3d, 0x22, 0x68, 0x74, 0x74, 0x70,
0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x67, 0x6f, 0x6f,
0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x65,
0x61, 0x72, 0x63, 0x68, 0x3f, 0x71, 0x3d, 0x36, 0x6c, 0x6f,
0x77, 0x70, 0x61, 0x6e, 0x22, 0x3e, 0x36, 0x6c, 0x6f, 0x77,
0x50, 0x41, 0x4e, 0x3c, 0x2f, 0x61, 0x3e, 0x20, 0x77, 0x69,
0x72, 0x65, 0x6c, 0x65, 0x73, 0x73, 0x20, 0x3c, 0x61, 0x20,
0x68, 0x72, 0x65, 0x66, 0x3d, 0x22, 0x68, 0x74, 0x74, 0x70,
0x3a, 0x2f, 0x2f, 0x65, 0x6e, 0x2e, 0x77, 0x69, 0x6b, 0x69,
0x70, 0x65, 0x64, 0x69, 0x61, 0x2e, 0x6f, 0x72, 0x67, 0x2f,
0x77, 0x69, 0x6b, 0x69, 0x2f, 0x49, 0x45, 0x45, 0x45, 0x5f,
0x38, 0x30, 0x32, 0x2e, 0x31, 0x35, 0x2e, 0x34, 0x22, 0x3e,
0x38, 0x30, 0x32, 0x2e, 0x31, 0x35, 0x2e, 0x34, 0x3c, 0x2f,
0x61, 0x3e, 0x20, 0x31, 0x30, 0x4b, 0x62, 0x70, 0x73, 0x20,
0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2e, 0x20, 0x0d,
0x0a, 0x3c, 0x62, 0x72, 0x3e, 0x54, 0x68, 0x65, 0x20, 0x3c,
0x61, 0x20, 0x68, 0x72, 0x65, 0x66, 0x3d, 0x22, 0x68, 0x74,
0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x73,
0x69, 0x63, 0x73, 0x2e, 0x73, 0x65, 0x2f, 0x25, 0x37, 0x45,
0x61, 0x64, 0x61, 0x6d, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x69,
0x6b, 0x69, 0x2f, 0x64, 0x6f, 0x63, 0x73, 0x2d, 0x75, 0x69,
0x70, 0x76, 0x36, 0x2f, 0x61, 0x30, 0x31, 0x31, 0x30, 0x38,
0x2e, 0x68, 0x74, 0x6d, 0x6c, 0x22, 0x3e, 0x4a, 0x61, 0x63,
0x6b, 0x64, 0x61, 0x77, 0x3c, 0x2f, 0x61, 0x3e, 0x20, 0x69,
0x73, 0x20, 0x6f, 0x75, 0x72, 0x20, 0x6c, 0x69, 0x6e, 0x6b,
0x20, 0x74, 0x6f, 0x20, 0x74, 0x68, 0x65, 0x20, 0x57, 0x65,
0x62, 0x2e, 0x20, 0x49, 0x66, 0x20, 0x68, 0x65, 0x20, 0x69,
0x73, 0x20, 0x6f, 0x66, 0x66, 0x6c, 0x69, 0x6e, 0x65, 0x20,
0x79, 0x6f, 0x75, 0x20, 0x63, 0x61, 0x6e, 0x27, 0x74, 0x20,
0x67, 0x65, 0x74, 0x20, 0x74, 0x6f, 0x20, 0x75, 0x73, 0x21,
0x0d, 0x0a, 0x3c, 0x62, 0x72, 0x3e, 0x3c, 0x62, 0x72, 0x3e,
0x54, 0x68, 0x6f, 0x75, 0x67, 0x68, 0x74, 0x20, 0x72, 0x75,
0x6c, 0x65, 0x73, 0x21, 0x20, 0x41, 0x77, 0x77, 0x6b, 0x21,
0x3c, 0x2f, 0x50, 0x3e, 0x0d, 0x0a, 0x25, 0x21, 0x66, 0x69,
0x6c, 0x65, 0x2d, 0x73, 0x74, 0x61, 0x74, 0x73, 0x20, 0x2e,
0x00};
const char data_process_shtml[196] PROGMEM = {
/* /process.shtml */
0x2f, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x2e, 0x73, 0x68, 0x74, 0x6d, 0x6c, 0x00,
0x25, 0x21, 0x3a, 0x20, 0x2f, 0x68, 0x65, 0x61, 0x64, 0x65,
0x72, 0x2e, 0x68, 0x74, 0x6d, 0x6c, 0x0d, 0x0a, 0x3c, 0x68,
0x31, 0x3e, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x20, 0x70,
0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x65, 0x73, 0x3c, 0x2f,
0x68, 0x31, 0x3e, 0x3c, 0x62, 0x72, 0x3e, 0x3c, 0x74, 0x61,
0x62, 0x6c, 0x65, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d,
0x22, 0x31, 0x30, 0x30, 0x25, 0x22, 0x3e, 0x3c, 0x74, 0x72,
0x3e, 0x3c, 0x74, 0x68, 0x3e, 0x49, 0x44, 0x3c, 0x2f, 0x74,
0x68, 0x3e, 0x3c, 0x74, 0x68, 0x3e, 0x4e, 0x61, 0x6d, 0x65,
0x3c, 0x2f, 0x74, 0x68, 0x3e, 0x3c, 0x74, 0x68, 0x3e, 0x54,
0x68, 0x72, 0x65, 0x61, 0x64, 0x3c, 0x2f, 0x74, 0x68, 0x3e,
0x3c, 0x74, 0x68, 0x3e, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73,
0x73, 0x20, 0x73, 0x74, 0x61, 0x74, 0x65, 0x3c, 0x2f, 0x74,
0x68, 0x3e, 0x3c, 0x2f, 0x74, 0x72, 0x3e, 0x0d, 0x0a, 0x25,
0x21, 0x20, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x65,
0x73, 0x0d, 0x0a, 0x3c, 0x2f, 0x74, 0x61, 0x62, 0x6c, 0x65,
0x3e, 0x0d, 0x0a, 0x25, 0x21, 0x20, 0x66, 0x69, 0x6c, 0x65,
0x2d, 0x73, 0x74, 0x61, 0x74, 0x73, 0x20, 0x2e, 0x0d, 0x0a,
0x00};
const char data_robots_txt[39] PROGMEM = {
/* /robots.txt */
0x2f, 0x72, 0x6f, 0x62, 0x6f, 0x74, 0x73, 0x2e, 0x74, 0x78, 0x74, 0x00,
0x75, 0x73, 0x65, 0x72, 0x2d, 0x61, 0x67, 0x65, 0x6e, 0x74,
0x3a, 0x20, 0x2a, 0x0d, 0x0a, 0x44, 0x69, 0x73, 0x61, 0x6c,
0x6c, 0x6f, 0x77, 0x3a, 0x20, 0x2f, 0x00};
const char data_sensor_shtml[90] PROGMEM = {
/* /sensor.shtml */
0x2f, 0x73, 0x65, 0x6e, 0x73, 0x6f, 0x72, 0x2e, 0x73, 0x68, 0x74, 0x6d, 0x6c, 0x00,
0x25, 0x21, 0x3a, 0x20, 0x2f, 0x68, 0x65, 0x61, 0x64, 0x65,
0x72, 0x2e, 0x68, 0x74, 0x6d, 0x6c, 0x0d, 0x0a, 0x3c, 0x68,
0x31, 0x3e, 0x53, 0x65, 0x6e, 0x73, 0x6f, 0x72, 0x20, 0x52,
0x65, 0x61, 0x64, 0x69, 0x6e, 0x67, 0x73, 0x3c, 0x2f, 0x68,
0x31, 0x3e, 0x3c, 0x62, 0x72, 0x3e, 0x0d, 0x0a, 0x25, 0x21,
0x20, 0x73, 0x65, 0x6e, 0x73, 0x6f, 0x72, 0x73, 0x0d, 0x0a,
0x25, 0x21, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x2d, 0x73, 0x74,
0x61, 0x74, 0x73, 0x20, 0x2e, 0x00};
const char data_status_shtml[209] PROGMEM = {
/* /status.shtml */
0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, 0x73, 0x68, 0x74, 0x6d, 0x6c, 0x00,
0x25, 0x21, 0x3a, 0x20, 0x2f, 0x68, 0x65, 0x61, 0x64, 0x65,
0x72, 0x2e, 0x68, 0x74, 0x6d, 0x6c, 0x0d, 0x0a, 0x3c, 0x68,
0x34, 0x3e, 0x4d, 0x79, 0x20, 0x41, 0x64, 0x64, 0x72, 0x65,
0x73, 0x73, 0x65, 0x73, 0x3c, 0x2f, 0x68, 0x34, 0x3e, 0x0d,
0x0a, 0x25, 0x21, 0x20, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73,
0x73, 0x65, 0x73, 0x0d, 0x0a, 0x3c, 0x68, 0x34, 0x3e, 0x4d,
0x79, 0x20, 0x63, 0x6c, 0x6f, 0x73, 0x65, 0x20, 0x66, 0x72,
0x69, 0x65, 0x6e, 0x64, 0x73, 0x3c, 0x2f, 0x68, 0x34, 0x3e,
0x0d, 0x0a, 0x25, 0x21, 0x20, 0x6e, 0x65, 0x69, 0x67, 0x68,
0x62, 0x6f, 0x72, 0x73, 0x0d, 0x0a, 0x3c, 0x68, 0x34, 0x3e,
0x4d, 0x79, 0x20, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x20, 0x66,
0x72, 0x69, 0x65, 0x6e, 0x64, 0x73, 0x3c, 0x2f, 0x68, 0x34,
0x3e, 0x0d, 0x0a, 0x25, 0x21, 0x20, 0x72, 0x6f, 0x75, 0x74,
0x65, 0x73, 0x0d, 0x0a, 0x3c, 0x68, 0x34, 0x3e, 0x4d, 0x79,
0x20, 0x53, 0x65, 0x6e, 0x73, 0x6f, 0x72, 0x73, 0x3c, 0x2f,
0x68, 0x34, 0x3e, 0x0d, 0x0a, 0x25, 0x21, 0x20, 0x73, 0x65,
0x6e, 0x73, 0x6f, 0x72, 0x73, 0x0d, 0x0a, 0x3c, 0x2f, 0x74,
0x61, 0x62, 0x6c, 0x65, 0x3e, 0x0d, 0x0a, 0x25, 0x21, 0x20,
0x66, 0x69, 0x6c, 0x65, 0x2d, 0x73, 0x74, 0x61, 0x74, 0x73,
0x20, 0x2e, 0x0d, 0x0a, 0x00};
const char data_style_css[2063] PROGMEM = {
/* /style.css */
0x2f, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x2e, 0x63, 0x73, 0x73, 0x00,
0x68, 0x31, 0x7b, 0x74, 0x65, 0x78, 0x74, 0x2d, 0x61, 0x6c,
0x69, 0x67, 0x6e, 0x3a, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72,
0x3b, 0x66, 0x6f, 0x6e, 0x74, 0x2d, 0x73, 0x69, 0x7a, 0x65,
0x3a, 0x31, 0x34, 0x70, 0x74, 0x3b, 0x66, 0x6f, 0x6e, 0x74,
0x2d, 0x66, 0x61, 0x6d, 0x69, 0x6c, 0x79, 0x3a, 0x61, 0x72,
0x69, 0x61, 0x6c, 0x2c, 0x68, 0x65, 0x6c, 0x76, 0x65, 0x74,
0x69, 0x63, 0x61, 0x3b, 0x66, 0x6f, 0x6e, 0x74, 0x2d, 0x77,
0x65, 0x69, 0x67, 0x68, 0x74, 0x3a, 0x62, 0x6f, 0x6c, 0x64,
0x3b, 0x70, 0x61, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x3a, 0x31,
0x30, 0x70, 0x78, 0x3b, 0x7d, 0x0d, 0x0a, 0x62, 0x6f, 0x64,
0x79, 0x7b, 0x62, 0x61, 0x63, 0x6b, 0x67, 0x72, 0x6f, 0x75,
0x6e, 0x64, 0x2d, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x3a, 0x23,
0x66, 0x66, 0x66, 0x65, 0x65, 0x63, 0x3b, 0x63, 0x6f, 0x6c,
0x6f, 0x72, 0x3a, 0x62, 0x6c, 0x61, 0x63, 0x6b, 0x3b, 0x66,
0x6f, 0x6e, 0x74, 0x2d, 0x73, 0x69, 0x7a, 0x65, 0x3a, 0x38,
0x70, 0x74, 0x3b, 0x66, 0x6f, 0x6e, 0x74, 0x2d, 0x66, 0x61,
0x6d, 0x69, 0x6c, 0x79, 0x3a, 0x61, 0x72, 0x69, 0x61, 0x6c,
0x2c, 0x68, 0x65, 0x6c, 0x76, 0x65, 0x74, 0x69, 0x63, 0x61,
0x3b, 0x7d, 0x0d, 0x0a, 0x2e, 0x77, 0x72, 0x61, 0x70, 0x7b,
0x77, 0x69, 0x64, 0x74, 0x68, 0x3a, 0x39, 0x38, 0x25, 0x3b,
0x6d, 0x61, 0x72, 0x67, 0x69, 0x6e, 0x3a, 0x30, 0x20, 0x61,
0x75, 0x74, 0x6f, 0x3b, 0x74, 0x65, 0x78, 0x74, 0x2d, 0x61,
0x6c, 0x69, 0x67, 0x6e, 0x3a, 0x6c, 0x65, 0x66, 0x74, 0x3b,
0x66, 0x6f, 0x6e, 0x74, 0x2d, 0x66, 0x61, 0x6d, 0x69, 0x6c,
0x79, 0x3a, 0x61, 0x72, 0x69, 0x61, 0x6c, 0x2c, 0x68, 0x65,
0x6c, 0x76, 0x65, 0x74, 0x69, 0x63, 0x61, 0x3b, 0x7d, 0x0d,
0x0a, 0x2e, 0x6d, 0x65, 0x6e, 0x75, 0x62, 0x6c, 0x6f, 0x63,
0x6b, 0x7b, 0x6d, 0x61, 0x72, 0x67, 0x69, 0x6e, 0x3a, 0x34,
0x70, 0x78, 0x3b, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3a, 0x31,
0x35, 0x25, 0x3b, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x3a, 0x6c,
0x65, 0x66, 0x74, 0x3b, 0x70, 0x61, 0x64, 0x64, 0x69, 0x6e,
0x67, 0x3a, 0x31, 0x30, 0x70, 0x78, 0x3b, 0x62, 0x6f, 0x72,
0x64, 0x65, 0x72, 0x3a, 0x73, 0x6f, 0x6c, 0x69, 0x64, 0x20,
0x31, 0x70, 0x78, 0x3b, 0x62, 0x61, 0x63, 0x6b, 0x67, 0x72,
0x6f, 0x75, 0x6e, 0x64, 0x2d, 0x63, 0x6f, 0x6c, 0x6f, 0x72,
0x3a, 0x23, 0x66, 0x66, 0x66, 0x63, 0x64, 0x32, 0x3b, 0x74,
0x65, 0x78, 0x74, 0x2d, 0x61, 0x6c, 0x69, 0x67, 0x6e, 0x3a,
0x6c, 0x65, 0x66, 0x74, 0x3b, 0x66, 0x6f, 0x6e, 0x74, 0x2d,
0x73, 0x69, 0x7a, 0x65, 0x3a, 0x39, 0x70, 0x74, 0x3b, 0x66,
0x6f, 0x6e, 0x74, 0x2d, 0x66, 0x61, 0x6d, 0x69, 0x6c, 0x79,
0x3a, 0x61, 0x72, 0x69, 0x61, 0x6c, 0x2c, 0x68, 0x65, 0x6c,
0x76, 0x65, 0x74, 0x69, 0x63, 0x61, 0x3b, 0x7d, 0x0d, 0x0a,
0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x62, 0x6c,
0x6f, 0x63, 0x6b, 0x7b, 0x6d, 0x61, 0x72, 0x67, 0x69, 0x6e,
0x3a, 0x34, 0x70, 0x78, 0x3b, 0x77, 0x69, 0x64, 0x74, 0x68,
0x3a, 0x35, 0x30, 0x25, 0x3b, 0x66, 0x6c, 0x6f, 0x61, 0x74,
0x3a, 0x6c, 0x65, 0x66, 0x74, 0x3b, 0x70, 0x61, 0x64, 0x64,
0x69, 0x6e, 0x67, 0x3a, 0x31, 0x30, 0x70, 0x78, 0x3b, 0x62,
0x6f, 0x72, 0x64, 0x65, 0x72, 0x3a, 0x31, 0x70, 0x78, 0x20,
0x64, 0x6f, 0x74, 0x74, 0x65, 0x64, 0x3b, 0x62, 0x61, 0x63,
0x6b, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x2d, 0x63, 0x6f,
0x6c, 0x6f, 0x72, 0x3a, 0x77, 0x68, 0x69, 0x74, 0x65, 0x3b,
0x66, 0x6f, 0x6e, 0x74, 0x2d, 0x73, 0x69, 0x7a, 0x65, 0x3a,
0x38, 0x70, 0x74, 0x3b, 0x66, 0x6f, 0x6e, 0x74, 0x2d, 0x66,
0x61, 0x6d, 0x69, 0x6c, 0x79, 0x3a, 0x61, 0x72, 0x69, 0x61,
0x6c, 0x2c, 0x68, 0x65, 0x6c, 0x76, 0x65, 0x74, 0x69, 0x63,
0x61, 0x3b, 0x7d, 0x0d, 0x0a, 0x2e, 0x6e, 0x65, 0x77, 0x73,
0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x7b, 0x6d, 0x61, 0x72, 0x67,
0x69, 0x6e, 0x3a, 0x34, 0x70, 0x78, 0x3b, 0x77, 0x69, 0x64,
0x74, 0x68, 0x3a, 0x32, 0x34, 0x25, 0x3b, 0x66, 0x6c, 0x6f,
0x61, 0x74, 0x3a, 0x6c, 0x65, 0x66, 0x74, 0x3b, 0x70, 0x61,
0x64, 0x64, 0x69, 0x6e, 0x67, 0x3a, 0x31, 0x30, 0x70, 0x78,
0x3b, 0x62, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x3a, 0x73, 0x6f,
0x6c, 0x69, 0x64, 0x20, 0x31, 0x70, 0x78, 0x3b, 0x62, 0x61,
0x63, 0x6b, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x2d, 0x63,
0x6f, 0x6c, 0x6f, 0x72, 0x3a, 0x23, 0x66, 0x66, 0x66, 0x63,
0x64, 0x32, 0x3b, 0x74, 0x65, 0x78, 0x74, 0x2d, 0x61, 0x6c,
0x69, 0x67, 0x6e, 0x3a, 0x6c, 0x65, 0x66, 0x74, 0x3b, 0x66,
0x6f, 0x6e, 0x74, 0x2d, 0x73, 0x69, 0x7a, 0x65, 0x3a, 0x38,
0x70, 0x74, 0x3b, 0x66, 0x6f, 0x6e, 0x74, 0x2d, 0x66, 0x61,
0x6d, 0x69, 0x6c, 0x79, 0x3a, 0x61, 0x72, 0x69, 0x61, 0x6c,
0x2c, 0x68, 0x65, 0x6c, 0x76, 0x65, 0x74, 0x69, 0x63, 0x61,
0x3b, 0x7d, 0x0d, 0x0a, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74,
0x61, 0x62, 0x6c, 0x65, 0x7b, 0x6d, 0x61, 0x72, 0x67, 0x69,
0x6e, 0x3a, 0x34, 0x70, 0x78, 0x3b, 0x77, 0x69, 0x64, 0x74,
0x68, 0x3a, 0x32, 0x34, 0x25, 0x3b, 0x66, 0x6c, 0x6f, 0x61,
0x74, 0x3a, 0x6c, 0x65, 0x66, 0x74, 0x3b, 0x70, 0x61, 0x64,
0x64, 0x69, 0x6e, 0x67, 0x3a, 0x31, 0x30, 0x70, 0x78, 0x3b,
0x62, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x3a, 0x30, 0x3b, 0x62,
0x61, 0x63, 0x6b, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x2d,
0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x3a, 0x23, 0x66, 0x66, 0x66,
0x65, 0x65, 0x63, 0x3b, 0x74, 0x65, 0x78, 0x74, 0x2d, 0x61,
0x6c, 0x69, 0x67, 0x6e, 0x3a, 0x72, 0x69, 0x67, 0x68, 0x74,
0x3b, 0x66, 0x6f, 0x6e, 0x74, 0x2d, 0x73, 0x69, 0x7a, 0x65,
0x3a, 0x38, 0x70, 0x74, 0x3b, 0x66, 0x6f, 0x6e, 0x74, 0x2d,
0x66, 0x61, 0x6d, 0x69, 0x6c, 0x79, 0x3a, 0x61, 0x72, 0x69,
0x61, 0x6c, 0x2c, 0x68, 0x65, 0x6c, 0x76, 0x65, 0x74, 0x69,
0x63, 0x61, 0x3b, 0x7d, 0x0d, 0x0a, 0x64, 0x69, 0x76, 0x2e,
0x72, 0x66, 0x69, 0x67, 0x7b, 0x62, 0x6f, 0x72, 0x64, 0x65,
0x72, 0x3a, 0x73, 0x6f, 0x6c, 0x69, 0x64, 0x20, 0x31, 0x70,
0x78, 0x3b, 0x20, 0x74, 0x65, 0x78, 0x74, 0x2d, 0x61, 0x6c,
0x69, 0x67, 0x6e, 0x3a, 0x6c, 0x65, 0x66, 0x74, 0x3b, 0x70,
0x61, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x3a, 0x31, 0x30, 0x70,
0x78, 0x3b, 0x6d, 0x61, 0x72, 0x67, 0x69, 0x6e, 0x3a, 0x31,
0x30, 0x70, 0x78, 0x3b, 0x66, 0x6f, 0x6e, 0x74, 0x2d, 0x73,
0x69, 0x7a, 0x65, 0x3a, 0x38, 0x70, 0x74, 0x3b, 0x66, 0x6c,
0x6f, 0x61, 0x74, 0x3a, 0x72, 0x69, 0x67, 0x68, 0x74, 0x3b,
0x7d, 0x0d, 0x0a, 0x70, 0x72, 0x65, 0x2e, 0x65, 0x78, 0x61,
0x6d, 0x70, 0x6c, 0x65, 0x7b, 0x62, 0x6f, 0x72, 0x64, 0x65,
0x72, 0x3a, 0x73, 0x6f, 0x6c, 0x69, 0x64, 0x20, 0x31, 0x70,
0x78, 0x3b, 0x20, 0x70, 0x61, 0x64, 0x64, 0x69, 0x6e, 0x67,
0x3a, 0x31, 0x30, 0x70, 0x78, 0x3b, 0x6d, 0x61, 0x72, 0x67,
0x69, 0x6e, 0x3a, 0x31, 0x30, 0x70, 0x78, 0x3b, 0x74, 0x65,
0x78, 0x74, 0x2d, 0x61, 0x6c, 0x69, 0x67, 0x6e, 0x3a, 0x6c,
0x65, 0x66, 0x74, 0x3b, 0x66, 0x6f, 0x6e, 0x74, 0x2d, 0x73,
0x69, 0x7a, 0x65, 0x3a, 0x38, 0x70, 0x74, 0x3b, 0x66, 0x6f,
0x6e, 0x74, 0x2d, 0x66, 0x61, 0x6d, 0x69, 0x6c, 0x79, 0x3a,
0x61, 0x72, 0x69, 0x61, 0x6c, 0x2c, 0x68, 0x65, 0x6c, 0x76,
0x65, 0x74, 0x69, 0x63, 0x61, 0x3b, 0x77, 0x68, 0x69, 0x74,
0x65, 0x2d, 0x73, 0x70, 0x61, 0x63, 0x65, 0x3a, 0x70, 0x72,
0x65, 0x3b, 0x7d, 0x0d, 0x0a, 0x70, 0x2e, 0x69, 0x6e, 0x74,
0x72, 0x6f, 0x7b, 0x6d, 0x61, 0x72, 0x67, 0x69, 0x6e, 0x2d,
0x6c, 0x65, 0x66, 0x74, 0x3a, 0x32, 0x30, 0x70, 0x78, 0x3b,
0x6d, 0x61, 0x72, 0x67, 0x69, 0x6e, 0x2d, 0x72, 0x69, 0x67,
0x68, 0x74, 0x3a, 0x32, 0x30, 0x70, 0x78, 0x3b, 0x66, 0x6f,
0x6e, 0x74, 0x2d, 0x73, 0x69, 0x7a, 0x65, 0x3a, 0x31, 0x30,
0x70, 0x74, 0x3b, 0x66, 0x6f, 0x6e, 0x74, 0x2d, 0x66, 0x61,
0x6d, 0x69, 0x6c, 0x79, 0x3a, 0x61, 0x72, 0x69, 0x61, 0x6c,
0x2c, 0x68, 0x65, 0x6c, 0x76, 0x65, 0x74, 0x69, 0x63, 0x61,
0x3b, 0x7d, 0x0d, 0x0a, 0x70, 0x2e, 0x63, 0x6c, 0x69, 0x6e,
0x6b, 0x7b, 0x66, 0x6f, 0x6e, 0x74, 0x2d, 0x73, 0x69, 0x7a,
0x65, 0x3a, 0x31, 0x32, 0x70, 0x74, 0x3b, 0x66, 0x6f, 0x6e,
0x74, 0x2d, 0x66, 0x61, 0x6d, 0x69, 0x6c, 0x79, 0x3a, 0x63,
0x6f, 0x75, 0x72, 0x69, 0x65, 0x72, 0x2c, 0x6d, 0x6f, 0x6e,
0x6f, 0x73, 0x70, 0x61, 0x63, 0x65, 0x3b, 0x20, 0x74, 0x65,
0x78, 0x74, 0x2d, 0x61, 0x6c, 0x69, 0x67, 0x6e, 0x3a, 0x63,
0x65, 0x6e, 0x74, 0x65, 0x72, 0x3b, 0x7d, 0x0d, 0x0a, 0x70,
0x2e, 0x63, 0x6c, 0x69, 0x6e, 0x6b, 0x39, 0x7b, 0x66, 0x6f,
0x6e, 0x74, 0x2d, 0x73, 0x69, 0x7a, 0x65, 0x3a, 0x39, 0x70,
0x74, 0x3b, 0x66, 0x6f, 0x6e, 0x74, 0x2d, 0x66, 0x61, 0x6d,
0x69, 0x6c, 0x79, 0x3a, 0x63, 0x6f, 0x75, 0x72, 0x69, 0x65,
0x72, 0x2c, 0x6d, 0x6f, 0x6e, 0x6f, 0x73, 0x70, 0x61, 0x63,
0x65, 0x3b, 0x74, 0x65, 0x78, 0x74, 0x2d, 0x61, 0x6c, 0x69,
0x67, 0x6e, 0x3a, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x3b,
0x7d, 0x0d, 0x0a, 0x70, 0x2e, 0x72, 0x65, 0x6c, 0x61, 0x74,
0x65, 0x64, 0x7b, 0x66, 0x6f, 0x6e, 0x74, 0x2d, 0x73, 0x69,
0x7a, 0x65, 0x3a, 0x31, 0x30, 0x70, 0x74, 0x3b, 0x66, 0x6f,
0x6e, 0x74, 0x2d, 0x66, 0x61, 0x6d, 0x69, 0x6c, 0x79, 0x3a,
0x61, 0x72, 0x69, 0x61, 0x6c, 0x2c, 0x68, 0x65, 0x6c, 0x76,
0x65, 0x74, 0x69, 0x63, 0x61, 0x3b, 0x74, 0x65, 0x78, 0x74,
0x2d, 0x61, 0x6c, 0x69, 0x67, 0x6e, 0x3a, 0x63, 0x65, 0x6e,
0x74, 0x65, 0x72, 0x3b, 0x7d, 0x0d, 0x0a, 0x69, 0x6d, 0x67,
0x2e, 0x72, 0x69, 0x67, 0x68, 0x74, 0x7b, 0x66, 0x6c, 0x6f,
0x61, 0x74, 0x3a, 0x72, 0x69, 0x67, 0x68, 0x74, 0x3b, 0x6d,
0x61, 0x72, 0x67, 0x69, 0x6e, 0x3a, 0x31, 0x30, 0x70, 0x78,
0x3b, 0x7d, 0x0d, 0x0a, 0x69, 0x6d, 0x67, 0x2e, 0x6c, 0x65,
0x66, 0x74, 0x7b, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x3a, 0x6c,
0x65, 0x66, 0x74, 0x3b, 0x6d, 0x61, 0x72, 0x67, 0x69, 0x6e,
0x3a, 0x31, 0x30, 0x70, 0x78, 0x3b, 0x7d, 0x0d, 0x0a, 0x70,
0x2e, 0x66, 0x69, 0x67, 0x7b, 0x62, 0x6f, 0x72, 0x64, 0x65,
0x72, 0x3a, 0x73, 0x6f, 0x6c, 0x69, 0x64, 0x20, 0x31, 0x70,
0x78, 0x3b, 0x74, 0x65, 0x78, 0x74, 0x2d, 0x61, 0x6c, 0x69,
0x67, 0x6e, 0x3a, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x3b,
0x70, 0x61, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x3a, 0x31, 0x30,
0x70, 0x78, 0x3b, 0x6d, 0x61, 0x72, 0x67, 0x69, 0x6e, 0x3a,
0x31, 0x30, 0x70, 0x78, 0x3b, 0x66, 0x6f, 0x6e, 0x74, 0x2d,
0x73, 0x69, 0x7a, 0x65, 0x3a, 0x37, 0x70, 0x74, 0x3b, 0x7d,
0x0d, 0x0a, 0x70, 0x2e, 0x72, 0x66, 0x69, 0x67, 0x7b, 0x62,
0x6f, 0x72, 0x64, 0x65, 0x72, 0x3a, 0x73, 0x6f, 0x6c, 0x69,
0x64, 0x20, 0x31, 0x70, 0x78, 0x3b, 0x74, 0x65, 0x78, 0x74,
0x2d, 0x61, 0x6c, 0x69, 0x67, 0x6e, 0x3a, 0x63, 0x65, 0x6e,
0x74, 0x65, 0x72, 0x3b, 0x70, 0x61, 0x64, 0x64, 0x69, 0x6e,
0x67, 0x3a, 0x31, 0x30, 0x70, 0x78, 0x3b, 0x6d, 0x61, 0x72,
0x67, 0x69, 0x6e, 0x3a, 0x31, 0x30, 0x70, 0x78, 0x3b, 0x66,
0x6f, 0x6e, 0x74, 0x2d, 0x73, 0x69, 0x7a, 0x65, 0x3a, 0x37,
0x70, 0x74, 0x3b, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x3a, 0x72,
0x69, 0x67, 0x68, 0x74, 0x3b, 0x7d, 0x0d, 0x0a, 0x70, 0x2e,
0x6c, 0x66, 0x69, 0x67, 0x7b, 0x62, 0x6f, 0x72, 0x64, 0x65,
0x72, 0x3a, 0x73, 0x6f, 0x6c, 0x69, 0x64, 0x20, 0x31, 0x70,
0x78, 0x3b, 0x74, 0x65, 0x78, 0x74, 0x2d, 0x61, 0x6c, 0x69,
0x67, 0x6e, 0x3a, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x3b,
0x70, 0x61, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x3a, 0x31, 0x30,
0x70, 0x78, 0x3b, 0x6d, 0x61, 0x72, 0x67, 0x69, 0x6e, 0x3a,
0x31, 0x30, 0x70, 0x78, 0x3b, 0x66, 0x6f, 0x6e, 0x74, 0x2d,
0x73, 0x69, 0x7a, 0x65, 0x3a, 0x37, 0x70, 0x74, 0x3b, 0x66,
0x6c, 0x6f, 0x61, 0x74, 0x3a, 0x6c, 0x65, 0x66, 0x74, 0x3b,
0x7d, 0x0d, 0x0a, 0x70, 0x7b, 0x70, 0x61, 0x64, 0x64, 0x69,
0x6e, 0x67, 0x2d, 0x6c, 0x65, 0x66, 0x74, 0x3a, 0x31, 0x30,
0x70, 0x78, 0x3b, 0x7d, 0x0d, 0x0a, 0x70, 0x2e, 0x6d, 0x61,
0x69, 0x6c, 0x61, 0x64, 0x64, 0x72, 0x7b, 0x70, 0x61, 0x64,
0x64, 0x69, 0x6e, 0x67, 0x2d, 0x6c, 0x65, 0x66, 0x74, 0x3a,
0x31, 0x30, 0x70, 0x78, 0x3b, 0x66, 0x6f, 0x6e, 0x74, 0x2d,
0x73, 0x69, 0x7a, 0x65, 0x3a, 0x37, 0x70, 0x74, 0x3b, 0x66,
0x6f, 0x6e, 0x74, 0x2d, 0x66, 0x61, 0x6d, 0x69, 0x6c, 0x79,
0x3a, 0x63, 0x6f, 0x75, 0x72, 0x69, 0x65, 0x72, 0x2c, 0x74,
0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x6c, 0x3b, 0x74, 0x65,
0x78, 0x74, 0x2d, 0x61, 0x6c, 0x69, 0x67, 0x6e, 0x3a, 0x72,
0x69, 0x67, 0x68, 0x74, 0x3b, 0x7d, 0x0d, 0x0a, 0x70, 0x2e,
0x72, 0x69, 0x67, 0x68, 0x74, 0x7b, 0x74, 0x65, 0x78, 0x74,
0x2d, 0x61, 0x6c, 0x69, 0x67, 0x6e, 0x3a, 0x72, 0x69, 0x67,
0x68, 0x74, 0x3b, 0x7d, 0x0d, 0x0a, 0x70, 0x2e, 0x62, 0x6f,
0x72, 0x64, 0x65, 0x72, 0x2d, 0x74, 0x69, 0x74, 0x6c, 0x65,
0x7b, 0x74, 0x65, 0x78, 0x74, 0x2d, 0x61, 0x6c, 0x69, 0x67,
0x6e, 0x3a, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x3b, 0x66,
0x6f, 0x6e, 0x74, 0x2d, 0x73, 0x69, 0x7a, 0x65, 0x3a, 0x31,
0x34, 0x70, 0x74, 0x3b, 0x70, 0x61, 0x64, 0x64, 0x69, 0x6e,
0x67, 0x3a, 0x30, 0x70, 0x78, 0x3b, 0x6d, 0x61, 0x72, 0x67,
0x69, 0x6e, 0x3a, 0x34, 0x70, 0x78, 0x3b, 0x6d, 0x61, 0x72,
0x67, 0x69, 0x6e, 0x2d, 0x62, 0x6f, 0x74, 0x74, 0x6f, 0x6d,
0x3a, 0x31, 0x30, 0x70, 0x78, 0x3b, 0x63, 0x6f, 0x6c, 0x6f,
0x72, 0x3a, 0x62, 0x6c, 0x61, 0x63, 0x6b, 0x3b, 0x62, 0x61,
0x63, 0x6b, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x2d, 0x63,
0x6f, 0x6c, 0x6f, 0x72, 0x3a, 0x23, 0x66, 0x66, 0x66, 0x63,
0x62, 0x61, 0x3b, 0x62, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x3a,
0x73, 0x6f, 0x6c, 0x69, 0x64, 0x20, 0x31, 0x70, 0x78, 0x3b,
0x7d, 0x00};
const char data_tcp_shtml[233] PROGMEM = {
/* /tcp.shtml */
0x2f, 0x74, 0x63, 0x70, 0x2e, 0x73, 0x68, 0x74, 0x6d, 0x6c, 0x00,
0x25, 0x21, 0x3a, 0x20, 0x2f, 0x68, 0x65, 0x61, 0x64, 0x65,
0x72, 0x2e, 0x68, 0x74, 0x6d, 0x6c, 0x0d, 0x0a, 0x3c, 0x68,
0x31, 0x3e, 0x43, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x20,
0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e,
0x73, 0x3c, 0x2f, 0x68, 0x31, 0x3e, 0x3c, 0x62, 0x72, 0x3e,
0x3c, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x77, 0x69, 0x64,
0x74, 0x68, 0x3d, 0x22, 0x31, 0x30, 0x30, 0x25, 0x22, 0x3e,
0x3c, 0x74, 0x72, 0x3e, 0x3c, 0x74, 0x68, 0x3e, 0x4c, 0x6f,
0x63, 0x61, 0x6c, 0x3c, 0x2f, 0x74, 0x68, 0x3e, 0x3c, 0x74,
0x68, 0x3e, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x3c, 0x2f,
0x74, 0x68, 0x3e, 0x3c, 0x74, 0x68, 0x3e, 0x53, 0x74, 0x61,
0x74, 0x65, 0x3c, 0x2f, 0x74, 0x68, 0x3e, 0x3c, 0x74, 0x68,
0x3e, 0x52, 0x65, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x6d, 0x69,
0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x3c, 0x2f, 0x74, 0x68,
0x3e, 0x3c, 0x74, 0x68, 0x3e, 0x54, 0x69, 0x6d, 0x65, 0x72,
0x3c, 0x2f, 0x74, 0x68, 0x3e, 0x3c, 0x74, 0x68, 0x3e, 0x46,
0x6c, 0x61, 0x67, 0x73, 0x3c, 0x2f, 0x74, 0x68, 0x3e, 0x3c,
0x2f, 0x74, 0x72, 0x3e, 0x0d, 0x0a, 0x25, 0x21, 0x20, 0x74,
0x63, 0x70, 0x2d, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74,
0x69, 0x6f, 0x6e, 0x73, 0x0d, 0x0a, 0x3c, 0x2f, 0x74, 0x61,
0x62, 0x6c, 0x65, 0x3e, 0x0d, 0x0a, 0x25, 0x21, 0x20, 0x66,
0x69, 0x6c, 0x65, 0x2d, 0x73, 0x74, 0x61, 0x74, 0x73, 0x20,
0x2e, 0x00};
const char data_upload_html[211] PROGMEM = {
/* /upload.html */
0x2f, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x2e, 0x68, 0x74, 0x6d, 0x6c, 0x00,
0x3c, 0x68, 0x74, 0x6d, 0x6c, 0x3e, 0x3c, 0x62, 0x6f, 0x64,
0x79, 0x3e, 0x0d, 0x0a, 0x3c, 0x66, 0x6f, 0x72, 0x6d, 0x20,
0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3d, 0x22, 0x75, 0x70,
0x6c, 0x6f, 0x61, 0x64, 0x2e, 0x68, 0x74, 0x6d, 0x6c, 0x22,
0x20, 0x65, 0x6e, 0x63, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22,
0x6d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x61, 0x72, 0x74, 0x2f,
0x66, 0x6f, 0x72, 0x6d, 0x2d, 0x64, 0x61, 0x74, 0x61, 0x22,
0x20, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x3d, 0x22, 0x70,
0x6f, 0x73, 0x74, 0x22, 0x3e, 0x0d, 0x0a, 0x3c, 0x69, 0x6e,
0x70, 0x75, 0x74, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22,
0x75, 0x73, 0x65, 0x72, 0x66, 0x69, 0x6c, 0x65, 0x22, 0x20,
0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x66, 0x69, 0x6c, 0x65,
0x22, 0x20, 0x73, 0x69, 0x7a, 0x65, 0x3d, 0x22, 0x35, 0x30,
0x22, 0x20, 0x2f, 0x3e, 0x0d, 0x0a, 0x3c, 0x69, 0x6e, 0x70,
0x75, 0x74, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3d, 0x22,
0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x20, 0x74, 0x79,
0x70, 0x65, 0x3d, 0x22, 0x73, 0x75, 0x62, 0x6d, 0x69, 0x74,
0x22, 0x20, 0x2f, 0x3e, 0x0d, 0x0a, 0x3c, 0x2f, 0x66, 0x6f,
0x72, 0x6d, 0x3e, 0x3c, 0x2f, 0x62, 0x6f, 0x64, 0x79, 0x3e,
0x3c, 0x2f, 0x68, 0x74, 0x6d, 0x6c, 0x3e, 0x00};
/* Structure of linked list (all offsets relative to start of section):
struct httpd_fsdata_file {
const struct httpd_fsdata_file *next; //actual flash address of next link
const char *name; //offset to coffee file name
const char *data; //offset to coffee file data
const int len; //length of file data
#if HTTPD_FS_STATISTICS == 1 //not enabled since list is in PROGMEM
u16_t count; //storage for file statistics
#endif
}
*/
const struct httpd_fsdata_file file_404_html[] PROGMEM ={{ NULL, data_404_html , data_404_html +10, sizeof(data_404_html) -10}};
const struct httpd_fsdata_file file_favicon_png[] PROGMEM ={{ file_404_html, data_favicon_png , data_favicon_png +13, sizeof(data_favicon_png) -13}};
const struct httpd_fsdata_file file_files_shtml[] PROGMEM ={{ file_favicon_png, data_files_shtml , data_files_shtml +13, sizeof(data_files_shtml) -13}};
const struct httpd_fsdata_file file_footer_html[] PROGMEM ={{ file_files_shtml, data_footer_html , data_footer_html +13, sizeof(data_footer_html) -13}};
const struct httpd_fsdata_file file_header_html[] PROGMEM ={{ file_footer_html, data_header_html , data_header_html +13, sizeof(data_header_html) -13}};
const struct httpd_fsdata_file file_index_html[] PROGMEM ={{ file_header_html, data_index_html , data_index_html +12, sizeof(data_index_html) -12}};
const struct httpd_fsdata_file file_process_shtml[] PROGMEM ={{ file_index_html, data_process_shtml , data_process_shtml +15, sizeof(data_process_shtml) -15}};
const struct httpd_fsdata_file file_robots_txt[] PROGMEM ={{ file_process_shtml, data_robots_txt , data_robots_txt +12, sizeof(data_robots_txt) -12}};
const struct httpd_fsdata_file file_sensor_shtml[] PROGMEM ={{ file_robots_txt, data_sensor_shtml , data_sensor_shtml +14, sizeof(data_sensor_shtml) -14}};
const struct httpd_fsdata_file file_status_shtml[] PROGMEM ={{ file_sensor_shtml, data_status_shtml , data_status_shtml +14, sizeof(data_status_shtml) -14}};
const struct httpd_fsdata_file file_style_css[] PROGMEM ={{ file_status_shtml, data_style_css , data_style_css +11, sizeof(data_style_css) -11}};
const struct httpd_fsdata_file file_tcp_shtml[] PROGMEM ={{ file_style_css, data_tcp_shtml , data_tcp_shtml +11, sizeof(data_tcp_shtml) -11}};
const struct httpd_fsdata_file file_upload_html[] PROGMEM ={{ file_tcp_shtml, data_upload_html , data_upload_html +13, sizeof(data_upload_html) -13}};
#define HTTPD_FS_ROOT file_upload_html
#define HTTPD_FS_NUMFILES 13
#define HTTPD_FS_SIZE 5623

View file

@ -0,0 +1,60 @@
/*
* Copyright (c) 2001, Swedish Institute of Computer Science.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the Institute nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* This file is part of the lwIP TCP/IP stack.
*
* Author: Adam Dunkels <adam@sics.se>
*
* $Id: httpd-fsdata.h,v 1.2 2009/06/19 17:11:28 dak664 Exp $
*/
#ifndef __HTTPD_FSDATA_H__
#define __HTTPD_FSDATA_H__
#include "contiki-net.h"
struct httpd_fsdata_file {
const struct httpd_fsdata_file *next;
const char *name;
const char *data;
const int len;
#if HTTPD_FS_STATISTICS == 1
u16_t count;
#endif /* HTTPD_FS_STATISTICS */
};
struct httpd_fsdata_file_noconst {
struct httpd_fsdata_file *next;
char *name;
char *data;
int len;
#if HTTPD_FS_STATISTICS == 1
u16_t count;
#endif /* HTTPD_FS_STATISTICS */
};
#endif /* __HTTPD_FSDATA_H__ */

View file

@ -0,0 +1,504 @@
/*
* Copyright (c) 2004, Adam Dunkels.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the Institute nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* This file is part of the Contiki operating system.
*
* Author: Adam Dunkels <adam@sics.se>
*
* $Id: httpd.c,v 1.6 2010/12/20 20:06:06 dak664 Exp $
*/
#include <string.h>
#include "contiki-net.h"
#include "webserver.h"
#include "httpd-fs.h"
#include "httpd-cgi.h"
#include "httpd.h"
#include "raven-lcd.h"
//#include "http-strings.h"
#if COFFEE_FILES
#include "cfs-coffee-arch.h"
#endif /* COFFEE_FILES */
/* DEBUGLOGIC is a convenient way to debug in a simulator without a tcp/ip connection.
* Break the program in the process loop and step from the entry in httpd_appcall.
* The input file is forced to /index.html and the output directed to TCPBUF.
* If cgi's are invoked define it in httpd-cgi.c as well!
* psock_generator_send in /core/net/psock.c must also be modified as follows:
* ...
* // Wait until all data is sent and acknowledged.
* if (!s->sendlen) break; //<---add this line
* PT_YIELD_UNTIL(&s->psockpt, uip_acked() || uip_rexmit());
* ...
*/
#define DEBUGLOGIC 0
#define DEBUG 0
#if DEBUGLOGIC
struct httpd_state *sg;
#define uip_mss(...) 512
#define uip_appdata TCPBUF
char TCPBUF[512];
#endif
#if DEBUG
#include <stdio.h>
#if HTTPD_STRING_TYPE==PROGMEM_TYPE
#define PRINTF(FORMAT,args...) printf_P(PSTR(FORMAT),##args)
#else
#define PRINTF printf
#endif
#else
#define PRINTF(...)
#endif
#ifndef WEBSERVER_CONF_CGI_CONNS
#define CONNS 4
#else
#define CONNS WEBSERVER_CONF_CGI_CONNS
#endif /* WEBSERVER_CONF_CGI_CONNS */
#define STATE_WAITING 0
#define STATE_OUTPUT 1
//#define SEND_STRING(s, str) PSOCK_SEND(s, (uint8_t *)str, (unsigned int)strlen(str))
MEMB(conns, struct httpd_state, CONNS);
/* MAX_SCRIPT_NAME_LENGTH should be at least be the maximum file name length+2 for %!: includes */
#define MAX_SCRIPT_NAME_LENGTH 20
#define ISO_tab 0x09
#define ISO_nl 0x0a
#define ISO_cr 0x0d
#define ISO_space 0x20
#define ISO_bang 0x21
#define ISO_percent 0x25
#define ISO_period 0x2e
#define ISO_slash 0x2f
#define ISO_colon 0x3a
/*---------------------------------------------------------------------------*/
static unsigned short
generate(void *state)
{
struct httpd_state *s = (struct httpd_state *)state;
if(s->file.len > uip_mss()) {
s->len = uip_mss();
} else {
s->len = s->file.len;
}
httpd_fs_cpy(uip_appdata, s->file.data, s->len);
#if DEBUGLOGIC
return 0;
#else
return s->len;
#endif
}
/*---------------------------------------------------------------------------*/
static
PT_THREAD(send_file(struct httpd_state *s))
{
PSOCK_BEGIN(&s->sout);
do {
PSOCK_GENERATOR_SEND(&s->sout, generate, s);
s->file.len -= s->len;
s->file.data += s->len;
} while(s->file.len > 0);
PSOCK_END(&s->sout);
}
/*---------------------------------------------------------------------------*/
static
PT_THREAD(send_part_of_file(struct httpd_state *s))
{
PSOCK_BEGIN(&s->sout);
static int oldfilelen, oldlen;
static char * olddata;
//Store stuff that gets clobbered...
oldfilelen = s->file.len;
oldlen = s->len;
olddata = s->file.data;
//How much to send
s->file.len = s->len;
do {
PSOCK_GENERATOR_SEND(&s->sout, generate, s);
s->file.len -= s->len;
s->file.data += s->len;
} while(s->file.len > 0);
s->len = oldlen;
s->file.len = oldfilelen;
s->file.data = olddata;
PSOCK_END(&s->sout);
}
/*---------------------------------------------------------------------------*/
static void
next_scriptstate(struct httpd_state *s)
{
char *p;
/* Skip over any script parameters to the beginning of the next line */
if((p = (char *)httpd_fs_strchr(s->scriptptr, ISO_nl)) != NULL) {
p += 1;
s->scriptlen -= (unsigned short)(p - s->scriptptr);
s->scriptptr = p;
} else {
s->scriptlen = 0;
}
/* char *p;
p = strchr(s->scriptptr, ISO_nl) + 1;
s->scriptlen -= (unsigned short)(p - s->scriptptr);
s->scriptptr = p;*/
}
/*---------------------------------------------------------------------------*/
char *
get_scriptname(char *dest, char *fromfile)
{
uint8_t i=0,skip=1;
/* Extract a file or cgi name, trim leading spaces and replace termination with zero */
/* Returns number of characters processed up to the next non-tab or space */
do {
dest[i]=httpd_fs_getchar(fromfile++);
if (dest[i]==ISO_colon) {if (!skip) break;} //allow leading colons
else if (dest[i]==ISO_tab ) {if (skip) continue;else break;}//skip leading tabs
else if (dest[i]==ISO_space) {if (skip) continue;else break;}//skip leading spaces
else if (dest[i]==ISO_nl ) break; //nl is preferred delimiter
else if (dest[i]==ISO_cr ) break; //some editors insert cr
else if (dest[i]==0 ) break; //files are terminated with null
else skip=0;
i++;
} while (i<(MAX_SCRIPT_NAME_LENGTH+1));
fromfile--;
while ((dest[i]==ISO_space) || (dest[i]==ISO_tab)) dest[i]=httpd_fs_getchar(++fromfile);
dest[i]=0;
return (fromfile);
}
/*---------------------------------------------------------------------------*/
static
PT_THREAD(handle_script(struct httpd_state *s))
{
/* Note script includes will attach a leading : to the filename and a trailing zero */
static char scriptname[MAX_SCRIPT_NAME_LENGTH+1],*pptr;
static uint16_t filelength;
PT_BEGIN(&s->scriptpt);
filelength=s->file.len;
while(s->file.len > 0) {
/* Sanity check */
if (s->file.len > filelength) break;
/* Check if we should start executing a script, flagged by %! */
if(httpd_fs_getchar(s->file.data) == ISO_percent &&
httpd_fs_getchar(s->file.data + 1) == ISO_bang) {
/* Extract name, if starts with colon include file else call cgi */
s->scriptptr=get_scriptname(scriptname,s->file.data+2);
s->scriptlen=s->file.len-(s->scriptptr-s->file.data);
PRINTF("httpd: Handle script named %s\n",scriptname);
if(scriptname[0] == ISO_colon) {
if (httpd_fs_open(&scriptname[1], &s->file)) {
PT_WAIT_THREAD(&s->scriptpt, send_file(s));
}
} else {
PT_WAIT_THREAD(&s->scriptpt,httpd_cgi(scriptname)(s, s->scriptptr));
}
next_scriptstate(s);
/* Reset the pointers and continue sending the current file. */
s->file.data = s->scriptptr;
s->file.len = s->scriptlen;
} else {
/* Send file up to the next potential script */
if(s->file.len > uip_mss()) {
s->len = uip_mss();
} else {
s->len = s->file.len;
}
if(httpd_fs_getchar(s->file.data) == ISO_percent) {
pptr = (char *) httpd_fs_strchr(s->file.data + 1, ISO_percent);
} else {
pptr = (char *) httpd_fs_strchr(s->file.data, ISO_percent);
}
if(pptr != NULL && pptr != s->file.data) {
s->len = (int)(pptr - s->file.data);
if(s->len >= uip_mss()) {
s->len = uip_mss();
}
}
PRINTF("httpd: Sending %u bytes from 0x%04x\n",s->file.len,(unsigned int)s->file.data);
PT_WAIT_THREAD(&s->scriptpt, send_part_of_file(s));
s->file.data += s->len;
s->file.len -= s->len;
}
}
PT_END(&s->scriptpt);
}
/*---------------------------------------------------------------------------*/
const char httpd_http[] HTTPD_STRING_ATTR = "HTTP/1.0 ";
const char httpd_server[] HTTPD_STRING_ATTR = "\r\nServer: Contiki/2.0 http://www.sics.se/contiki/\r\nConnection: close\r\n";
static unsigned short
generate_status(void *sstr)
{
uint8_t slen=httpd_strlen((char *)sstr);
httpd_memcpy(uip_appdata, httpd_http, sizeof(httpd_http)-1);
httpd_memcpy(uip_appdata+sizeof(httpd_http)-1, (char *)sstr, slen);
slen+=sizeof(httpd_http)-1;
httpd_memcpy(uip_appdata+slen, httpd_server, sizeof(httpd_server)-1);
#if DEBUGLOGIC
return 0;
#else
return slen+sizeof(httpd_server)-1;
#endif
}
/*---------------------------------------------------------------------------*/
const char httpd_content[] HTTPD_STRING_ATTR = "Content-type: ";
const char httpd_crlf[] HTTPD_STRING_ATTR = "\r\n\r\n";
static unsigned short
generate_header(void *hstr)
{
uint8_t slen=httpd_strlen((char *)hstr);
httpd_memcpy(uip_appdata,httpd_content,sizeof(httpd_content)-1);
httpd_memcpy(uip_appdata+sizeof(httpd_content)-1, (char *)hstr, slen);
slen+=sizeof(httpd_content)-1;
httpd_memcpy(uip_appdata+slen,httpd_crlf,sizeof(httpd_crlf)-1);
#if DEBUGLOGIC
return 0;
#else
return slen+4;
#endif
}
/*---------------------------------------------------------------------------*/
char http_htm[10] PROGMEM ="text/html";
char http_css[ 9] PROGMEM ="text/css";
const char httpd_mime_htm[] HTTPD_STRING_ATTR = "text/html";
const char httpd_mime_css[] HTTPD_STRING_ATTR = "text/css";
const char httpd_mime_png[] HTTPD_STRING_ATTR = "image/png";
const char httpd_mime_gif[] HTTPD_STRING_ATTR = "image/gif";
const char httpd_mime_jpg[] HTTPD_STRING_ATTR = "image/jpeg";
const char httpd_mime_txt[] HTTPD_STRING_ATTR = "text/plain";
const char httpd_mime_bin[] HTTPD_STRING_ATTR = "application/octet-stream";
const char httpd_jpg [] HTTPD_STRING_ATTR = "jpg";
const char httpd_shtml [] HTTPD_STRING_ATTR = ".shtml";
static
PT_THREAD(send_headers(struct httpd_state *s, const char *statushdr))
{
char *ptr;
PSOCK_BEGIN(&s->sout);
PSOCK_GENERATOR_SEND(&s->sout, generate_status, (char *)statushdr);
ptr = strrchr(s->filename, ISO_period);
if (httpd_strncmp("4", statushdr, 1)==0) {
PSOCK_GENERATOR_SEND(&s->sout, generate_header, &httpd_mime_htm );
} else if(ptr == NULL) {
PSOCK_GENERATOR_SEND(&s->sout, generate_header, &httpd_mime_bin );
} else {
ptr++;
if(httpd_strncmp(ptr, &httpd_mime_htm[5],3)== 0 ||httpd_strncmp(ptr, &httpd_shtml[1], 4) == 0) {
PSOCK_GENERATOR_SEND(&s->sout, generate_header, &httpd_mime_htm );
} else if(httpd_strcmp(ptr, &httpd_mime_css[5]) == 0) {
PSOCK_GENERATOR_SEND(&s->sout, generate_header, &httpd_mime_css );
} else if(httpd_strcmp(ptr, &httpd_mime_png[6]) == 0) {
PSOCK_GENERATOR_SEND(&s->sout, generate_header, &httpd_mime_png );
} else if(httpd_strcmp(ptr, &httpd_mime_gif[6])== 0) {
PSOCK_GENERATOR_SEND(&s->sout, generate_header, &httpd_mime_gif );
} else if(httpd_strcmp(ptr, httpd_mime_jpg) == 0) {
PSOCK_GENERATOR_SEND(&s->sout, generate_header, &httpd_mime_jpg );
} else {
PSOCK_GENERATOR_SEND(&s->sout, generate_header, &httpd_mime_txt);
}
}
PSOCK_END(&s->sout);
}
/*---------------------------------------------------------------------------*/
const char httpd_indexfn [] HTTPD_STRING_ATTR = "/index.html";
const char httpd_404fn [] HTTPD_STRING_ATTR = "/404.html";
const char httpd_404notf [] HTTPD_STRING_ATTR = "404 Not found";
const char httpd_200ok [] HTTPD_STRING_ATTR = "200 OK";
static
PT_THREAD(handle_output(struct httpd_state *s))
{
char *ptr;
PT_BEGIN(&s->outputpt);
#if DEBUGLOGIC
httpd_strcpy(s->filename,httpd_indexfn);
#endif
if(!httpd_fs_open(s->filename, &s->file)) {
httpd_strcpy(s->filename, httpd_404fn);
httpd_fs_open(s->filename, &s->file);
PT_WAIT_THREAD(&s->outputpt, send_headers(s, httpd_404notf));
PT_WAIT_THREAD(&s->outputpt, send_file(s));
} else {
PT_WAIT_THREAD(&s->outputpt, send_headers(s, httpd_200ok));
ptr = strchr(s->filename, ISO_period);
if((ptr != NULL && httpd_strncmp(ptr, httpd_shtml, 6) == 0) || httpd_strcmp(s->filename,httpd_indexfn)==0) {
PT_INIT(&s->scriptpt);
PT_WAIT_THREAD(&s->outputpt, handle_script(s));
} else {
PT_WAIT_THREAD(&s->outputpt, send_file(s));
}
}
PSOCK_CLOSE(&s->sout);
PT_END(&s->outputpt);
}
/*---------------------------------------------------------------------------*/
const char httpd_get[] HTTPD_STRING_ATTR = "GET ";
const char httpd_ref[] HTTPD_STRING_ATTR = "Referer:";
static
PT_THREAD(handle_input(struct httpd_state *s))
{
PSOCK_BEGIN(&s->sin);
PSOCK_READTO(&s->sin, ISO_space);
if(httpd_strncmp(s->inputbuf, httpd_get, 4) != 0) {
PSOCK_CLOSE_EXIT(&s->sin);
}
PSOCK_READTO(&s->sin, ISO_space);
if(s->inputbuf[0] != ISO_slash) {
PSOCK_CLOSE_EXIT(&s->sin);
}
if(s->inputbuf[1] == ISO_space) {
httpd_strcpy(s->filename, httpd_indexfn);
} else {
s->inputbuf[PSOCK_DATALEN(&s->sin) - 1] = 0;
strncpy(s->filename, &s->inputbuf[0], sizeof(s->filename));
{
/* Look for ?, if found strip file name and send any following text to the LCD */
uint8_t i;
for (i=0;i<sizeof(s->inputbuf);i++) {
if (s->inputbuf[i]=='?') {
raven_lcd_show_text(&s->inputbuf[i]);
if (i<sizeof(s->filename)) s->filename[i]=0;
// s->inputbuf[i]=0; //allow multiple beeps with multiple ?'s
}
if (s->inputbuf[i]==0) break;
}
}
}
webserver_log_file(&uip_conn->ripaddr, s->filename);
s->state = STATE_OUTPUT;
while(1) {
PSOCK_READTO(&s->sin, ISO_nl);
if(httpd_strncmp(s->inputbuf, httpd_ref, 8) == 0) {
s->inputbuf[PSOCK_DATALEN(&s->sin) - 2] = 0;
petsciiconv_topetscii(s->inputbuf, PSOCK_DATALEN(&s->sin) - 2);
webserver_log(s->inputbuf);
}
}
PSOCK_END(&s->sin);
}
/*---------------------------------------------------------------------------*/
static void
handle_connection(struct httpd_state *s)
{
#if DEBUGLOGIC
handle_output(s);
#else
handle_input(s);
if(s->state == STATE_OUTPUT) {
handle_output(s);
}
#endif
}
/*---------------------------------------------------------------------------*/
void
httpd_appcall(void *state)
{
#if DEBUGLOGIC
struct httpd_state *s; //Enter here for debugging with output directed to TCPBUF
s = sg = (struct httpd_state *)memb_alloc(&conns);
if (1) {
#else
struct httpd_state *s = (struct httpd_state *)state;
if(uip_closed() || uip_aborted() || uip_timedout()) {
if(s != NULL) {
memb_free(&conns, s);
}
} else if(uip_connected()) {
s = (struct httpd_state *)memb_alloc(&conns);
if(s == NULL) {
uip_abort();
return;
}
#endif
tcp_markconn(uip_conn, s);
PSOCK_INIT(&s->sin, (uint8_t *)s->inputbuf, sizeof(s->inputbuf) - 1);
PSOCK_INIT(&s->sout, (uint8_t *)s->inputbuf, sizeof(s->inputbuf) - 1);
PT_INIT(&s->outputpt);
s->state = STATE_WAITING;
/* timer_set(&s->timer, CLOCK_SECOND * 100);*/
s->timer = 0;
handle_connection(s);
} else if(s != NULL) {
if(uip_poll()) {
++s->timer;
if(s->timer >= 20) {
uip_abort();
memb_free(&conns, s);
}
} else {
s->timer = 0;
}
handle_connection(s);
} else {
uip_abort();
}
}
/*---------------------------------------------------------------------------*/
void
httpd_init(void)
{
tcp_listen(UIP_HTONS(80));
memb_init(&conns);
httpd_cgi_init();
}
/*---------------------------------------------------------------------------*/

View file

@ -0,0 +1,94 @@
/*
* Copyright (c) 2001-2005, Adam Dunkels.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote
* products derived from this software without specific prior
* written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This file is part of the uIP TCP/IP stack.
*
* $Id: httpd.h,v 1.4 2009/07/24 15:41:52 dak664 Exp $
*
*/
#ifndef __HTTPD_H__
#define __HTTPD_H__
#include "contiki-net.h"
#include "httpd-fs.h"
#include "lib/petsciiconv.h"
struct httpd_state {
unsigned char timer;
struct psock sin, sout;
struct pt outputpt, scriptpt;
char inputbuf[50];
char filename[20];
char state;
struct httpd_fs_file file;
int len;
char *scriptptr;
int scriptlen;
union {
unsigned short count;
void *ptr;
} u;
};
/* httpd string storage is in RAM by default. Other storage can be defined here */
#define HTTPD_STRING_TYPE PROGMEM_TYPE
#define PROGMEM_TYPE 1
#define EEPROM_TYPE 2
#if HTTPD_STRING_TYPE==PROGMEM_TYPE
#define HTTPD_STRING_ATTR PROGMEM
/* These will fail if the server strings are above 64K in program flash */
#define httpd_memcpy memcpy_P
#define httpd_strcpy strcpy_P
#define httpd_strcmp strcmp_P
#define httpd_strncmp strncmp_P
#define httpd_strlen strlen_P
#define httpd_snprintf snprintf_P
#elif HTTPD_STRING_TYPE==EEPROM_TYPE
#define HTTPD_STRING_ATTR EEPROM
/* These are not implemented as yet */
#define httpd_memcpy memcpy_E
#define httpd_strcpy strcpy_E
#define httpd_strcmp strcmp_E
#define httpd_strncmp strncmp_E
#define httpd_strlen strlen_E
#define httpd_snprintf snprintf_E
#else
#define httpd_memcpy memcpy
#define httpd_strcpy strcpy
#define httpd_strcmp strcmp
#define httpd_strncmp strncmp
#define httpd_strlen strlen
#define httpd_snprintf snprintf
#endif
void httpd_init(void);
void httpd_appcall(void *state);
#endif /* __HTTPD_H__ */

View file

@ -0,0 +1,73 @@
/*
* Copyright (c) 2003, Adam Dunkels.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
* 3. The name of the author may not be used to endorse or promote
* products derived from this software without specific prior
* written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This file is part of the Contiki desktop environment
*
* $Id: webserver-dsc.c,v 1.1 2009/03/12 19:15:25 adamdunkels Exp $
*
*/
#include "sys/dsc.h"
/*-----------------------------------------------------------------------------------*/
#if CTK_CONF_ICON_BITMAPS
static unsigned char webservericon_bitmap[3*3*8] = {
0x00, 0x7f, 0x40, 0x41, 0x44, 0x48, 0x40, 0x50,
0x00, 0xff, 0x5a, 0x00, 0x00, 0x00, 0x3c, 0x81,
0x00, 0xfe, 0x02, 0x82, 0x22, 0x12, 0x02, 0x0a,
0x41, 0x60, 0x42, 0x62, 0x62, 0x42, 0x60, 0x41,
0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x18, 0x18,
0x82, 0x06, 0x42, 0x46, 0x46, 0x42, 0x06, 0x82,
0x50, 0x40, 0x48, 0x44, 0x41, 0x40, 0x7e, 0x00,
0xc5, 0x34, 0x3c, 0x52, 0x7a, 0x7e, 0xa1, 0xfd,
0x0a, 0x02, 0x12, 0x22, 0x82, 0x02, 0x7e, 0x00
};
#endif /* CTK_CONF_ICON_BITMAPS */
#if CTK_CONF_ICON_TEXTMAPS
static char webservericon_textmap[9] = {
'+', '-', '+',
'|', ')', '|',
'+', '-', '+'
};
#endif /* CTK_CONF_ICON_TEXTMAPS */
#if CTK_CONF_ICONS
static struct ctk_icon webserver_icon =
{CTK_ICON("Web server", webservericon_bitmap, webservericon_textmap)};
#endif /* CTK_CONF_ICONS */
/*-----------------------------------------------------------------------------------*/
DSC(webserver_dsc,
"The Contiki web server",
"webserver.prg",
webserver_process,
&webserver_icon);
/*-----------------------------------------------------------------------------------*/

View file

@ -0,0 +1,42 @@
/*
* Copyright (c) 2003, Adam Dunkels.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
* 3. The name of the author may not be used to endorse or promote
* products derived from this software without specific prior
* written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This file is part of the Contiki desktop environment
*
* $Id: webserver-dsc.h,v 1.1 2009/03/12 19:15:25 adamdunkels Exp $
*
*/
#ifndef __WEBSERVER_DSC_H__
#define __WEBSERVER_DSC_H__
#include "sys/dsc.h"
DSC_HEADER(webserver_dsc);
#endif /* __WEBSERVER_DSC_H__ */

View file

@ -0,0 +1,94 @@
/*
* Copyright (c) 2002, Adam Dunkels.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
* 3. The name of the author may not be used to endorse or promote
* products derived from this software without specific prior
* written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This file is part of the Contiki OS.
*
* $Id: webserver-nogui.c,v 1.3 2010/02/09 14:41:18 dak664 Exp $
*
*/
#include <string.h>
#include <stdio.h>
#include "contiki.h"
#include "sys/log.h"
#include "http-strings.h"
#include "webserver-nogui.h"
#include "httpd.h"
#include "httpd-cgi.h"
PROCESS(webserver_nogui_process, "Web server");
AUTOSTART_PROCESSES(&webserver_nogui_process);
/*---------------------------------------------------------------------------*/
PROCESS_THREAD(webserver_nogui_process, ev, data)
{
PROCESS_BEGIN();
httpd_init();
while(1) {
PROCESS_WAIT_EVENT_UNTIL(ev == tcpip_event);
httpd_appcall(data);
}
PROCESS_END();
}
/*---------------------------------------------------------------------------*/
void
webserver_log_file(uip_ipaddr_t *requester, char *file)
{
/* Print out IP address of requesting host. */
#if LOG_CONF_ENABLED
#if UIP_CONF_IPV6
char buf[48];
uint8_t j;
j=httpd_cgi_sprint_ip6((uip_ip6addr_t)*requester, buf);
buf[j]=':';buf[j+1]=' ';buf[j+2]=0;
#else
char buf[20];
sprintf(buf, "%d.%d.%d.%d: ", requester->u8[0], requester->u8[1],
requester->u8[2], requester->u8[3]);
#endif /* UIP_CONF_IPV6 */
log_message(buf, file);
#endif /* LOG_CONF_ENABLED */
}
/*---------------------------------------------------------------------------*/
void
webserver_log(char *msg)
{
log_message(msg, "");
}
/*---------------------------------------------------------------------------*/

View file

@ -0,0 +1,46 @@
/*
* Copyright (c) 2002, Adam Dunkels.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
* 3. The name of the author may not be used to endorse or promote
* products derived from this software without specific prior
* written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This file is part of the Contiki OS
*
* $Id: webserver-nogui.h,v 1.1 2009/03/12 19:15:25 adamdunkels Exp $
*
*/
#ifndef __WEBSERVER_NOGUI_H__
#define __WEBSERVER_NOGUI_H__
#include "contiki-net.h"
PROCESS_NAME(webserver_nogui_process);
PROCESS_NAME(raven_lcd_process);
void webserver_log(char *msg);
void webserver_log_file(uip_ipaddr_t *requester, char *file);
#endif /* __WEBSERVER_H__ */

View file

@ -0,0 +1,127 @@
/*
* Copyright (c) 2002, Adam Dunkels.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
* 3. The name of the author may not be used to endorse or promote
* products derived from this software without specific prior
* written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This file is part of the Contiki desktop environment for the C64.
*
* $Id: webserver.c,v 1.1 2009/03/12 19:15:25 adamdunkels Exp $
*
*/
#include <string.h>
#include <stdio.h>
#include "contiki.h"
#include "ctk/ctk.h"
#include "http-strings.h"
#include "webserver.h"
#include "httpd.h"
/* The main window. */
static struct ctk_window mainwindow;
static struct ctk_label message =
{CTK_LABEL(0, 0, 15, 1, "Latest requests")};
PROCESS(webserver_process, "Web server");
AUTOSTART_PROCESSES(&webserver_process);
#define LOG_WIDTH 38
#define LOG_HEIGHT 16
static char log[LOG_WIDTH*LOG_HEIGHT];
static struct ctk_label loglabel =
{CTK_LABEL(0, 1, LOG_WIDTH, LOG_HEIGHT, log)};
/*-----------------------------------------------------------------------------------*/
PROCESS_THREAD(webserver_process, ev, data)
{
PROCESS_BEGIN();
ctk_window_new(&mainwindow, LOG_WIDTH, LOG_HEIGHT+1, "Web server");
CTK_WIDGET_ADD(&mainwindow, &message);
CTK_WIDGET_ADD(&mainwindow, &loglabel);
httpd_init();
ctk_window_open(&mainwindow);
while(1) {
PROCESS_WAIT_EVENT();
if(ev == ctk_signal_window_close ||
ev == PROCESS_EVENT_EXIT) {
ctk_window_close(&mainwindow);
process_exit(&webserver_process);
LOADER_UNLOAD();
} else if(ev == tcpip_event) {
httpd_appcall(data);
}
}
PROCESS_END();
}
/*-----------------------------------------------------------------------------------*/
void
webserver_log_file(uip_ipaddr_t *requester, char *file)
{
int size;
/* Scroll previous entries upwards */
memcpy(log, &log[LOG_WIDTH], LOG_WIDTH * (LOG_HEIGHT - 1));
/* Print out IP address of requesting host. */
size = sprintf(&log[LOG_WIDTH * (LOG_HEIGHT - 1)],
"%d.%d.%d.%d: ",
requester->u8[0],
requester->u8[1],
requester->u8[2],
requester->u8[3]);
/* Copy filename into last line. */
strncpy(&log[LOG_WIDTH * (LOG_HEIGHT - 1) + size], file, LOG_WIDTH - size);
/* Update log display. */
CTK_WIDGET_REDRAW(&loglabel);
}
/*-----------------------------------------------------------------------------------*/
void
webserver_log(char *msg)
{
/* Scroll previous entries upwards */
memcpy(log, &log[LOG_WIDTH], LOG_WIDTH * (LOG_HEIGHT - 1));
/* Copy filename into last line. */
strncpy(&log[LOG_WIDTH * (LOG_HEIGHT - 1)], msg, LOG_WIDTH);
/* Update log display. */
CTK_WIDGET_REDRAW(&loglabel);
}
/*-----------------------------------------------------------------------------------*/

View file

@ -0,0 +1,45 @@
/*
* Copyright (c) 2002, Adam Dunkels.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
* 3. The name of the author may not be used to endorse or promote
* products derived from this software without specific prior
* written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This file is part of the Contiki operating system
*
* $Id: webserver.h,v 1.1 2009/03/12 19:15:25 adamdunkels Exp $
*
*/
#ifndef __WEBSERVER_H__
#define __WEBSERVER_H__
#include "contiki-net.h"
PROCESS_NAME(webserver_process);
void webserver_log(char *msg);
void webserver_log_file(uip_ipaddr_t *requester, char *file);
#endif /* __WEBSERVER_H__ */