Added examples for MB851 platform.

This commit is contained in:
salvopitru 2010-10-25 13:34:28 +00:00
parent 9ecc0437f4
commit a61a9459ea
31 changed files with 1668 additions and 0 deletions

View File

@ -0,0 +1,6 @@
CONTIKI_PROJECT = acc-example
all: $(CONTIKI_PROJECT)
CONTIKI = ../../..
include $(CONTIKI)/Makefile.include

View File

@ -0,0 +1 @@
TARGET = mb851

View File

@ -0,0 +1,81 @@
/*
* Copyright (c) 2010, STMicroelectronics.
* 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.
*
* $Id: acc-example.c,v 1.1 2010/10/25 13:34:28 salvopitru Exp $
*/
/**
* \file
* Example showing use of the accelerometer.
* \author
* Salvatore Pitrulli <salvopitru@users.sourceforge.net>
*
*/
#include "contiki.h"
#include "dev/acc-sensor.h"
#include <stdio.h> /* For printf() */
/*---------------------------------------------------------------------------*/
PROCESS(acc_process, "Accelerometer process");
AUTOSTART_PROCESSES(&acc_process);
/*---------------------------------------------------------------------------*/
PROCESS_THREAD(acc_process, ev, data)
{
static struct etimer etimer;
PROCESS_BEGIN();
printf("Starting measuring acceleration\r\n");
SENSORS_ACTIVATE(acc_sensor);
// Enable High Range.
//acc_sensor.configure(ACC_RANGE, ACC_HIGH_RANGE);
// Enable High Pass Filter.
//acc_sensor.configure(ACC_HPF, ACC_1HZ);
while(1) {
etimer_set(&etimer, CLOCK_SECOND/2);
PROCESS_WAIT_UNTIL(etimer_expired(&etimer));
printf("(X,Y,Z): (%d,%d,%d) mg \r",acc_sensor.value(ACC_X_AXIS),acc_sensor.value(ACC_Y_AXIS),acc_sensor.value(ACC_Z_AXIS));
}
PROCESS_END();
}
/*---------------------------------------------------------------------------*/

View File

@ -0,0 +1,6 @@
CONTIKI_PROJECT = test-button
all: $(CONTIKI_PROJECT)
CONTIKI = ../../..
include $(CONTIKI)/Makefile.include

View File

@ -0,0 +1 @@
TARGET = mb851

View File

@ -0,0 +1,67 @@
/*
* Copyright (c) 2010, STMicroelectronics.
* 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.
*
* $Id: test-button.c,v 1.1 2010/10/25 13:34:29 salvopitru Exp $
*/
/**
* \file
* Example showing use of the button on board.
* \author
* Salvatore Pitrulli <salvopitru@users.sourceforge.net>
*
*/
#include "contiki.h"
#include "dev/button-sensor.h"
#include "dev/leds.h"
#include <stdio.h>
/*---------------------------------------------------------------------------*/
PROCESS(test_button_process, "Test button");
AUTOSTART_PROCESSES(&test_button_process);
/*---------------------------------------------------------------------------*/
PROCESS_THREAD(test_button_process, ev, data)
{
PROCESS_BEGIN();
SENSORS_ACTIVATE(button_sensor);
printf("Press the button to toggle the leds.");
while(1) {
PROCESS_WAIT_EVENT_UNTIL(ev == sensors_event &&
data == &button_sensor);
leds_toggle(LEDS_ALL);
}
PROCESS_END();
}
/*---------------------------------------------------------------------------*/

View File

@ -0,0 +1,12 @@
CONTIKI_PROJECT = mb851-shell
PROJECTDIRS = $(CONTIKI)/platform/mb851/apps
APPS = serial-shell
PROJECT_SOURCEFILES = shell-sensors.c
all: $(CONTIKI_PROJECT)
CONTIKI = ../../..
include $(CONTIKI)/Makefile.include

View File

@ -0,0 +1 @@
TARGET = mb851

View File

@ -0,0 +1,65 @@
/*
* Copyright (c) 2010, STMicroelectronics.
* 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.
*
* $Id: mb851-shell.c,v 1.1 2010/10/25 13:34:29 salvopitru Exp $
*/
/**
* \file
* MB851-specific Contiki shell
* \author
* Salvatore Pitrulli <salvopitru@users.sourceforge.net>
*
*/
#include "contiki.h"
#include "serial-shell.h"
#include "shell-sensors.h"
/*---------------------------------------------------------------------------*/
PROCESS(mb851_shell_process, "MB851 Contiki shell");
AUTOSTART_PROCESSES(&mb851_shell_process);
/*---------------------------------------------------------------------------*/
PROCESS_THREAD(mb851_shell_process, ev, data)
{
PROCESS_BEGIN();
serial_shell_init();
shell_blink_init();
shell_ps_init();
shell_reboot_init();
shell_text_init();
shell_time_init();
shell_sensors_init();
PROCESS_END();
}
/*---------------------------------------------------------------------------*/

View File

@ -0,0 +1,14 @@
CONTIKI_PROJECT = telnet-server
UIP_CONF_IPV6=1
APPS = telnetd
PROJECTDIRS = $(CONTIKI)/platform/mb851/apps
PROJECT_SOURCEFILES = shell-sensors.c
all: $(CONTIKI_PROJECT)
CONTIKI = ../../..
include $(CONTIKI)/Makefile.include

View File

@ -0,0 +1 @@
TARGET = mb851

View File

@ -0,0 +1,67 @@
/*
* Copyright (c) 2006, 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 Contiki operating system.
*
* $Id: telnet-server.c,v 1.1 2010/10/25 13:34:29 salvopitru Exp $
*/
/**
* \file
* Example showing how to use the Telnet server
* \author
* Adam Dunkels <adam@sics.se>
*/
#include "contiki-net.h"
#include "telnetd.h"
#include "shell.h"
#include "shell-sensors.h"
/*---------------------------------------------------------------------------*/
PROCESS(shell_init_process, "Shell init process");
/*---------------------------------------------------------------------------*/
PROCESS_THREAD(shell_init_process, ev, data)
{
PROCESS_BEGIN();
shell_blink_init();
shell_ps_init();
shell_reboot_init();
//shell_text_init();
//shell_time_init();
shell_sensors_init();
PROCESS_END();
}
/*---------------------------------------------------------------------------*/
AUTOSTART_PROCESSES(&telnetd_process, &shell_init_process);
/*---------------------------------------------------------------------------*/

View File

@ -0,0 +1,6 @@
CONTIKI_PROJECT = temp-sensor
all: $(CONTIKI_PROJECT)
CONTIKI = ../../..
include $(CONTIKI)/Makefile.include

View File

@ -0,0 +1 @@
TARGET = mb851

View File

@ -0,0 +1,74 @@
/*
* Copyright (c) 2010, STMicroelectronics.
* 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.
*
* $Id: temp-sensor.c,v 1.1 2010/10/25 13:34:29 salvopitru Exp $
*/
/**
* \file
* A very simple Contiki application showing how to use the temperature
* sensor.
* \author
* Salvatore Pitrulli <salvopitru@users.sourceforge.net>
*
*/
#include "contiki.h"
#include "dev/temperature-sensor.h"
#include <stdio.h> /* For printf() */
/*---------------------------------------------------------------------------*/
PROCESS(temp_process, "Temperature process");
AUTOSTART_PROCESSES(&temp_process);
/*---------------------------------------------------------------------------*/
PROCESS_THREAD(temp_process, ev, data)
{
static struct etimer etimer;
PROCESS_BEGIN();
printf("Starting measuring temperature\r\n");
while(1) {
etimer_set(&etimer, CLOCK_SECOND);
PROCESS_WAIT_UNTIL(etimer_expired(&etimer));
unsigned int temp = temperature_sensor.value(0);
printf("Temp: %d.%d °C \r",temp/10,temp-(temp/10)*10);
}
PROCESS_END();
}
/*---------------------------------------------------------------------------*/

View File

@ -0,0 +1,17 @@
CONTIKI_PROJECT = mb851-webserver
all: $(CONTIKI_PROJECT)
DEFINES=PROJECT_CONF_H=\"webserver-ajax-conf.h\"
UIP_CONF_IPV6=1
#APPS = webserver
PROJECTDIRS = . $(CONTIKI)/apps/webserver
PROJECT_SOURCEFILES = ajax-cgi.c httpd-fs.c http-strings.c \
httpd.c webserver-dsc.c webserver-nogui.c
CONTIKI = ../../..
include $(CONTIKI)/Makefile.include

View File

@ -0,0 +1 @@
TARGET = mb851

View File

@ -0,0 +1,9 @@
Compile with WITH_RIME 1 for neighbor discovery and with ENERGEST_CONF_ON
for energy estimation.
Estimated consumption with batteries (2.4 V):
Curr Power
ENERGEST_TYPE_CPU: 7.5 mA 18 mW
ENERGEST_TYPE_LPM: 3 mA 7.2 mW
ENERGEST_TYPE_TRANSMIT: 21 mA 50.4 mW
ENERGEST_TYPE_LISTEN: 19 mA 45.6 mW

View File

