Details | Last modification | View Log | SVN | RSS feed
| Rev | Author | Line No. | Line |
|---|---|---|---|
| 363 | johboh | 1 | |
| 2 | |||
| 3 | #ifndef SGP_H |
||
| 4 | #define SGP_H |
||
| 5 | |||
| 6 | #define SGP_PORT (6666) |
||
| 7 | |||
| 8 | |||
| 9 | /********************************************************************* |
||
| 10 | * Function: void HTTPInit(void) |
||
| 11 | * |
||
| 12 | * PreCondition: TCP must already be initialized. |
||
| 13 | * |
||
| 14 | * Input: None |
||
| 15 | * |
||
| 16 | * Output: HTTP FSM and connections are initialized |
||
| 17 | * |
||
| 18 | * Side Effects: None |
||
| 19 | * |
||
| 20 | * Overview: Set all HTTP connections to Listening state. |
||
| 21 | * Initialize FSM for each connection. |
||
| 22 | * |
||
| 23 | * Note: This function is called only one during lifetime |
||
| 24 | * of the application. |
||
| 25 | ********************************************************************/ |
||
| 26 | void SGPInit(void); |
||
| 27 | |||
| 28 | |||
| 29 | /********************************************************************* |
||
| 30 | * Function: void HTTPServer(void) |
||
| 31 | * |
||
| 32 | * PreCondition: HTTPInit() must already be called. |
||
| 33 | * |
||
| 34 | * Input: None |
||
| 35 | * |
||
| 36 | * Output: Opened HTTP connections are served. |
||
| 37 | * |
||
| 38 | * Side Effects: None |
||
| 39 | * |
||
| 40 | * Overview: Browse through each connections and let it |
||
| 41 | * handle its connection. |
||
| 42 | * If a connection is not finished, do not process |
||
| 43 | * next connections. This must be done, all |
||
| 44 | * connections use some static variables that are |
||
| 45 | * common. |
||
| 46 | * |
||
| 47 | * Note: This function acts as a task (similar to one in |
||
| 48 | * RTOS). This function performs its task in |
||
| 49 | * co-operative manner. Main application must call |
||
| 50 | * this function repeatdly to ensure all open |
||
| 51 | * or new connections are served on time. |
||
| 52 | ********************************************************************/ |
||
| 53 | void SGPServer(void); |
||
| 54 | |||
| 55 | |||
| 56 | #endif |