/*
[31/May/2004] by Kevin
    Change  8000.h  ===> 8000E.h 
    Add function Port9999Start
*/    
/*#include "..\lib\8000.h"
#include "..\lib\vxcomm.h"
change to module1.h
*/
#include "module1.h"

void Port9999Start(int skt)
{
    /* XS8_3200.Lib (20,Apr,2004) or later version supports this function.
    
    When a TCP/IP client connects to the 7188E/8000E TCP port 9999, 
    the Xserver calls the function once.
    
    You can use function VcomSendSocket to send a message to the client 
    when a connection is established.
    For example:
        VcomSendSocket(skt,"Connection is established.",26);	// return 26 bytes.

    skt: socket number assigned to the TCP/IP client.
    */
    
    skt=skt; //do nothing
}    

int VcomCmd7000(TCPREADDATA *p)
{ /*
    VCOM3001 or later will call this function for port 9999.
    when socket from TCP PORT 9999 will call this function.
    user can get the following message:
    p->ReadUartChar : the buffer store the command data.
    p->Length : the command data length.
    p->Socket : the socket number that receive the command, that is when the user function want 
                return message to the client, just use the socket to send data.
                use:  VcomSendSocket(p->Socket,pdata,datalength);
  */
  
  /*       here just send back the command come from port 9999. */
	VcomSendSocket(p->Socket,p->ReadUartChar,p->Length);
	return 1;	/* any value will be accept */
}