@ -0,0 +1,288 @@
/*
* 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: ajax-cgi.c,v 1.1 2010/10/25 13:34:29 salvopitru Exp $
*
*/
/*
* 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 "net/rime/collect-neighbor.h"
#include "httpd.h"
#include "httpd-cgi.h"
#include "httpd-fs.h"
#include "lib/petsciiconv.h"
#include "dev/temperature-sensor.h"
#include "dev/acc-sensor.h"
static struct httpd_cgi_call *calls = NULL;
/*---------------------------------------------------------------------------*/
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(strncmp(f->name, name, strlen(f->name)) == 0) {
return f->function;
}
}
return nullfunction;
}
/*---------------------------------------------------------------------------*/
static
PT_THREAD(nodeidcall(struct httpd_state *s, char *ptr))
{
static char buf[24];
PSOCK_BEGIN(&s->sout);
snprintf(buf, sizeof(buf), "%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X",
rimeaddr_node_addr.u8[0],
rimeaddr_node_addr.u8[1],
rimeaddr_node_addr.u8[2],
rimeaddr_node_addr.u8[3],
rimeaddr_node_addr.u8[4],
rimeaddr_node_addr.u8[5],
rimeaddr_node_addr.u8[6],
rimeaddr_node_addr.u8[7]);
PSOCK_SEND_STR(&s->sout, buf);
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;
}
}
/*---------------------------------------------------------------------------*/
static
PT_THREAD(sensorscall(struct httpd_state *s, char *ptr))
{
static struct timer t;
static int i;
static char buf[100];
static unsigned long last_cpu, last_lpm, last_listen, last_transmit;
PSOCK_BEGIN(&s->sout);
timer_set(&t, CLOCK_SECOND);
SENSORS_ACTIVATE(acc_sensor);
snprintf(buf, sizeof(buf),
"t(%d);ax(%d);ay(%d);az(%d);",
temperature_sensor.value(0),
acc_sensor.value(ACC_X_AXIS),
acc_sensor.value(ACC_Y_AXIS),
acc_sensor.value(ACC_Z_AXIS));
SENSORS_DEACTIVATE(acc_sensor);
PSOCK_SEND_STR(&s->sout, buf);
snprintf(buf, sizeof(buf),
"p(%lu,%lu,%lu,%lu);v(%d);",
energest_type_time(ENERGEST_TYPE_CPU) - last_cpu,
energest_type_time(ENERGEST_TYPE_LPM) - last_lpm,
energest_type_time(ENERGEST_TYPE_TRANSMIT) - last_transmit,
energest_type_time(ENERGEST_TYPE_LISTEN) - last_listen,
i++);
last_cpu = energest_type_time(ENERGEST_TYPE_CPU);
last_lpm = energest_type_time(ENERGEST_TYPE_LPM);
last_transmit = energest_type_time(ENERGEST_TYPE_TRANSMIT);
last_listen = energest_type_time(ENERGEST_TYPE_LISTEN);
PSOCK_SEND_STR(&s->sout, buf);
PSOCK_END(&s->sout);
}
/*---------------------------------------------------------------------------*/
#if 0
static unsigned short
make_neighbor(void *arg)
{
struct httpd_state *s = (struct httpd_state *)arg;
struct collect_neighbor *n = collect_neighbor_get(s->u.count);
if(n == NULL) {
return 0;
}
#if !UIP_CONF_IPV6
return snprintf((char *)uip_appdata, uip_mss(),
"<li><a href=\"http://172.16.%d.%d/\">%d.%d</a>\r\n",
n->addr.u8[0], n->addr.u8[1],
n->addr.u8[0], n->addr.u8[1]);
#else
#if 0
uip_ipaddr_t ipaddr;
char ipaddr_str[41];
uip_ip6addr(&ipaddr, NET_ADDR_A, NET_ADDR_B, NET_ADDR_C, NET_ADDR_D,
(u16_t)(((u16_t)(n->addr.u8[0]^0x02))<<8 | (u16_t)n->addr.u8[1]),
((u16_t)(n->addr.u8[2]))<<8 | (u16_t)n->addr.u8[3],
(u16_t)(n->addr.u8[4])<<8 | n->addr.u8[5],
(u16_t)(n->addr.u8[6])<<8 | n->addr.u8[7]);
httpd_sprint_ip6(ipaddr, ipaddr_str);
return snprintf((char *)uip_appdata, uip_mss(),
"<li><a href=\"http://%s/\">%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X</a>\r\n",
ipaddr_str,
n->addr.u8[0],
n->addr.u8[1],
n->addr.u8[2],
n->addr.u8[3],
n->addr.u8[4],
n->addr.u8[5],
n->addr.u8[6],
n->addr.u8[7]);
#endif
/* Automatic generation of node address. Javascript funcion required.
* Client-side generation is simpler than server-side, as parsing http header
* would be requied.
*/
return snprintf((char *)uip_appdata, uip_mss(),
"<li><a id=node name='%x:%x:%x:%x'>%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X</a>\r\n",
(u16_t)(((u16_t)(n->addr.u8[0]^0x02))<<8 | (u16_t)n->addr.u8[1]),
((u16_t)(n->addr.u8[2]))<<8 | (u16_t)n->addr.u8[3],
(u16_t)(n->addr.u8[4])<<8 | n->addr.u8[5],
(u16_t)(n->addr.u8[6])<<8 | n->addr.u8[7],
n->addr.u8[0],
n->addr.u8[1],
n->addr.u8[2],
n->addr.u8[3],
n->addr.u8[4],
n->addr.u8[5],
n->addr.u8[6],
n->addr.u8[7]);
#endif /* UIP_CONF_IPV6 */
}
/*---------------------------------------------------------------------------*/
static
PT_THREAD(neighborscall(struct httpd_state *s, char *ptr))
{
PSOCK_BEGIN(&s->sout);
announcement_listen(1);
/* printf("neighbor_num %d\n", neighbor_num());*/
for(s->u.count = 0; s->u.count < collect_neighbor_num(); s->u.count++) {
/* printf("count %d\n", s->u.count);*/
if(collect_neighbor_get(s->u.count) != NULL) {
/* printf("!= NULL\n");*/
PSOCK_GENERATOR_SEND(&s->sout, make_neighbor, s);
}
}
PSOCK_END(&s->sout);
}
/*---------------------------------------------------------------------------*/
static void
received_announcement(struct announcement *a, const rimeaddr_t *from,
uint16_t id, uint16_t value)
{
struct collect_neighbor *n;
/* printf("adv_received %d.%d\n", from->u8[0], from->u8[1]);*/
n = collect_neighbor_find(from);
if(n == NULL) {
collect_neighbor_add(from, value, 1);
} else {
collect_neighbor_update(n, value);
}
}
#endif
/*static const struct neighbor_discovery_callbacks neighbor_discovery_callbacks =
{ adv_received, NULL};*/
HTTPD_CGI_CALL(sensors, "sensors", sensorscall);
HTTPD_CGI_CALL(nodeid, "nodeid", nodeidcall);
//HTTPD_CGI_CALL(neighbors, "neighbors", neighborscall);
/*static struct neighbor_discovery_conn conn;*/
//static struct announcement announcement;
void
httpd_cgi_init(void)
{
httpd_cgi_add(&sensors);
httpd_cgi_add(&nodeid);
/* httpd_cgi_add(&neighbors);
announcement_register(&announcement, 31,
received_announcement);
announcement_listen(2);*/
/* neighbor_discovery_open(&conn, 31,
CLOCK_SECOND * 4,
CLOCK_SECOND * 20,
CLOCK_SECOND * 60,
&neighbor_discovery_callbacks);
neighbor_discovery_start(&conn, 0);*/
}
/*---------------------------------------------------------------------------*/

View File

@ -0,0 +1,128 @@
/*
* 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.1 2010/10/25 13:34:29 salvopitru Exp $
*/
#include "contiki-net.h"
#include "httpd.h"
#include "httpd-fs.h"
#include "httpd-fsdata.h"
#include "httpd-fsdata.c"
#if HTTPD_FS_STATISTICS
static u16_t count[HTTPD_FS_NUMFILES];
#endif /* HTTPD_FS_STATISTICS */
/*-----------------------------------------------------------------------------------*/
static u8_t
httpd_fs_strcmp(const char *str1, const char *str2)
{
u8_t i;
i = 0;
loop:
if(str2[i] == 0 ||
str1[i] == '\r' ||
str1[i] == '\n') {
return 0;
}
if(str1[i] != str2[i]) {
return 1;
}
++i;
goto loop;
}
/*-----------------------------------------------------------------------------------*/
int
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;
for(f = (struct httpd_fsdata_file_noconst *)HTTPD_FS_ROOT;
f != NULL;
f = (struct httpd_fsdata_file_noconst *)f->next) {
if(httpd_fs_strcmp(name, f->name) == 0) {
file->data = f->data;
file->len = f->len - 1;
#if HTTPD_FS_STATISTICS
++count[i];
#endif /* HTTPD_FS_STATISTICS */
return 1;
}
#if HTTPD_FS_STATISTICS
++i;
#endif /* HTTPD_FS_STATISTICS */
}
return 0;
}
/*-----------------------------------------------------------------------------------*/
void
httpd_fs_init(void)
{
#if HTTPD_FS_STATISTICS
u16_t i;
for(i = 0; i < HTTPD_FS_NUMFILES; i++) {
count[i] = 0;
}
#endif /* HTTPD_FS_STATISTICS */
}
/*-----------------------------------------------------------------------------------*/
#if HTTPD_FS_STATISTICS
u16_t
httpd_fs_count(char *name)
{
struct httpd_fsdata_file_noconst *f;
u16_t i;
i = 0;
for(f = (struct httpd_fsdata_file_noconst *)HTTPD_FS_ROOT;
f != NULL;
f = (struct httpd_fsdata_file_noconst *)f->next) {
if(httpd_fs_strcmp(name, f->name) == 0) {
return count[i];
}
++i;
}
return 0;
}
#endif /* HTTPD_FS_STATISTICS */
/*-----------------------------------------------------------------------------------*/

View File

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

View File

@ -0,0 +1,3 @@
</table>
</body>
</html>

View File

@ -0,0 +1,12 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Contiki</title>
</head>
<body bgcolor="white" onload="load()">
<table border=0 cellpadding=4 cellspacing=4><tr><td valign="top" align="right">
<h1>Contiki&nbsp;</h1>
<a href="/">Front page</a><br>
<a href="neighbors.shtml">Neighbors</a><br>
<a href="sensors.shtml">Sensors</a><br>
</td><td valign="top" align="left">

View File

@ -0,0 +1,15 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Contiki</title>
</head>
<body bgcolor="white">
<table border=0 cellpadding=4 cellspacing=4><tr><td valign="top" align="right">
<h1>Contiki&nbsp;</h1>
<a href="/">Front page</a><br>
<a href="neighbors.shtml">Neighbors</a><br>
<a href="sensors.shtml">Sensors</a><br>
</td><td valign="top" align="left">
</table>
</body>
</html>

View File

@ -0,0 +1,49 @@
%!: /header.html
<script type="text/javascript">
function load() {
a=document.anchors;
for(i=0; i<a.length;i++){
if(a[i].id=='node')
a[i].href="http://"+addrgen(a[i].name)+"/"
}
}
function addrgen(iid)
{
haddr=document.location.host;
addr=haddr;
ie7ll=0;sep=':';esc='%25';
if(addr.search(/ipv6-literal.net/)!=-1){
ie7ll=1;sep='-';esc='s';iid=iid.replace(/:/g,'-');
}
ncol=addr.replace(/ipv6-literal.net/,'').match(/[:-]/g).length;
n=0;indtot=0;
addr=haddr;
while(n<4 && (ind=addr.indexOf(sep))!=-1){
n++;
if(addr.charAt(ind+1)==sep)
n+=7-ncol;
addr=addr.slice(ind+1);
indtot+=ind+1;
}
if(ind==-1) return;
newaddr = haddr.slice(0,indtot)+iid;
oldiid = haddr.slice(indtot);
end=oldiid.search(/[^0-9a-f:-]/i);
if(end!=-1)
newaddr = newaddr+oldiid.slice(end);
if(!ie7ll&&newaddr.charAt(0)!='[')
newaddr='['+newaddr+']';
if(navigator.userAgent.search(/Firefox/i)==-1)
newaddr=newaddr.replace('%',esc);
return newaddr;
}
</script>
<h1>Node
%! nodeid
</h1>
<h2>Neighbors</h2>
<ul>
%! neighbors
</ul>
%!: /footer.html

View File

@ -0,0 +1 @@
%! sensors

View File

