/**************************************************************
 * HTTPPrint.h
 * Provides callback headers and resolution for user's custom
 * HTTP Application.
 * 
 * This file is automatically generated by the MPFS Utility
 * ALL MODIFICATIONS WILL BE OVERWRITTEN BY THE MPFS GENERATOR
 **************************************************************/

#ifndef __HTTPPRINT_H
#define __HTTPPRINT_H

#include "TCPIP Stack/TCPIP.h"

#if defined(STACK_USE_HTTP2_SERVER)

extern HTTP_CONN curHTTP;
extern HTTP_STUB httpStubs[MAX_HTTP_CONNECTIONS];
extern BYTE curHTTPID;

void HTTPPrint(DWORD callbackID);
void HTTPPrint_builddate(void);
void HTTPPrint_version(void);
void HTTPPrint_hostname(void);
void HTTPPrint_machineDesc(void);
void HTTPPrint_name(WORD);
void HTTPPrint_stock(WORD);
void HTTPPrint_status(WORD);
void HTTPPrint_light_chk(WORD);

void HTTPPrint(DWORD callbackID)
{
	switch(callbackID)
	{
        case 0x00000000:
			HTTPIncFile((ROM BYTE*)"header.inc");
			break;
        case 0x00000002:
			HTTPIncFile((ROM BYTE*)"footer.inc");
			break;
        case 0x00000005:
			HTTPPrint_builddate();
			break;
        case 0x00000016:
			HTTPPrint_version();
			break;
        case 0x00000032:
			HTTPPrint_hostname();
			break;
        case 0x00000033:
			HTTPPrint_machineDesc();
			break;
        case 0x00000034:
			HTTPPrint_name(0);
			break;
        case 0x00000035:
			HTTPPrint_stock(0);
			break;
        case 0x00000036:
			HTTPPrint_name(1);
			break;
        case 0x00000037:
			HTTPPrint_stock(1);
			break;
        case 0x00000038:
			HTTPPrint_name(2);
			break;
        case 0x00000039:
			HTTPPrint_stock(2);
			break;
        case 0x0000003a:
			HTTPPrint_name(3);
			break;
        case 0x0000003b:
			HTTPPrint_stock(3);
			break;
        case 0x0000003c:
			HTTPPrint_name(4);
			break;
        case 0x0000003d:
			HTTPPrint_stock(4);
			break;
        case 0x0000003e:
			HTTPPrint_name(5);
			break;
        case 0x0000003f:
			HTTPPrint_stock(5);
			break;
        case 0x00000040:
			HTTPPrint_name(6);
			break;
        case 0x00000041:
			HTTPPrint_stock(6);
			break;
        case 0x00000042:
			HTTPPrint_status(0);
			break;
        case 0x00000043:
			HTTPPrint_status(1);
			break;
        case 0x00000044:
			HTTPPrint_status(2);
			break;
        case 0x00000045:
			HTTPPrint_status(3);
			break;
        case 0x00000046:
			HTTPPrint_status(4);
			break;
        case 0x00000047:
			HTTPPrint_status(5);
			break;
        case 0x00000048:
			HTTPPrint_status(6);
			break;
        case 0x00000049:
			HTTPPrint_light_chk(1);
			break;
        case 0x0000004a:
			HTTPPrint_light_chk(0);
			break;
		default:
			// Output notification for undefined values
			TCPPutROMArray(sktHTTP, (ROM BYTE*)"!DEF", 4);
	}

	return;
}

void HTTPPrint_(void)
{
	TCPPut(sktHTTP, '~');
	return;
}

#endif

#endif
