Line No. | Rev | Author | Line |
---|---|---|---|
1 | 32 | kaklik | /********************************************************************* |
2 | * |
||
3 | * HTTP definitions on Microchip TCP/IP Stack |
||
4 | * |
||
5 | ********************************************************************* |
||
6 | * FileName: HTTP.h |
||
7 | * Dependencies: None |
||
8 | * Processor: PIC18, PIC24F, PIC24H, dsPIC30F, dsPIC33F, PIC32 |
||
9 | * Compiler: Microchip C32 v1.05 or higher |
||
10 | * Microchip C30 v3.12 or higher |
||
11 | * Microchip C18 v3.30 or higher |
||
12 | * HI-TECH PICC-18 PRO 9.63PL2 or higher |
||
13 | * Company: Microchip Technology, Inc. |
||
14 | * |
||
15 | * Software License Agreement |
||
16 | * |
||
17 | * Copyright (C) 2002-2009 Microchip Technology Inc. All rights |
||
18 | * reserved. |
||
19 | * |
||
20 | * Microchip licenses to you the right to use, modify, copy, and |
||
21 | * distribute: |
||
22 | * (i) the Software when embedded on a Microchip microcontroller or |
||
23 | * digital signal controller product ("Device") which is |
||
24 | * integrated into Licensee's product; or |
||
25 | * (ii) ONLY the Software driver source files ENC28J60.c, ENC28J60.h, |
||
26 | * ENCX24J600.c and ENCX24J600.h ported to a non-Microchip device |
||
27 | * used in conjunction with a Microchip ethernet controller for |
||
28 | * the sole purpose of interfacing with the ethernet controller. |
||
29 | * |
||
30 | * You should refer to the license agreement accompanying this |
||
31 | * Software for additional information regarding your rights and |
||
32 | * obligations. |
||
33 | * |
||
34 | * THE SOFTWARE AND DOCUMENTATION ARE PROVIDED "AS IS" WITHOUT |
||
35 | * WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT |
||
36 | * LIMITATION, ANY WARRANTY OF MERCHANTABILITY, FITNESS FOR A |
||
37 | * PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT SHALL |
||
38 | * MICROCHIP BE LIABLE FOR ANY INCIDENTAL, SPECIAL, INDIRECT OR |
||
39 | * CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF |
||
40 | * PROCUREMENT OF SUBSTITUTE GOODS, TECHNOLOGY OR SERVICES, ANY CLAIMS |
||
41 | * BY THIRD PARTIES (INCLUDING BUT NOT LIMITED TO ANY DEFENSE |
||
42 | * THEREOF), ANY CLAIMS FOR INDEMNITY OR CONTRIBUTION, OR OTHER |
||
43 | * SIMILAR COSTS, WHETHER ASSERTED ON THE BASIS OF CONTRACT, TORT |
||
44 | * (INCLUDING NEGLIGENCE), BREACH OF WARRANTY, OR OTHERWISE. |
||
45 | * |
||
46 | * |
||
47 | * Author Date Comment |
||
48 | *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
||
49 | * Nilesh Rajbharti 8/14/01 Original (Rev. 1.0) |
||
50 | * Nilesh Rajbharti 2/9/02 Cleanup |
||
51 | * Nilesh Rajbharti 5/22/02 Rev 2.0 (See version.log for detail) |
||
52 | ********************************************************************/ |
||
53 | #ifndef __HTTP_H |
||
54 | #define __HTTP_H |
||
55 | |||
56 | |||
57 | #define HTTP_PORT (80u) |
||
58 | |||
59 | #define HTTP_START_OF_VAR (0x0000u) |
||
60 | #define HTTP_END_OF_VAR (0xFFFFu) |
||
61 | |||
62 | |||
63 | /********************************************************************* |
||
64 | * Function: void HTTPInit(void) |
||
65 | * |
||
66 | * PreCondition: TCP must already be initialized. |
||
67 | * |
||
68 | * Input: None |
||
69 | * |
||
70 | * Output: HTTP FSM and connections are initialized |
||
71 | * |
||
72 | * Side Effects: None |
||
73 | * |
||
74 | * Overview: Set all HTTP connections to Listening state. |
||
75 | * Initialize FSM for each connection. |
||
76 | * |
||
77 | * Note: This function is called only one during lifetime |
||
78 | * of the application. |
||
79 | ********************************************************************/ |
||
80 | void HTTPInit(void); |
||
81 | |||
82 | |||
83 | /********************************************************************* |
||
84 | * Function: void HTTPServer(void) |
||
85 | * |
||
86 | * PreCondition: HTTPInit() must already be called. |
||
87 | * |
||
88 | * Input: None |
||
89 | * |
||
90 | * Output: Opened HTTP connections are served. |
||
91 | * |
||
92 | * Side Effects: None |
||
93 | * |
||
94 | * Overview: Browse through each connections and let it |
||
95 | * handle its connection. |
||
96 | * If a connection is not finished, do not process |
||
97 | * next connections. This must be done, all |
||
98 | * connections use some static variables that are |
||
99 | * common. |
||
100 | * |
||
101 | * Note: This function acts as a task (similar to one in |
||
102 | * RTOS). This function performs its task in |
||
103 | * co-operative manner. Main application must call |
||
104 | * this function repeatdly to ensure all open |
||
105 | * or new connections are served on time. |
||
106 | ********************************************************************/ |
||
107 | void HTTPServer(void); |
||
108 | |||
109 | #if defined(__HTTP_C) |
||
110 | /* |
||
111 | * Main application must implement these callback functions |
||
112 | * to complete Http.c implementation. |
||
113 | */ |
||
114 | extern WORD HTTPGetVar(BYTE var, WORD ref, BYTE* val); |
||
115 | extern void HTTPExecCmd(BYTE** argv, BYTE argc); |
||
116 | #endif |
||
117 | |||
118 | |||
119 | #endif |
Powered by WebSVN v2.8.3