@ -0,0 +1,121 @@
%!: /header.html
<script type="text/javascript">
var start;
i = new Image(50,60)
i.src = "spin.gif"
function load() {
var img = document.getElementById("spin");
img.innerHTML = '&nbsp;';
loadSensordata();
}
function loadSensordata() {
var r;
try { r = new XMLHttpRequest(); }
catch(e) {
try { r = new ActiveXObject("Msxml2.XMLHTTP"); }
catch(e) {
try { r = new ActiveXObject("Microsoft.XMLHTTP"); }
catch(e) {
alert("Your browser does not support AJAX!");
return false;
}
}
}
start = new Date();
r.open("GET", "/sensordata.shtml", true);
r.setRequestHeader("If-Modified-Since","Sat, 1 Jan 2000 00:00:00 GMT");
r.onreadystatechange = function() {
if(r.readyState==1) {
var img = document.getElementById("spin");
img.innerHTML = '<img src="spin.gif">';
}
if(r.readyState==4) {
var img = document.getElementById("spin");
img.innerHTML = 'took ' +
((new Date()).getTime()-start.getTime())/1000+
' seconds';
eval(r.responseText);
}
}
r.send(null);
}
function e(el) {
d = document;
if(d.getElementById) {
return d.getElementById(el);
} else if (d.all) {
return d.all[el];
}
}
function s(el,n,max,text) {
e(el).innerHTML = '<table width=504 border=0 cellpadding=1 cellspacing=0>'+
'<tr><td width=200>' +
text + '</td>' +
'<td width=' + (300*n/max) + ' bgcolor="gray">&nbsp;</td>' +
'<td width=' + (300-300*n/max) + ' bgcolor="lightgray">&nbsp;</td>' +
'</table>';
}
function dc(n,d) {
return n.toFixed(d);
}
function t(m) {
n = dc(m/10, 1);
s('temp',n,40,'Temperature '+n+' &deg;C');
}
function ax(m) {
n = m;
s('accx',n+2000,4000,'Acceleration (X-axis) '+n+'mg');
}
function ay(m) {
n = m;
s('accy',n+2000,4000,'Acceleration (Y-axis) '+n+'mg');
}
function az(m) {
n = m;
s('accz',n+2000,4000,'Acceleration (Z-axis) '+n+'mg');
}
function rs(m) {
n = m + 45;
s('rs',n,100,'RSSI '+n);
}
function p(c,l,t,r) {
tm=c+l;
cp=c*18/tm;
lp=l*7.2/tm;
lt=t*50.4/tm;
lr=r*45.6/tm;
n=cp+lp+lt+lr;
s('p',n,100,'Power consumption '+dc(n,2)+' mW');
s('pc',cp,100,'CPU power '+dc(cp,2)+' mW');
s('pl',lp,100,'LPM power '+dc(lp,2)+' mW');
s('pr',lr,100,'Radio RX power '+dc(lr,2)+' mW');
s('pt',lt,100,'Radio TX power '+dc(lt,2)+' mW');
}
function v(n) {
e('v').innerHTML = n;
}
</script>
<h1>Node
%! nodeid
</h1>
<a href="javascript:loadSensordata();">Reload</a>
<span id="spin"> </span>
<h2>Environment</h2>
<div id="temp"></div>
<div id="accx"></div>
<div id="accy"></div>
<div id="accz"></div>
<h2>Power</h2>
<div id="p"></div>
<div id="pc"></div>
<div id="pl"></div>
<div id="pr"></div>
<div id="pt"></div>
<br></br>
<div id="v"></div>
%!: /footer.html

Binary file not shown.

After

Width:  |  Height:  |  Size: 496 B

View File

