Stefan Schuermans
initial commit after making CF identify work
Stefan Schuermans commited e8658d5 at 2012-04-15 19:57:57
/* flaneth - flash and ethernet - dartboard mod
* version 0.1 date 2008-11-09
* Copyright (C) 2007-2008 Stefan Schuermans <stefan@schuermans.info>
* Copyleft: GNU public license V2 - http://www.gnu.org/copyleft/gpl.html
* a BlinkenArea project - http://www.blinkenarea.org/
*/
#include <string.h>
#include <avr/pgmspace.h>
#include "dart.h"
#include "debug.h"
#include "http.h"
#include "macros.h"
#include "tcp.h"
// receive states while parsing HTTP request
#define HTTP_RCV_CMD 0 // receiving HTTP command (e.g. GET)
#define HTTP_RCV_FILE 1 // receiving filename
#define HTTP_RCV_LEN 2 // receiving content length
#define HTTP_RCV_HDR_END 3 // receiving header until end
#define HTTP_RCV_DATA 4 // receiving post data
#define HTTP_RCV_DONE 5 // receiving completed
// knwon HTTP commands
#define HTTP_CMD_UNKNOWN 0 // unknown HTTP command
#define HTTP_CMD_GET 1 // GET command
#define HTTP_CMD_POST 2 // POST command
// files available using HTTP
#define HTTP_FILE_NOT_FOUND 0 // file not found file
#define HTTP_FILE_INDEX 1 // index file
#define HTTP_FILE_DART 10 // dartboard response, still waiting
#define HTTP_FILE_DART_NO 11 // dartboard response, no hit
#define HTTP_FILE_DART_1D 12 // dartboard response, 1 digit hit
#define HTTP_FILE_DART_2D 13 // dartboard response, 2 digit hit
// maximum HTTP/SOAP timeout (must be less than TCP timeout)
#define HttpMaxTimeout 45
// content of webpages and strings to fill in for variables
#include "http_content.inc"
// table with HTTP connections
struct HttpConnection
{
unsigned char ConnNo; // number of the TCP connection, 0xFF is unused
unsigned long RcvCnt; // number of received bytes on connection
unsigned char RcvState; // what is being received at the moment
unsigned char RcvBuf[32]; // receive buffer
unsigned char RcvBufLen; // length of data in receive buffer
 
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX