Use _delay_us() function in the XPROGTarget.c file to ensure timing requirements...
[pub/USBasp.git] / Projects / Webserver / Lib / HTTPServerApp.h
1 /*
2 LUFA Library
3 Copyright (C) Dean Camera, 2010.
4
5 dean [at] fourwalledcubicle [dot] com
6 www.fourwalledcubicle.com
7 */
8
9 /*
10 Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
11
12 Permission to use, copy, modify, distribute, and sell this
13 software and its documentation for any purpose is hereby granted
14 without fee, provided that the above copyright notice appear in
15 all copies and that both that the copyright notice and this
16 permission notice and warranty disclaimer appear in supporting
17 documentation, and that the name of the author not be used in
18 advertising or publicity pertaining to distribution of the
19 software without specific, written prior permission.
20
21 The author disclaim all warranties with regard to this
22 software, including all implied warranties of merchantability
23 and fitness. In no event shall the author be liable for any
24 special, indirect or consequential damages or any damages
25 whatsoever resulting from loss of use, data or profits, whether
26 in an action of contract, negligence or other tortious action,
27 arising out of or in connection with the use or performance of
28 this software.
29 */
30
31 /** \file
32 *
33 * Header file for HTTPServerApp.c.
34 */
35
36 #ifndef _HTTPSERVER_APP_H_
37 #define _HTTPSERVER_APP_H_
38
39 /* Includes: */
40 #include <avr/pgmspace.h>
41 #include <string.h>
42
43 #include <uip.h>
44 #include <ff.h>
45
46 /* Enums: */
47 /** States for each HTTP connection to the webserver. */
48 enum Webserver_States_t
49 {
50 WEBSERVER_STATE_OpenRequestedFile, /** Currently opening requested file */
51 WEBSERVER_STATE_SendResponseHeader, /**< Currently sending HTTP response headers to the client */
52 WEBSERVER_STATE_SendMIMETypeHeader, /**< Currently sending HTTP MIME type header to the client */
53 WEBSERVER_STATE_SendData, /**< Currently sending HTTP page data to the client */
54 WEBSERVER_STATE_Closed, /**< Connection closed after all data sent */
55 };
56
57 /* Type Defines: */
58 /** Type define for a MIME type handler. */
59 typedef struct
60 {
61 char Extension[4]; /**< 3 or less character file extension */
62 char MIMEType[30]; /**< Appropriate MIME type to send when the extension is encountered */
63 } MIME_Type_t;
64
65 /* Macros: */
66 /** TCP listen port for incomming HTTP traffic */
67 #define HTTP_SERVER_PORT 80
68
69 /* Function Prototypes: */
70 void WebserverApp_Init(void);
71 void WebserverApp_Callback(void);
72
73 #endif