@ -0,0 +1,539 @@
static const char data_sensordata_shtml[] = {
/* /sensordata.shtml */
0x2f, 0x73, 0x65, 0x6e, 0x73, 0x6f, 0x72, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x73, 0x68, 0x74, 0x6d, 0x6c, 0,
0x25, 0x21, 0x20, 0x73, 0x65, 0x6e, 0x73, 0x6f, 0x72, 0x73,
0xa, 0};
static const char data_sensors_shtml[] = {
/* /sensors.shtml */
0x2f, 0x73, 0x65, 0x6e, 0x73, 0x6f, 0x72, 0x73, 0x2e, 0x73, 0x68, 0x74, 0x6d, 0x6c, 0,
0x25, 0x21, 0x3A, 0x20, 0x2F, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x2E,
0x68, 0x74, 0x6D, 0x6C, 0x0A, 0x3C, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74,
0x20, 0x74, 0x79, 0x70, 0x65, 0x3D, 0x22, 0x74, 0x65, 0x78, 0x74, 0x2F,
0x6A, 0x61, 0x76, 0x61, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x22, 0x3E,
0x0A, 0x76, 0x61, 0x72, 0x20, 0x73, 0x74, 0x61, 0x72, 0x74, 0x3B, 0x0A,
0x0A, 0x69, 0x20, 0x3D, 0x20, 0x6E, 0x65, 0x77, 0x20, 0x49, 0x6D, 0x61,
0x67, 0x65, 0x28, 0x35, 0x30, 0x2C, 0x36, 0x30, 0x29, 0x0A, 0x69, 0x2E,
0x73, 0x72, 0x63, 0x20, 0x3D, 0x20, 0x22, 0x73, 0x70, 0x69, 0x6E, 0x2E,
0x67, 0x69, 0x66, 0x22, 0x0A, 0x0A, 0x66, 0x75, 0x6E, 0x63, 0x74, 0x69,
0x6F, 0x6E, 0x20, 0x6C, 0x6F, 0x61, 0x64, 0x28, 0x29, 0x20, 0x7B, 0x0A,
0x20, 0x20, 0x76, 0x61, 0x72, 0x20, 0x69, 0x6D, 0x67, 0x20, 0x3D, 0x20,
0x64, 0x6F, 0x63, 0x75, 0x6D, 0x65, 0x6E, 0x74, 0x2E, 0x67, 0x65, 0x74,
0x45, 0x6C, 0x65, 0x6D, 0x65, 0x6E, 0x74, 0x42, 0x79, 0x49, 0x64, 0x28,
0x22, 0x73, 0x70, 0x69, 0x6E, 0x22, 0x29, 0x3B, 0x0A, 0x20, 0x20, 0x69,
0x6D, 0x67, 0x2E, 0x69, 0x6E, 0x6E, 0x65, 0x72, 0x48, 0x54, 0x4D, 0x4C,
0x20, 0x3D, 0x20, 0x27, 0x26, 0x6E, 0x62, 0x73, 0x70, 0x3B, 0x27, 0x3B,
0x0A, 0x20, 0x20, 0x6C, 0x6F, 0x61, 0x64, 0x53, 0x65, 0x6E, 0x73, 0x6F,
0x72, 0x64, 0x61, 0x74, 0x61, 0x28, 0x29, 0x3B, 0x0A, 0x7D, 0x0A, 0x0A,
0x66, 0x75, 0x6E, 0x63, 0x74, 0x69, 0x6F, 0x6E, 0x20, 0x6C, 0x6F, 0x61,
0x64, 0x53, 0x65, 0x6E, 0x73, 0x6F, 0x72, 0x64, 0x61, 0x74, 0x61, 0x28,
0x29, 0x20, 0x7B, 0x0A, 0x20, 0x20, 0x76, 0x61, 0x72, 0x20, 0x72, 0x3B,
0x0A, 0x20, 0x20, 0x74, 0x72, 0x79, 0x20, 0x7B, 0x20, 0x72, 0x20, 0x3D,
0x20, 0x6E, 0x65, 0x77, 0x20, 0x58, 0x4D, 0x4C, 0x48, 0x74, 0x74, 0x70,
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x28, 0x29, 0x3B, 0x20, 0x7D,
0x0A, 0x20, 0x20, 0x63, 0x61, 0x74, 0x63, 0x68, 0x28, 0x65, 0x29, 0x20,
0x7B, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x74, 0x72, 0x79, 0x20, 0x7B, 0x20,
0x72, 0x20, 0x3D, 0x20, 0x6E, 0x65, 0x77, 0x20, 0x41, 0x63, 0x74, 0x69,
0x76, 0x65, 0x58, 0x4F, 0x62, 0x6A, 0x65, 0x63, 0x74, 0x28, 0x22, 0x4D,
0x73, 0x78, 0x6D, 0x6C, 0x32, 0x2E, 0x58, 0x4D, 0x4C, 0x48, 0x54, 0x54,
0x50, 0x22, 0x29, 0x3B, 0x20, 0x7D, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x63,
0x61, 0x74, 0x63, 0x68, 0x28, 0x65, 0x29, 0x20, 0x7B, 0x0A, 0x20, 0x20,
0x20, 0x20, 0x20, 0x20, 0x74, 0x72, 0x79, 0x20, 0x7B, 0x20, 0x72, 0x20,
0x3D, 0x20, 0x6E, 0x65, 0x77, 0x20, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65,
0x58, 0x4F, 0x62, 0x6A, 0x65, 0x63, 0x74, 0x28, 0x22, 0x4D, 0x69, 0x63,
0x72, 0x6F, 0x73, 0x6F, 0x66, 0x74, 0x2E, 0x58, 0x4D, 0x4C, 0x48, 0x54,
0x54, 0x50, 0x22, 0x29, 0x3B, 0x20, 0x7D, 0x0A, 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x63, 0x61, 0x74, 0x63, 0x68, 0x28, 0x65, 0x29, 0x20, 0x7B,
0x0A, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x61, 0x6C, 0x65,
0x72, 0x74, 0x28, 0x22, 0x59, 0x6F, 0x75, 0x72, 0x20, 0x62, 0x72, 0x6F,
0x77, 0x73, 0x65, 0x72, 0x20, 0x64, 0x6F, 0x65, 0x73, 0x20, 0x6E, 0x6F,
0x74, 0x20, 0x73, 0x75, 0x70, 0x70, 0x6F, 0x72, 0x74, 0x20, 0x41, 0x4A,
0x41, 0x58, 0x21, 0x22, 0x29, 0x3B, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6E, 0x20, 0x66, 0x61,
0x6C, 0x73, 0x65, 0x3B, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7D,
0x0A, 0x20, 0x20, 0x20, 0x20, 0x7D, 0x0A, 0x20, 0x20, 0x7D, 0x0A, 0x20,
0x20, 0x73, 0x74, 0x61, 0x72, 0x74, 0x20, 0x3D, 0x20, 0x6E, 0x65, 0x77,
0x20, 0x44, 0x61, 0x74, 0x65, 0x28, 0x29, 0x3B, 0x0A, 0x20, 0x20, 0x72,
0x2E, 0x6F, 0x70, 0x65, 0x6E, 0x28, 0x22, 0x47, 0x45, 0x54, 0x22, 0x2C,
0x20, 0x22, 0x2F, 0x73, 0x65, 0x6E, 0x73, 0x6F, 0x72, 0x64, 0x61, 0x74,
0x61, 0x2E, 0x73, 0x68, 0x74, 0x6D, 0x6C, 0x22, 0x2C, 0x20, 0x74, 0x72,
0x75, 0x65, 0x29, 0x3B, 0x0A, 0x20, 0x20, 0x72, 0x2E, 0x73, 0x65, 0x74,
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x65, 0x61, 0x64, 0x65,
0x72, 0x28, 0x22, 0x49, 0x66, 0x2D, 0x4D, 0x6F, 0x64, 0x69, 0x66, 0x69,
0x65, 0x64, 0x2D, 0x53, 0x69, 0x6E, 0x63, 0x65, 0x22, 0x2C, 0x22, 0x53,
0x61, 0x74, 0x2C, 0x20, 0x31, 0x20, 0x4A, 0x61, 0x6E, 0x20, 0x32, 0x30,
0x30, 0x30, 0x20, 0x30, 0x30, 0x3A, 0x30, 0x30, 0x3A, 0x30, 0x30, 0x20,
0x47, 0x4D, 0x54, 0x22, 0x29, 0x3B, 0x0A, 0x20, 0x20, 0x72, 0x2E, 0x6F,
0x6E, 0x72, 0x65, 0x61, 0x64, 0x79, 0x73, 0x74, 0x61, 0x74, 0x65, 0x63,
0x68, 0x61, 0x6E, 0x67, 0x65, 0x20, 0x3D, 0x20, 0x66, 0x75, 0x6E, 0x63,
0x74, 0x69, 0x6F, 0x6E, 0x28, 0x29, 0x20, 0x7B, 0x0A, 0x20, 0x20, 0x20,
0x20, 0x69, 0x66, 0x28, 0x72, 0x2E, 0x72, 0x65, 0x61, 0x64, 0x79, 0x53,
0x74, 0x61, 0x74, 0x65, 0x3D, 0x3D, 0x31, 0x29, 0x20, 0x7B, 0x0A, 0x20,
0x20, 0x20, 0x20, 0x20, 0x20, 0x76, 0x61, 0x72, 0x20, 0x69, 0x6D, 0x67,
0x20, 0x3D, 0x20, 0x64, 0x6F, 0x63, 0x75, 0x6D, 0x65, 0x6E, 0x74, 0x2E,
0x67, 0x65, 0x74, 0x45, 0x6C, 0x65, 0x6D, 0x65, 0x6E, 0x74, 0x42, 0x79,
0x49, 0x64, 0x28, 0x22, 0x73, 0x70, 0x69, 0x6E, 0x22, 0x29, 0x3B, 0x0A,
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x6D, 0x67, 0x2E, 0x69, 0x6E,
0x6E, 0x65, 0x72, 0x48, 0x54, 0x4D, 0x4C, 0x20, 0x3D, 0x20, 0x27, 0x3C,
0x69, 0x6D, 0x67, 0x20, 0x73, 0x72, 0x63, 0x3D, 0x22, 0x73, 0x70, 0x69,
0x6E, 0x2E, 0x67, 0x69, 0x66, 0x22, 0x3E, 0x27, 0x3B, 0x0A, 0x20, 0x20,
0x20, 0x20, 0x7D, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x28, 0x72,
0x2E, 0x72, 0x65, 0x61, 0x64, 0x79, 0x53, 0x74, 0x61, 0x74, 0x65, 0x3D,
0x3D, 0x34, 0x29, 0x20, 0x7B, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
0x76, 0x61, 0x72, 0x20, 0x69, 0x6D, 0x67, 0x20, 0x3D, 0x20, 0x64, 0x6F,
0x63, 0x75, 0x6D, 0x65, 0x6E, 0x74, 0x2E, 0x67, 0x65, 0x74, 0x45, 0x6C,
0x65, 0x6D, 0x65, 0x6E, 0x74, 0x42, 0x79, 0x49, 0x64, 0x28, 0x22, 0x73,
0x70, 0x69, 0x6E, 0x22, 0x29, 0x3B, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 0x69, 0x6D, 0x67, 0x2E, 0x69, 0x6E, 0x6E, 0x65, 0x72, 0x48, 0x54,
0x4D, 0x4C, 0x20, 0x3D, 0x20, 0x27, 0x74, 0x6F, 0x6F, 0x6B, 0x20, 0x27,
0x20, 0x20, 0x2B, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x28, 0x28, 0x6E, 0x65, 0x77, 0x20, 0x44, 0x61, 0x74, 0x65,
0x28, 0x29, 0x29, 0x2E, 0x67, 0x65, 0x74, 0x54, 0x69, 0x6D, 0x65, 0x28,
0x29, 0x2D, 0x73, 0x74, 0x61, 0x72, 0x74, 0x2E, 0x67, 0x65, 0x74, 0x54,
0x69, 0x6D, 0x65, 0x28, 0x29, 0x29, 0x2F, 0x31, 0x30, 0x30, 0x30, 0x2B,
0x0A, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x27,
0x20, 0x73, 0x65, 0x63, 0x6F, 0x6E, 0x64, 0x73, 0x27, 0x3B, 0x0A, 0x20,
0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x76, 0x61, 0x6C, 0x28, 0x72, 0x2E,
0x72, 0x65, 0x73, 0x70, 0x6F, 0x6E, 0x73, 0x65, 0x54, 0x65, 0x78, 0x74,
0x29, 0x3B, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x7D, 0x0A, 0x20, 0x20, 0x7D,
0x0A, 0x20, 0x20, 0x72, 0x2E, 0x73, 0x65, 0x6E, 0x64, 0x28, 0x6E, 0x75,
0x6C, 0x6C, 0x29, 0x3B, 0x0A, 0x7D, 0x0A, 0x0A, 0x66, 0x75, 0x6E, 0x63,
0x74, 0x69, 0x6F, 0x6E, 0x20, 0x65, 0x28, 0x65, 0x6C, 0x29, 0x20, 0x7B,
0x0A, 0x20, 0x20, 0x64, 0x20, 0x3D, 0x20, 0x64, 0x6F, 0x63, 0x75, 0x6D,
0x65, 0x6E, 0x74, 0x3B, 0x0A, 0x20, 0x20, 0x69, 0x66, 0x28, 0x64, 0x2E,
0x67, 0x65, 0x74, 0x45, 0x6C, 0x65, 0x6D, 0x65, 0x6E, 0x74, 0x42, 0x79,
0x49, 0x64, 0x29, 0x20, 0x7B, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65,
0x74, 0x75, 0x72, 0x6E, 0x20, 0x64, 0x2E, 0x67, 0x65, 0x74, 0x45, 0x6C,
0x65, 0x6D, 0x65, 0x6E, 0x74, 0x42, 0x79, 0x49, 0x64, 0x28, 0x65, 0x6C,
0x29, 0x3B, 0x0A, 0x20, 0x20, 0x7D, 0x20, 0x65, 0x6C, 0x73, 0x65, 0x20,
0x69, 0x66, 0x20, 0x28, 0x64, 0x2E, 0x61, 0x6C, 0x6C, 0x29, 0x20, 0x7B,
0x0A, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6E, 0x20,
0x64, 0x2E, 0x61, 0x6C, 0x6C, 0x5B, 0x65, 0x6C, 0x5D, 0x3B, 0x0A, 0x20,
0x20, 0x7D, 0x0A, 0x7D, 0x0A, 0x66, 0x75, 0x6E, 0x63, 0x74, 0x69, 0x6F,
0x6E, 0x20, 0x73, 0x28, 0x65, 0x6C, 0x2C, 0x6E, 0x2C, 0x6D, 0x61, 0x78,
0x2C, 0x74, 0x65, 0x78, 0x74, 0x29, 0x20, 0x7B, 0x0A, 0x20, 0x20, 0x65,
0x28, 0x65, 0x6C, 0x29, 0x2E, 0x69, 0x6E, 0x6E, 0x65, 0x72, 0x48, 0x54,
0x4D, 0x4C, 0x20, 0x3D, 0x20, 0x27, 0x3C, 0x74, 0x61, 0x62, 0x6C, 0x65,
0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3D, 0x35, 0x30, 0x34, 0x20, 0x62,
0x6F, 0x72, 0x64, 0x65, 0x72, 0x3D, 0x30, 0x20, 0x63, 0x65, 0x6C, 0x6C,
0x70, 0x61, 0x64, 0x64, 0x69, 0x6E, 0x67, 0x3D, 0x31, 0x20, 0x63, 0x65,
0x6C, 0x6C, 0x73, 0x70, 0x61, 0x63, 0x69, 0x6E, 0x67, 0x3D, 0x30, 0x3E,
0x27, 0x2B, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x27,
0x3C, 0x74, 0x72, 0x3E, 0x3C, 0x74, 0x64, 0x20, 0x77, 0x69, 0x64, 0x74,
0x68, 0x3D, 0x32, 0x30, 0x30, 0x3E, 0x27, 0x20, 0x2B, 0x0A, 0x20, 0x20,
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x74, 0x65, 0x78, 0x74, 0x20, 0x2B,
0x20, 0x27, 0x3C, 0x2F, 0x74, 0x64, 0x3E, 0x27, 0x20, 0x2B, 0x0A, 0x09,
0x09, 0x20, 0x20, 0x20, 0x20, 0x27, 0x3C, 0x74, 0x64, 0x20, 0x77, 0x69,
0x64, 0x74, 0x68, 0x3D, 0x27, 0x20, 0x2B, 0x20, 0x28, 0x33, 0x30, 0x30,
0x2A, 0x6E, 0x2F, 0x6D, 0x61, 0x78, 0x29, 0x20, 0x2B, 0x20, 0x27, 0x20,
0x62, 0x67, 0x63, 0x6F, 0x6C, 0x6F, 0x72, 0x3D, 0x22, 0x67, 0x72, 0x61,
0x79, 0x22, 0x3E, 0x26, 0x6E, 0x62, 0x73, 0x70, 0x3B, 0x3C, 0x2F, 0x74,
0x64, 0x3E, 0x27, 0x20, 0x2B, 0x0A, 0x09, 0x09, 0x20, 0x20, 0x20, 0x20,
0x27, 0x3C, 0x74, 0x64, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3D, 0x27,
0x20, 0x2B, 0x20, 0x28, 0x33, 0x30, 0x30, 0x2D, 0x33, 0x30, 0x30, 0x2A,
0x6E, 0x2F, 0x6D, 0x61, 0x78, 0x29, 0x20, 0x2B, 0x20, 0x27, 0x20, 0x62,
0x67, 0x63, 0x6F, 0x6C, 0x6F, 0x72, 0x3D, 0x22, 0x6C, 0x69, 0x67, 0x68,
0x74, 0x67, 0x72, 0x61, 0x79, 0x22, 0x3E, 0x26, 0x6E, 0x62, 0x73, 0x70,
0x3B, 0x3C, 0x2F, 0x74, 0x64, 0x3E, 0x27, 0x20, 0x2B, 0x0A, 0x09, 0x09,
0x20, 0x20, 0x20, 0x20, 0x27, 0x3C, 0x2F, 0x74, 0x61, 0x62, 0x6C, 0x65,
0x3E, 0x27, 0x3B, 0x0A, 0x7D, 0x0A, 0x66, 0x75, 0x6E, 0x63, 0x74, 0x69,
0x6F, 0x6E, 0x20, 0x64, 0x63, 0x28, 0x6E, 0x2C, 0x64, 0x29, 0x20, 0x7B,
0x0A, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6E, 0x20, 0x6E, 0x2E,
0x74, 0x6F, 0x46, 0x69, 0x78, 0x65, 0x64, 0x28, 0x64, 0x29, 0x3B, 0x0A,
0x7D, 0x0A, 0x66, 0x75, 0x6E, 0x63, 0x74, 0x69, 0x6F, 0x6E, 0x20, 0x74,
0x28, 0x6D, 0x29, 0x20, 0x7B, 0x0A, 0x20, 0x20, 0x6E, 0x20, 0x3D, 0x20,
0x64, 0x63, 0x28, 0x6D, 0x2F, 0x31, 0x30, 0x2C, 0x20, 0x31, 0x29, 0x3B,
0x0A, 0x20, 0x20, 0x73, 0x28, 0x27, 0x74, 0x65, 0x6D, 0x70, 0x27, 0x2C,
0x6E, 0x2C, 0x34, 0x30, 0x2C, 0x27, 0x54, 0x65, 0x6D, 0x70, 0x65, 0x72,
0x61, 0x74, 0x75, 0x72, 0x65, 0x20, 0x27, 0x2B, 0x6E, 0x2B, 0x27, 0x20,
0x26, 0x64, 0x65, 0x67, 0x3B, 0x43, 0x27, 0x29, 0x3B, 0x0A, 0x7D, 0x0A,
0x66, 0x75, 0x6E, 0x63, 0x74, 0x69, 0x6F, 0x6E, 0x20, 0x61, 0x78, 0x28,
0x6D, 0x29, 0x20, 0x7B, 0x0A, 0x20, 0x20, 0x6E, 0x20, 0x3D, 0x20, 0x6D,
0x3B, 0x0A, 0x20, 0x20, 0x73, 0x28, 0x27, 0x61, 0x63, 0x63, 0x78, 0x27,
0x2C, 0x6E, 0x2B, 0x32, 0x30, 0x30, 0x30, 0x2C, 0x34, 0x30, 0x30, 0x30,
0x2C, 0x27, 0x41, 0x63, 0x63, 0x65, 0x6C, 0x65, 0x72, 0x61, 0x74, 0x69,
0x6F, 0x6E, 0x20, 0x28, 0x58, 0x2D, 0x61, 0x78, 0x69, 0x73, 0x29, 0x20,
0x27, 0x2B, 0x6E, 0x2B, 0x27, 0x6D, 0x67, 0x27, 0x29, 0x3B, 0x0A, 0x7D,
0x0A, 0x66, 0x75, 0x6E, 0x63, 0x74, 0x69, 0x6F, 0x6E, 0x20, 0x61, 0x79,
0x28, 0x6D, 0x29, 0x20, 0x7B, 0x0A, 0x20, 0x20, 0x6E, 0x20, 0x3D, 0x20,
0x6D, 0x3B, 0x0A, 0x20, 0x20, 0x73, 0x28, 0x27, 0x61, 0x63, 0x63, 0x79,
0x27, 0x2C, 0x6E, 0x2B, 0x32, 0x30, 0x30, 0x30, 0x2C, 0x34, 0x30, 0x30,
0x30, 0x2C, 0x27, 0x41, 0x63, 0x63, 0x65, 0x6C, 0x65, 0x72, 0x61, 0x74,
0x69, 0x6F, 0x6E, 0x20, 0x28, 0x59, 0x2D, 0x61, 0x78, 0x69, 0x73, 0x29,
0x20, 0x27, 0x2B, 0x6E, 0x2B, 0x27, 0x6D, 0x67, 0x27, 0x29, 0x3B, 0x0A,
0x7D, 0x0A, 0x66, 0x75, 0x6E, 0x63, 0x74, 0x69, 0x6F, 0x6E, 0x20, 0x61,
0x7A, 0x28, 0x6D, 0x29, 0x20, 0x7B, 0x0A, 0x20, 0x20, 0x6E, 0x20, 0x3D,
0x20, 0x6D, 0x3B, 0x0A, 0x20, 0x20, 0x73, 0x28, 0x27, 0x61, 0x63, 0x63,
0x7A, 0x27, 0x2C, 0x6E, 0x2B, 0x32, 0x30, 0x30, 0x30, 0x2C, 0x34, 0x30,
0x30, 0x30, 0x2C, 0x27, 0x41, 0x63, 0x63, 0x65, 0x6C, 0x65, 0x72, 0x61,
0x74, 0x69, 0x6F, 0x6E, 0x20, 0x28, 0x5A, 0x2D, 0x61, 0x78, 0x69, 0x73,
0x29, 0x20, 0x27, 0x2B, 0x6E, 0x2B, 0x27, 0x6D, 0x67, 0x27, 0x29, 0x3B,
0x0A, 0x7D, 0x0A, 0x66, 0x75, 0x6E, 0x63, 0x74, 0x69, 0x6F, 0x6E, 0x20,
0x72, 0x73, 0x28, 0x6D, 0x29, 0x20, 0x7B, 0x0A, 0x20, 0x20, 0x6E, 0x20,
0x3D, 0x20, 0x6D, 0x20, 0x2B, 0x20, 0x34, 0x35, 0x3B, 0x0A, 0x20, 0x20,
0x73, 0x28, 0x27, 0x72, 0x73, 0x27, 0x2C, 0x6E, 0x2C, 0x31, 0x30, 0x30,
0x2C, 0x27, 0x52, 0x53, 0x53, 0x49, 0x20, 0x27, 0x2B, 0x6E, 0x29, 0x3B,
0x0A, 0x7D, 0x0A, 0x66, 0x75, 0x6E, 0x63, 0x74, 0x69, 0x6F, 0x6E, 0x20,
0x70, 0x28, 0x63, 0x2C, 0x6C, 0x2C, 0x74, 0x2C, 0x72, 0x29, 0x20, 0x7B,
0x0A, 0x20, 0x20, 0x74, 0x6D, 0x3D, 0x63, 0x2B, 0x6C, 0x3B, 0x0A, 0x20,
0x20, 0x63, 0x70, 0x3D, 0x63, 0x2A, 0x31, 0x38, 0x2F, 0x74, 0x6D, 0x3B,
0x0A, 0x20, 0x20, 0x6C, 0x70, 0x3D, 0x6C, 0x2A, 0x37, 0x2E, 0x32, 0x2F,
0x74, 0x6D, 0x3B, 0x0A, 0x20, 0x20, 0x6C, 0x74, 0x3D, 0x74, 0x2A, 0x35,
0x30, 0x2E, 0x34, 0x2F, 0x74, 0x6D, 0x3B, 0x0A, 0x20, 0x20, 0x6C, 0x72,
0x3D, 0x72, 0x2A, 0x34, 0x35, 0x2E, 0x36, 0x2F, 0x74, 0x6D, 0x3B, 0x0A,
0x20, 0x20, 0x6E, 0x3D, 0x63, 0x70, 0x2B, 0x6C, 0x70, 0x2B, 0x6C, 0x74,
0x2B, 0x6C, 0x72, 0x3B, 0x0A, 0x20, 0x20, 0x73, 0x28, 0x27, 0x70, 0x27,
0x2C, 0x6E, 0x2C, 0x31, 0x30, 0x30, 0x2C, 0x27, 0x50, 0x6F, 0x77, 0x65,
0x72, 0x20, 0x63, 0x6F, 0x6E, 0x73, 0x75, 0x6D, 0x70, 0x74, 0x69, 0x6F,
0x6E, 0x20, 0x27, 0x2B, 0x64, 0x63, 0x28, 0x6E, 0x2C, 0x32, 0x29, 0x2B,
0x27, 0x20, 0x6D, 0x57, 0x27, 0x29, 0x3B, 0x0A, 0x20, 0x20, 0x73, 0x28,
0x27, 0x70, 0x63, 0x27, 0x2C, 0x63, 0x70, 0x2C, 0x31, 0x30, 0x30, 0x2C,
0x27, 0x43, 0x50, 0x55, 0x20, 0x70, 0x6F, 0x77, 0x65, 0x72, 0x20, 0x27,
0x2B, 0x64, 0x63, 0x28, 0x63, 0x70, 0x2C, 0x32, 0x29, 0x2B, 0x27, 0x20,
0x6D, 0x57, 0x27, 0x29, 0x3B, 0x0A, 0x20, 0x20, 0x73, 0x28, 0x27, 0x70,
0x6C, 0x27, 0x2C, 0x6C, 0x70, 0x2C, 0x31, 0x30, 0x30, 0x2C, 0x27, 0x4C,
0x50, 0x4D, 0x20, 0x70, 0x6F, 0x77, 0x65, 0x72, 0x20, 0x27, 0x2B, 0x64,
0x63, 0x28, 0x6C, 0x70, 0x2C, 0x32, 0x29, 0x2B, 0x27, 0x20, 0x6D, 0x57,
0x27, 0x29, 0x3B, 0x0A, 0x20, 0x20, 0x73, 0x28, 0x27, 0x70, 0x72, 0x27,
0x2C, 0x6C, 0x72, 0x2C, 0x31, 0x30, 0x30, 0x2C, 0x27, 0x52, 0x61, 0x64,
0x69, 0x6F, 0x20, 0x52, 0x58, 0x20, 0x70, 0x6F, 0x77, 0x65, 0x72, 0x20,
0x27, 0x2B, 0x64, 0x63, 0x28, 0x6C, 0x72, 0x2C, 0x32, 0x29, 0x2B, 0x27,
0x20, 0x6D, 0x57, 0x27, 0x29, 0x3B, 0x0A, 0x20, 0x20, 0x73, 0x28, 0x27,
0x70, 0x74, 0x27, 0x2C, 0x6C, 0x74, 0x2C, 0x31, 0x30, 0x30, 0x2C, 0x27,
0x52, 0x61, 0x64, 0x69, 0x6F, 0x20, 0x54, 0x58, 0x20, 0x70, 0x6F, 0x77,
0x65, 0x72, 0x20, 0x27, 0x2B, 0x64, 0x63, 0x28, 0x6C, 0x74, 0x2C, 0x32,
0x29, 0x2B, 0x27, 0x20, 0x6D, 0x57, 0x27, 0x29, 0x3B, 0x0A, 0x7D, 0x0A,
0x66, 0x75, 0x6E, 0x63, 0x74, 0x69, 0x6F, 0x6E, 0x20, 0x76, 0x28, 0x6E,
0x29, 0x20, 0x7B, 0x0A, 0x20, 0x20, 0x65, 0x28, 0x27, 0x76, 0x27, 0x29,
0x2E, 0x69, 0x6E, 0x6E, 0x65, 0x72, 0x48, 0x54, 0x4D, 0x4C, 0x20, 0x3D,
0x20, 0x6E, 0x3B, 0x0A, 0x7D, 0x0A, 0x3C, 0x2F, 0x73, 0x63, 0x72, 0x69,
0x70, 0x74, 0x3E, 0x0A, 0x3C, 0x68, 0x31, 0x3E, 0x4E, 0x6F, 0x64, 0x65,
0x0A, 0x25, 0x21, 0x20, 0x6E, 0x6F, 0x64, 0x65, 0x69, 0x64, 0x0A, 0x3C,
0x2F, 0x68, 0x31, 0x3E, 0x0A, 0x3C, 0x61, 0x20, 0x68, 0x72, 0x65, 0x66,
0x3D, 0x22, 0x6A, 0x61, 0x76, 0x61, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74,
0x3A, 0x6C, 0x6F, 0x61, 0x64, 0x53, 0x65, 0x6E, 0x73, 0x6F, 0x72, 0x64,
0x61, 0x74, 0x61, 0x28, 0x29, 0x3B, 0x22, 0x3E, 0x52, 0x65, 0x6C, 0x6F,
0x61, 0x64, 0x3C, 0x2F, 0x61, 0x3E, 0x0A, 0x0A, 0x3C, 0x73, 0x70, 0x61,
0x6E, 0x20, 0x69, 0x64, 0x3D, 0x22, 0x73, 0x70, 0x69, 0x6E, 0x22, 0x3E,
0x20, 0x3C, 0x2F, 0x73, 0x70, 0x61, 0x6E, 0x3E, 0x0A, 0x3C, 0x68, 0x32,
0x3E, 0x45, 0x6E, 0x76, 0x69, 0x72, 0x6F, 0x6E, 0x6D, 0x65, 0x6E, 0x74,
0x3C, 0x2F, 0x68, 0x32, 0x3E, 0x0A, 0x3C, 0x64, 0x69, 0x76, 0x20, 0x69,
0x64, 0x3D, 0x22, 0x74, 0x65, 0x6D, 0x70, 0x22, 0x3E, 0x3C, 0x2F, 0x64,
0x69, 0x76, 0x3E, 0x0A, 0x3C, 0x64, 0x69, 0x76, 0x20, 0x69, 0x64, 0x3D,
0x22, 0x61, 0x63, 0x63, 0x78, 0x22, 0x3E, 0x3C, 0x2F, 0x64, 0x69, 0x76,
0x3E, 0x0A, 0x3C, 0x64, 0x69, 0x76, 0x20, 0x69, 0x64, 0x3D, 0x22, 0x61,
0x63, 0x63, 0x79, 0x22, 0x3E, 0x3C, 0x2F, 0x64, 0x69, 0x76, 0x3E, 0x0A,
0x3C, 0x64, 0x69, 0x76, 0x20, 0x69, 0x64, 0x3D, 0x22, 0x61, 0x63, 0x63,
0x7A, 0x22, 0x3E, 0x3C, 0x2F, 0x64, 0x69, 0x76, 0x3E, 0x0A, 0x3C, 0x68,
0x32, 0x3E, 0x50, 0x6F, 0x77, 0x65, 0x72, 0x3C, 0x2F, 0x68, 0x32, 0x3E,
0x0A, 0x3C, 0x64, 0x69, 0x76, 0x20, 0x69, 0x64, 0x3D, 0x22, 0x70, 0x22,
0x3E, 0x3C, 0x2F, 0x64, 0x69, 0x76, 0x3E, 0x0A, 0x3C, 0x64, 0x69, 0x76,
0x20, 0x69, 0x64, 0x3D, 0x22, 0x70, 0x63, 0x22, 0x3E, 0x3C, 0x2F, 0x64,
0x69, 0x76, 0x3E, 0x0A, 0x3C, 0x64, 0x69, 0x76, 0x20, 0x69, 0x64, 0x3D,
0x22, 0x70, 0x6C, 0x22, 0x3E, 0x3C, 0x2F, 0x64, 0x69, 0x76, 0x3E, 0x0A,
0x3C, 0x64, 0x69, 0x76, 0x20, 0x69, 0x64, 0x3D, 0x22, 0x70, 0x72, 0x22,
0x3E, 0x3C, 0x2F, 0x64, 0x69, 0x76, 0x3E, 0x0A, 0x3C, 0x64, 0x69, 0x76,
0x20, 0x69, 0x64, 0x3D, 0x22, 0x70, 0x74, 0x22, 0x3E, 0x3C, 0x2F, 0x64,
0x69, 0x76, 0x3E, 0x0A, 0x3C, 0x62, 0x72, 0x3E, 0x3C, 0x2F, 0x62, 0x72,
0x3E, 0x0A, 0x3C, 0x64, 0x69, 0x76, 0x20, 0x69, 0x64, 0x3D, 0x22, 0x76,
0x22, 0x3E, 0x3C, 0x2F, 0x64, 0x69, 0x76, 0x3E, 0x0A, 0x25, 0x21, 0x3A,
0x20, 0x2F, 0x66, 0x6F, 0x6F, 0x74, 0x65, 0x72, 0x2E, 0x68, 0x74, 0x6D,
0x6C, 0x0A, 0};
static const char data_footer_html[] = {
/* /footer.html */
0x2f, 0x66, 0x6f, 0x6f, 0x74, 0x65, 0x72, 0x2e, 0x68, 0x74, 0x6d, 0x6c, 0,
0x3c, 0x2f, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x3e, 0xa, 0x3c,
0x2f, 0x62, 0x6f, 0x64, 0x79, 0x3e, 0xa, 0x3c, 0x2f, 0x68,
0x74, 0x6d, 0x6c, 0x3e, 0xa, 0};
static const char data_spin_gif[] = {
/* /spin.gif */
0x2f, 0x73, 0x70, 0x69, 0x6e, 0x2e, 0x67, 0x69, 0x66, 0,
0x47, 0x49, 0x46, 0x38, 0x39, 0x61, 0x12, 00, 0xf, 00,
0xf2, 00, 00, 0xff, 0xff, 0xff, 00, 00, 00, 00,
00, 00, 0x5c, 0x5c, 0x5c, 0xb4, 0xb4, 0xb4, 00, 00,
00, 00, 00, 00, 00, 00, 00, 0x21, 0xff, 0xb,
0x4e, 0x45, 0x54, 0x53, 0x43, 0x41, 0x50, 0x45, 0x32, 0x2e,
0x30, 0x3, 0x1, 00, 00, 00, 0x21, 0xfe, 0x1a, 0x43,
0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x77, 0x69, 0x74,
0x68, 0x20, 0x61, 0x6a, 0x61, 0x78, 0x6c, 0x6f, 0x61, 0x64,
0x2e, 0x69, 0x6e, 0x66, 0x6f, 00, 0x21, 0xf9, 0x4, 0x9,
0x5, 00, 00, 00, 0x2c, 00, 00, 00, 00, 0x12,
00, 0xf, 00, 00, 0x3, 0x1c, 0x8, 0xba, 0xdc, 0xfe,
0x30, 0xca, 0x49, 0xab, 0xbd, 0x38, 0x57, 0x21, 0x2e, 0xe7,
0xd6, 0xd7, 0x1, 0x3, 0x5, 0x92, 0x43, 0x9, 0x10, 0x4,
0xa5, 0x6a, 0x4e, 0x2, 00, 0x21, 0xf9, 0x4, 0x9, 0x5,
00, 00, 00, 0x2c, 00, 00, 00, 00, 0x12, 00,
0xf, 00, 00, 0x3, 0x1e, 0x8, 0xba, 0xdc, 0xfe, 0x30,
0xca, 0x49, 0xab, 0x6d, 0xe2, 0x2, 0xc1, 0x75, 0xd6, 0xca,
0x30, 0x5c, 0xa2, 0x68, 0x95, 0x23, 0x40, 0x50, 0xa6, 0x4a,
0xac, 0x17, 0xc, 0x3e, 0x9, 00, 0x21, 0xf9, 0x4, 0x9,
0x5, 00, 00, 00, 0x2c, 00, 00, 00, 00, 0x12,
00, 0xf, 00, 00, 0x3, 0x1c, 0x8, 0xba, 0xdc, 0xfe,
0x30, 0x4a, 0x20, 0xc4, 0xbc, 0x38, 0xab, 0xa1, 0xc1, 0xf8,
0x1d, 0xd7, 0x29, 0x4, 0xa1, 0x95, 0x65, 0x86, 0x9a, 0x2a,
0x3b, 0xbe, 0x53, 0x2, 00, 0x21, 0xf9, 0x4, 0x9, 0x5,
00, 00, 00, 0x2c, 00, 00, 00, 00, 0x12, 00,
0xf, 00, 00, 0x3, 0x17, 0x8, 0xba, 0xdc, 0xbe, 0xe2,
0xc9, 0xf9, 0xc6, 0xa0, 0x38, 0x6b, 0x47, 0xb6, 0x22, 0xa0,
0x7, 0x74, 0x62, 0x69, 0x9e, 0x68, 0x8a, 0x25, 00, 0x21,
0xf9, 0x4, 0x9, 0x5, 00, 00, 00, 0x2c, 00, 00,
00, 00, 0x12, 00, 0xf, 00, 00, 0x3, 0x14, 0x8,
0xba, 0xdc, 0xbe, 0xe3, 0xc9, 0x27, 0x24, 0x21, 0x33, 0xeb,
0xcd, 0xbb, 0xff, 0x60, 0x28, 0x8e, 0x24, 0x98, 00, 00,
0x21, 0xf9, 0x4, 0x9, 0x5, 00, 00, 00, 0x2c, 00,
00, 00, 00, 0x12, 00, 0xf, 00, 00, 0x3, 0x14,
0x8, 0xba, 0xdc, 0xbe, 0xe4, 0xc9, 0x37, 0xa6, 0xbd, 0x38,
0x2f, 0xa1, 0xbb, 0xff, 0x60, 0x28, 0x8e, 0x24, 0x90, 00,
00, 0x21, 0xf9, 0x4, 0x9, 0x5, 00, 00, 00, 0x2c,
00, 00, 00, 00, 0x12, 00, 0xf, 00, 00, 0x3,
0x13, 0x8, 0xba, 0xdc, 0xfe, 0x30, 0x2a, 0x22, 0xab, 0xbd,
0x76, 0xe0, 0xcd, 0xbb, 0x8f, 0xc2, 0x27, 0x8e, 0x57, 0x2,
00, 0x21, 0xf9, 0x4, 0x9, 0x5, 00, 00, 00, 0x2c,
00, 00, 00, 00, 0x12, 00, 0xf, 00, 00, 0x3,
0x14, 0x8, 0xba, 0xdc, 0xfe, 0x30, 0xca, 0x49, 0xab, 0x5,
0xe4, 0xea, 0xcd, 0x3b, 0x1b, 0x1e, 0x25, 0x8, 0x21, 0x97,
00, 00, 0x21, 0xf9, 0x4, 0x9, 0x5, 00, 00, 00,
0x2c, 00, 00, 00, 00, 0x12, 00, 0xf, 00, 00,
0x3, 0x17, 0x8, 0xba, 0xdc, 0xfe, 0x30, 0xca, 0x49, 0xab,
0xbd, 0x38, 0xeb, 0xed, 0x88, 0x14, 0x98, 0x20, 0x2a, 0xc3,
0x40, 0x81, 0x5c, 0x93, 00, 00, 0x3b, 00, 00, 00,
00, 00, 00, 00, 00, 00, 0};
static const char data_neighbors_shtml[] = {
/* /neighbors.shtml */
0x2f, 0x6e, 0x65, 0x69, 0x67, 0x68, 0x62, 0x6f, 0x72, 0x73, 0x2e, 0x73, 0x68, 0x74, 0x6d, 0x6c, 0,
0x25, 0x21, 0x3A, 0x20, 0x2F, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x2E,
0x68, 0x74, 0x6D, 0x6C, 0x0A, 0x3C, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74,
0x20, 0x74, 0x79, 0x70, 0x65, 0x3D, 0x22, 0x74, 0x65, 0x78, 0x74, 0x2F,
0x6A, 0x61, 0x76, 0x61, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x22, 0x3E,
0x0A, 0x66, 0x75, 0x6E, 0x63, 0x74, 0x69, 0x6F, 0x6E, 0x20, 0x6C, 0x6F,
0x61, 0x64, 0x28, 0x29, 0x20, 0x7B, 0x0A, 0x09, 0x61, 0x3D, 0x64, 0x6F,
0x63, 0x75, 0x6D, 0x65, 0x6E, 0x74, 0x2E, 0x61, 0x6E, 0x63, 0x68, 0x6F,
0x72, 0x73, 0x3B, 0x0A, 0x09, 0x66, 0x6F, 0x72, 0x28, 0x69, 0x3D, 0x30,
0x3B, 0x20, 0x69, 0x3C, 0x61, 0x2E, 0x6C, 0x65, 0x6E, 0x67, 0x74, 0x68,
0x3B, 0x69, 0x2B, 0x2B, 0x29, 0x7B, 0x0A, 0x09, 0x09, 0x69, 0x66, 0x28,
0x61, 0x5B, 0x69, 0x5D, 0x2E, 0x69, 0x64, 0x3D, 0x3D, 0x27, 0x6E, 0x6F,
0x64, 0x65, 0x27, 0x29, 0x0A, 0x09, 0x09, 0x09, 0x61, 0x5B, 0x69, 0x5D,
0x2E, 0x68, 0x72, 0x65, 0x66, 0x3D, 0x22, 0x68, 0x74, 0x74, 0x70, 0x3A,
0x2F, 0x2F, 0x22, 0x2B, 0x61, 0x64, 0x64, 0x72, 0x67, 0x65, 0x6E, 0x28,
0x61, 0x5B, 0x69, 0x5D, 0x2E, 0x6E, 0x61, 0x6D, 0x65, 0x29, 0x2B, 0x22,
0x2F, 0x22, 0x0A, 0x09, 0x7D, 0x0A, 0x7D, 0x0A, 0x66, 0x75, 0x6E, 0x63,
0x74, 0x69, 0x6F, 0x6E, 0x20, 0x61, 0x64, 0x64, 0x72, 0x67, 0x65, 0x6E,
0x28, 0x69, 0x69, 0x64, 0x29, 0x0A, 0x7B, 0x0A, 0x09, 0x68, 0x61, 0x64,
0x64, 0x72, 0x3D, 0x64, 0x6F, 0x63, 0x75, 0x6D, 0x65, 0x6E, 0x74, 0x2E,
0x6C, 0x6F, 0x63, 0x61, 0x74, 0x69, 0x6F, 0x6E, 0x2E, 0x68, 0x6F, 0x73,
0x74, 0x3B, 0x0A, 0x09, 0x61, 0x64, 0x64, 0x72, 0x3D, 0x68, 0x61, 0x64,
0x64, 0x72, 0x3B, 0x0A, 0x09, 0x69, 0x65, 0x37, 0x6C, 0x6C, 0x3D, 0x30,
0x3B, 0x73, 0x65, 0x70, 0x3D, 0x27, 0x3A, 0x27, 0x3B, 0x65, 0x73, 0x63,
0x3D, 0x27, 0x25, 0x32, 0x35, 0x27, 0x3B, 0x0A, 0x09, 0x69, 0x66, 0x28,
0x61, 0x64, 0x64, 0x72, 0x2E, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x28,
0x2F, 0x69, 0x70, 0x76, 0x36, 0x2D, 0x6C, 0x69, 0x74, 0x65, 0x72, 0x61,
0x6C, 0x2E, 0x6E, 0x65, 0x74, 0x2F, 0x29, 0x21, 0x3D, 0x2D, 0x31, 0x29,
0x7B, 0x0A, 0x09, 0x09, 0x69, 0x65, 0x37, 0x6C, 0x6C, 0x3D, 0x31, 0x3B,
0x73, 0x65, 0x70, 0x3D, 0x27, 0x2D, 0x27, 0x3B, 0x65, 0x73, 0x63, 0x3D,
0x27, 0x73, 0x27, 0x3B, 0x69, 0x69, 0x64, 0x3D, 0x69, 0x69, 0x64, 0x2E,
0x72, 0x65, 0x70, 0x6C, 0x61, 0x63, 0x65, 0x28, 0x2F, 0x3A, 0x2F, 0x67,
0x2C, 0x27, 0x2D, 0x27, 0x29, 0x3B, 0x0A, 0x09, 0x7D, 0x0A, 0x09, 0x6E,
0x63, 0x6F, 0x6C, 0x3D, 0x61, 0x64, 0x64, 0x72, 0x2E, 0x72, 0x65, 0x70,
0x6C, 0x61, 0x63, 0x65, 0x28, 0x2F, 0x69, 0x70, 0x76, 0x36, 0x2D, 0x6C,
0x69, 0x74, 0x65, 0x72, 0x61, 0x6C, 0x2E, 0x6E, 0x65, 0x74, 0x2F, 0x2C,
0x27, 0x27, 0x29, 0x2E, 0x6D, 0x61, 0x74, 0x63, 0x68, 0x28, 0x2F, 0x5B,
0x3A, 0x2D, 0x5D, 0x2F, 0x67, 0x29, 0x2E, 0x6C, 0x65, 0x6E, 0x67, 0x74,
0x68, 0x3B, 0x0A, 0x09, 0x6E, 0x3D, 0x30, 0x3B, 0x69, 0x6E, 0x64, 0x74,
0x6F, 0x74, 0x3D, 0x30, 0x3B, 0x0A, 0x09, 0x61, 0x64, 0x64, 0x72, 0x3D,
0x68, 0x61, 0x64, 0x64, 0x72, 0x3B, 0x0A, 0x09, 0x77, 0x68, 0x69, 0x6C,
0x65, 0x28, 0x6E, 0x3C, 0x34, 0x20, 0x26, 0x26, 0x20, 0x28, 0x69, 0x6E,
0x64, 0x3D, 0x61, 0x64, 0x64, 0x72, 0x2E, 0x69, 0x6E, 0x64, 0x65, 0x78,
0x4F, 0x66, 0x28, 0x73, 0x65, 0x70, 0x29, 0x29, 0x21, 0x3D, 0x2D, 0x31,
0x29, 0x7B, 0x0A, 0x09, 0x09, 0x6E, 0x2B, 0x2B, 0x3B, 0x0A, 0x09, 0x09,
0x69, 0x66, 0x28, 0x61, 0x64, 0x64, 0x72, 0x2E, 0x63, 0x68, 0x61, 0x72,
0x41, 0x74, 0x28, 0x69, 0x6E, 0x64, 0x2B, 0x31, 0x29, 0x3D, 0x3D, 0x73,
0x65, 0x70, 0x29, 0x0A, 0x09, 0x09, 0x09, 0x6E, 0x2B, 0x3D, 0x37, 0x2D,
0x6E, 0x63, 0x6F, 0x6C, 0x3B, 0x09, 0x09, 0x0A, 0x09, 0x09, 0x61, 0x64,
0x64, 0x72, 0x3D, 0x61, 0x64, 0x64, 0x72, 0x2E, 0x73, 0x6C, 0x69, 0x63,
0x65, 0x28, 0x69, 0x6E, 0x64, 0x2B, 0x31, 0x29, 0x3B, 0x0A, 0x09, 0x09,
0x69, 0x6E, 0x64, 0x74, 0x6F, 0x74, 0x2B, 0x3D, 0x69, 0x6E, 0x64, 0x2B,
0x31, 0x3B, 0x0A, 0x09, 0x7D, 0x0A, 0x09, 0x69, 0x66, 0x28, 0x69, 0x6E,
0x64, 0x3D, 0x3D, 0x2D, 0x31, 0x29, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72,
0x6E, 0x3B, 0x0A, 0x09, 0x6E, 0x65, 0x77, 0x61, 0x64, 0x64, 0x72, 0x20,
0x3D, 0x20, 0x68, 0x61, 0x64, 0x64, 0x72, 0x2E, 0x73, 0x6C, 0x69, 0x63,
0x65, 0x28, 0x30, 0x2C, 0x69, 0x6E, 0x64, 0x74, 0x6F, 0x74, 0x29, 0x2B,
0x69, 0x69, 0x64, 0x3B, 0x0A, 0x09, 0x6F, 0x6C, 0x64, 0x69, 0x69, 0x64,
0x20, 0x3D, 0x20, 0x68, 0x61, 0x64, 0x64, 0x72, 0x2E, 0x73, 0x6C, 0x69,
0x63, 0x65, 0x28, 0x69, 0x6E, 0x64, 0x74, 0x6F, 0x74, 0x29, 0x3B, 0x0A,
0x09, 0x65, 0x6E, 0x64, 0x3D, 0x6F, 0x6C, 0x64, 0x69, 0x69, 0x64, 0x2E,
0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x28, 0x2F, 0x5B, 0x5E, 0x30, 0x2D,
0x39, 0x61, 0x2D, 0x66, 0x3A, 0x2D, 0x5D, 0x2F, 0x69, 0x29, 0x3B, 0x0A,
0x09, 0x69, 0x66, 0x28, 0x65, 0x6E, 0x64, 0x21, 0x3D, 0x2D, 0x31, 0x29,
0x0A, 0x09, 0x09, 0x6E, 0x65, 0x77, 0x61, 0x64, 0x64, 0x72, 0x20, 0x3D,
0x20, 0x6E, 0x65, 0x77, 0x61, 0x64, 0x64, 0x72, 0x2B, 0x6F, 0x6C, 0x64,
0x69, 0x69, 0x64, 0x2E, 0x73, 0x6C, 0x69, 0x63, 0x65, 0x28, 0x65, 0x6E,
0x64, 0x29, 0x3B, 0x0A, 0x09, 0x69, 0x66, 0x28, 0x21, 0x69, 0x65, 0x37,
0x6C, 0x6C, 0x26, 0x26, 0x6E, 0x65, 0x77, 0x61, 0x64, 0x64, 0x72, 0x2E,
0x63, 0x68, 0x61, 0x72, 0x41, 0x74, 0x28, 0x30, 0x29, 0x21, 0x3D, 0x27,
0x5B, 0x27, 0x29, 0x0A, 0x09, 0x09, 0x6E, 0x65, 0x77, 0x61, 0x64, 0x64,
0x72, 0x3D, 0x27, 0x5B, 0x27, 0x2B, 0x6E, 0x65, 0x77, 0x61, 0x64, 0x64,
0x72, 0x2B, 0x27, 0x5D, 0x27, 0x3B, 0x0A, 0x09, 0x69, 0x66, 0x28, 0x6E,
0x61, 0x76, 0x69, 0x67, 0x61, 0x74, 0x6F, 0x72, 0x2E, 0x75, 0x73, 0x65,
0x72, 0x41, 0x67, 0x65, 0x6E, 0x74, 0x2E, 0x73, 0x65, 0x61, 0x72, 0x63,
0x68, 0x28, 0x2F, 0x46, 0x69, 0x72, 0x65, 0x66, 0x6F, 0x78, 0x2F, 0x69,
0x29, 0x3D, 0x3D, 0x2D, 0x31, 0x29, 0x0A, 0x09, 0x09, 0x6E, 0x65, 0x77,
0x61, 0x64, 0x64, 0x72, 0x3D, 0x6E, 0x65, 0x77, 0x61, 0x64, 0x64, 0x72,
0x2E, 0x72, 0x65, 0x70, 0x6C, 0x61, 0x63, 0x65, 0x28, 0x27, 0x25, 0x27,
0x2C, 0x65, 0x73, 0x63, 0x29, 0x3B, 0x0A, 0x09, 0x72, 0x65, 0x74, 0x75,
0x72, 0x6E, 0x20, 0x6E, 0x65, 0x77, 0x61, 0x64, 0x64, 0x72, 0x3B, 0x0A,
0x7D, 0x0A, 0x3C, 0x2F, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x3E, 0x0A,
0x3C, 0x68, 0x31, 0x3E, 0x4E, 0x6F, 0x64, 0x65, 0x0A, 0x25, 0x21, 0x20,
0x6E, 0x6F, 0x64, 0x65, 0x69, 0x64, 0x0A, 0x3C, 0x2F, 0x68, 0x31, 0x3E,
0x0A, 0x3C, 0x68, 0x32, 0x3E, 0x4E, 0x65, 0x69, 0x67, 0x68, 0x62, 0x6F,
0x72, 0x73, 0x3C, 0x2F, 0x68, 0x32, 0x3E, 0x0A, 0x3C, 0x75, 0x6C, 0x3E,
0x0A, 0x25, 0x21, 0x20, 0x6E, 0x65, 0x69, 0x67, 0x68, 0x62, 0x6F, 0x72,
0x73, 0x0A, 0x3C, 0x2F, 0x75, 0x6C, 0x3E, 0x0A, 0x25, 0x21, 0x3A, 0x20,
0x2F, 0x66, 0x6F, 0x6F, 0x74, 0x65, 0x72, 0x2E, 0x68, 0x74, 0x6D, 0x6C,
0x0A, 0x0A, 0};
static const char data_404_html[] = {
/* /404.html */
0x2f, 0x34, 0x30, 0x34, 0x2e, 0x68, 0x74, 0x6d, 0x6c, 0,
0x3c, 0x68, 0x74, 0x6d, 0x6c, 0x3e, 0xa, 0x20, 0x20, 0x3c,
0x62, 0x6f, 0x64, 0x79, 0x20, 0x62, 0x67, 0x63, 0x6f, 0x6c,
0x6f, 0x72, 0x3d, 0x22, 0x77, 0x68, 0x69, 0x74, 0x65, 0x22,
0x3e, 0xa, 0x20, 0x20, 0x20, 0x20, 0x3c, 0x63, 0x65, 0x6e,
0x74, 0x65, 0x72, 0x3e, 0xa, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 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,
0xa, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 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, 0xa, 0x20,
0x20, 0x20, 0x20, 0x3c, 0x2f, 0x63, 0x65, 0x6e, 0x74, 0x65,
0x72, 0x3e, 0xa, 0x20, 0x20, 0x3c, 0x2f, 0x62, 0x6f, 0x64,
0x79, 0x3e, 0xa, 0x3c, 0x2f, 0x68, 0x74, 0x6d, 0x6c, 0x3e,
0};
static const char data_header_html[] = {
/* /header.html */
0x2f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x2e, 0x68, 0x74, 0x6d, 0x6c, 0,
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, 0xa, 0x3c, 0x68, 0x74, 0x6d, 0x6c, 0x3e, 0xa,
0x3c, 0x68, 0x65, 0x61, 0x64, 0x3e, 0xa, 0x3c, 0x74, 0x69,
0x74, 0x6c, 0x65, 0x3e, 0x43, 0x6f, 0x6e, 0x74, 0x69, 0x6b,
0x69, 0x3c, 0x2f, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x3e, 0xa,
0x3c, 0x2f, 0x68, 0x65, 0x61, 0x64, 0x3e, 0xa, 0x3c, 0x62,
0x6f, 0x64, 0x79, 0x20, 0x62, 0x67, 0x63, 0x6f, 0x6c, 0x6f,
0x72, 0x3d, 0x22, 0x77, 0x68, 0x69, 0x74, 0x65, 0x22, 0x20,
0x6f, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x3d, 0x22, 0x6c, 0x6f,
0x61, 0x64, 0x28, 0x29, 0x22, 0x3e, 0xa, 0x3c, 0x74, 0x61,
0x62, 0x6c, 0x65, 0x20, 0x62, 0x6f, 0x72, 0x64, 0x65, 0x72,
0x3d, 0x30, 0x20, 0x63, 0x65, 0x6c, 0x6c, 0x70, 0x61, 0x64,
0x64, 0x69, 0x6e, 0x67, 0x3d, 0x34, 0x20, 0x63, 0x65, 0x6c,
0x6c, 0x73, 0x70, 0x61, 0x63, 0x69, 0x6e, 0x67, 0x3d, 0x34,
0x3e, 0x3c, 0x74, 0x72, 0x3e, 0x3c, 0x74, 0x64, 0x20, 0x76,
0x61, 0x6c, 0x69, 0x67, 0x6e, 0x3d, 0x22, 0x74, 0x6f, 0x70,
0x22, 0x20, 0x61, 0x6c, 0x69, 0x67, 0x6e, 0x3d, 0x22, 0x72,
0x69, 0x67, 0x68, 0x74, 0x22, 0x3e, 0xa, 0x3c, 0x68, 0x31,
0x3e, 0x43, 0x6f, 0x6e, 0x74, 0x69, 0x6b, 0x69, 0x26, 0x6e,
0x62, 0x73, 0x70, 0x3b, 0x3c, 0x2f, 0x68, 0x31, 0x3e, 0xa,
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,
0xa, 0x3c, 0x61, 0x20, 0x68, 0x72, 0x65, 0x66, 0x3d, 0x22,
0x6e, 0x65, 0x69, 0x67, 0x68, 0x62, 0x6f, 0x72, 0x73, 0x2e,
0x73, 0x68, 0x74, 0x6d, 0x6c, 0x22, 0x3e, 0x4e, 0x65, 0x69,
0x67, 0x68, 0x62, 0x6f, 0x72, 0x73, 0x3c, 0x2f, 0x61, 0x3e,
0x3c, 0x62, 0x72, 0x3e, 0xa, 0x3c, 0x61, 0x20, 0x68, 0x72,
0x65, 0x66, 0x3d, 0x22, 0x73, 0x65, 0x6e, 0x73, 0x6f, 0x72,
0x73, 0x2e, 0x73, 0x68, 0x74, 0x6d, 0x6c, 0x22, 0x3e, 0x53,
0x65, 0x6e, 0x73, 0x6f, 0x72, 0x73, 0x3c, 0x2f, 0x61, 0x3e,
0x3c, 0x62, 0x72, 0x3e, 0xa, 0x3c, 0x2f, 0x74, 0x64, 0x3e,
0x3c, 0x74, 0x64, 0x20, 0x76, 0x61, 0x6c, 0x69, 0x67, 0x6e,
0x3d, 0x22, 0x74, 0x6f, 0x70, 0x22, 0x20, 0x61, 0x6c, 0x69,
0x67, 0x6e, 0x3d, 0x22, 0x6c, 0x65, 0x66, 0x74, 0x22, 0x3e,
0xa, 0};
static const char data_index_html[] = {
/* /index.html */
0x2f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x2e, 0x68, 0x74, 0x6d, 0x6c, 0,
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, 0xa, 0x3c, 0x68, 0x74, 0x6d, 0x6c, 0x3e, 0xa,
0x3c, 0x68, 0x65, 0x61, 0x64, 0x3e, 0xa, 0x3c, 0x74, 0x69,
0x74, 0x6c, 0x65, 0x3e, 0x43, 0x6f, 0x6e, 0x74, 0x69, 0x6b,
0x69, 0x3c, 0x2f, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x3e, 0xa,
0x3c, 0x2f, 0x68, 0x65, 0x61, 0x64, 0x3e, 0xa, 0x3c, 0x62,
0x6f, 0x64, 0x79, 0x20, 0x62, 0x67, 0x63, 0x6f, 0x6c, 0x6f,
0x72, 0x3d, 0x22, 0x77, 0x68, 0x69, 0x74, 0x65, 0x22, 0x3e,
0xa, 0x3c, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x62, 0x6f,
0x72, 0x64, 0x65, 0x72, 0x3d, 0x30, 0x20, 0x63, 0x65, 0x6c,
0x6c, 0x70, 0x61, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x3d, 0x34,
0x20, 0x63, 0x65, 0x6c, 0x6c, 0x73, 0x70, 0x61, 0x63, 0x69,
0x6e, 0x67, 0x3d, 0x34, 0x3e, 0x3c, 0x74, 0x72, 0x3e, 0x3c,
0x74, 0x64, 0x20, 0x76, 0x61, 0x6c, 0x69, 0x67, 0x6e, 0x3d,
0x22, 0x74, 0x6f, 0x70, 0x22, 0x20, 0x61, 0x6c, 0x69, 0x67,
0x6e, 0x3d, 0x22, 0x72, 0x69, 0x67, 0x68, 0x74, 0x22, 0x3e,
0xa, 0x3c, 0x68, 0x31, 0x3e, 0x43, 0x6f, 0x6e, 0x74, 0x69,
0x6b, 0x69, 0x26, 0x6e, 0x62, 0x73, 0x70, 0x3b, 0x3c, 0x2f,
0x68, 0x31, 0x3e, 0xa, 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, 0xa, 0x3c, 0x61, 0x20, 0x68, 0x72,
0x65, 0x66, 0x3d, 0x22, 0x6e, 0x65, 0x69, 0x67, 0x68, 0x62,
0x6f, 0x72, 0x73, 0x2e, 0x73, 0x68, 0x74, 0x6d, 0x6c, 0x22,
0x3e, 0x4e, 0x65, 0x69, 0x67, 0x68, 0x62, 0x6f, 0x72, 0x73,
0x3c, 0x2f, 0x61, 0x3e, 0x3c, 0x62, 0x72, 0x3e, 0xa, 0x3c,
0x61, 0x20, 0x68, 0x72, 0x65, 0x66, 0x3d, 0x22, 0x73, 0x65,
0x6e, 0x73, 0x6f, 0x72, 0x73, 0x2e, 0x73, 0x68, 0x74, 0x6d,
0x6c, 0x22, 0x3e, 0x53, 0x65, 0x6e, 0x73, 0x6f, 0x72, 0x73,
0x3c, 0x2f, 0x61, 0x3e, 0x3c, 0x62, 0x72, 0x3e, 0xa, 0x3c,
0x2f, 0x74, 0x64, 0x3e, 0x3c, 0x74, 0x64, 0x20, 0x76, 0x61,
0x6c, 0x69, 0x67, 0x6e, 0x3d, 0x22, 0x74, 0x6f, 0x70, 0x22,
0x20, 0x61, 0x6c, 0x69, 0x67, 0x6e, 0x3d, 0x22, 0x6c, 0x65,
0x66, 0x74, 0x22, 0x3e, 0xa, 0x3c, 0x2f, 0x74, 0x61, 0x62,
0x6c, 0x65, 0x3e, 0xa, 0x3c, 0x2f, 0x62, 0x6f, 0x64, 0x79,
0x3e, 0xa, 0x3c, 0x2f, 0x68, 0x74, 0x6d, 0x6c, 0x3e, 0xa,
0};
const struct httpd_fsdata_file file_sensordata_shtml[] = {{NULL, data_sensordata_shtml, data_sensordata_shtml + 18, sizeof(data_sensordata_shtml) - 18}};
const struct httpd_fsdata_file file_sensors_shtml[] = {{file_sensordata_shtml, data_sensors_shtml, data_sensors_shtml + 15, sizeof(data_sensors_shtml) - 15}};
const struct httpd_fsdata_file file_footer_html[] = {{file_sensors_shtml, data_footer_html, data_footer_html + 13, sizeof(data_footer_html) - 13}};
const struct httpd_fsdata_file file_spin_gif[] = {{file_footer_html, data_spin_gif, data_spin_gif + 10, sizeof(data_spin_gif) - 10}};
const struct httpd_fsdata_file file_neighbors_shtml[] = {{file_spin_gif, data_neighbors_shtml, data_neighbors_shtml + 17, sizeof(data_neighbors_shtml) - 17}};
const struct httpd_fsdata_file file_404_html[] = {{file_neighbors_shtml, data_404_html, data_404_html + 10, sizeof(data_404_html) - 10}};
const struct httpd_fsdata_file file_header_html[] = {{file_404_html, data_header_html, data_header_html + 13, sizeof(data_header_html) - 13}};
const struct httpd_fsdata_file file_index_html[] = {{file_header_html, data_index_html, data_index_html + 12, sizeof(data_index_html) - 12}};
#define HTTPD_FS_ROOT file_index_html
#define HTTPD_FS_NUMFILES 8

View File

@ -0,0 +1,50 @@
/*
* Copyright (c) 2006, 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 Contiki operating system.
*
*/
/**
* \file
* Multi-hop webserver for the Tmote Sky.
* \author
* Adam Dunkels <adam@sics.se>
*/
/*
* salvopitru: example adapted to MB851.
*/
#include "webserver-nogui.h"
#include "contiki.h"
/*---------------------------------------------------------------------------*/
AUTOSTART_PROCESSES(&webserver_nogui_process);
/*---------------------------------------------------------------------------*/

View File

@ -0,0 +1,24 @@
#ifndef __WEBSERVER_AJAX_CONF_H__
#define __WEBSERVER_AJAX_CONF_H__
#undef WITH_RIME
#define WITH_RIME 1
#undef ENERGEST_CONF_ON
#define ENERGEST_CONF_ON 1
#undef UIP_CONF_ROUTER
#define UIP_CONF_ROUTER 0
#undef WITH_SERIAL_LINE_INPUT
#define WITH_SERIAL_LINE_INPUT 0
/* Needed for communicating with other nodes outside the LoWPAN,
as UDP checksum is not optional in IPv6. */
#undef UIP_CONF_UDP_CHECKSUMS
#define UIP_CONF_UDP_CHECKSUMS 1
#endif /* __WEBSERVER_AJAX_CONF_H__ */