Index: branches/fep_client_cpp/network_factory.cpp
===================================================================
--- branches/fep_client_cpp/network_factory.cpp	(revision 70)
+++ branches/fep_client_cpp/network_factory.cpp	(revision 70)
@@ -0,0 +1,14 @@
+#include "network.h"
+
+FEP_LINE_LDS * load_lines(int *size, const char * fName)
+{
+	FEP_LINE_LDS lines[1];
+	*size = 1;
+	return lines;	
+}
+
+FEP_LDS * load_lds(const char * fName)
+{
+	FEP_LDS lds[1];
+	return lds;
+}
Index: branches/fep_client_cpp/dummyserver/fep_server.c
===================================================================
--- branches/fep_client_cpp/dummyserver/fep_server.c	(revision 70)
+++ branches/fep_client_cpp/dummyserver/fep_server.c	(revision 70)
@@ -0,0 +1,348 @@
+/*
+ * This is sample code generated by rpcgen.
+ * These are only templates and you can use them
+ * as a guideline for developing your own functions.
+ */
+
+#include "fep.h"
+
+int *
+fep_getlineinfocount_32_svc(void *argp, struct svc_req *rqstp)
+{
+	static int  result;
+
+	/*
+	 * insert server code here
+	 */
+
+	return &result;
+}
+
+lineinfo_ret *
+fep_getlineinfo_32_svc(int *argp, struct svc_req *rqstp)
+{
+	static lineinfo_ret  result;
+
+	/*
+	 * insert server code here
+	 */
+
+	return &result;
+}
+
+lineinfo_ret *
+fep_getlineinfovalue_32_svc(int *argp, struct svc_req *rqstp)
+{
+	static lineinfo_ret  result;
+
+	/*
+	 * insert server code here
+	 */
+	return &result;
+}
+
+lineinfo_ret *
+fep_sendlineinfo_32_svc(fep_lineinfo *argp, struct svc_req *rqstp)
+{
+	static lineinfo_ret  result;
+
+	/*
+	 * insert server code here
+	 */
+
+	return &result;
+}
+
+std_time_ret *
+fep_gettime_32_svc(void *argp, struct svc_req *rqstp)
+{
+	static std_time_ret  result;
+
+	/*
+	 * insert server code here
+	 */
+
+	return &result;
+}
+
+std_time_ret *
+fep_settime_32_svc(fep_std_time *argp, struct svc_req *rqstp)
+{
+	static std_time_ret  result;
+
+	/*
+	 * insert server code here
+	 */
+
+	return &result;
+}
+
+std_time_ret *
+fep_advancetime_32_svc(int *argp, struct svc_req *rqstp)
+{
+	static std_time_ret  result;
+
+	/*
+	 * insert server code here
+	 */
+
+	return &result;
+}
+
+int *
+fep_getschedulecount_32_svc(void *argp, struct svc_req *rqstp)
+{
+	static int  result;
+
+	/*
+	 * insert server code here
+	 */
+
+	return &result;
+}
+
+schedule_ret *
+fep_getschedule_32_svc(int *argp, struct svc_req *rqstp)
+{
+	static schedule_ret  result;
+
+	/*
+	 * insert server code here
+	 */
+
+	return &result;
+}
+
+schedule_ret *
+fep_getschedulevalue_32_svc(int *argp, struct svc_req *rqstp)
+{
+	static schedule_ret  result;
+
+	/*
+	 * insert server code here
+	 */
+
+	return &result;
+}
+
+schedule_ret *
+fep_sendschedule_32_svc(fep_schedule *argp, struct svc_req *rqstp)
+{
+	static schedule_ret  result;
+
+	/*
+	 * insert server code here
+	 */
+
+	return &result;
+}
+
+errorstatus *
+fep_setlinemgr_schedule_32_svc(fep_setschedule *argp, struct svc_req *rqstp)
+{
+	static errorstatus  result;
+
+	/*
+	 * insert server code here
+	 */
+
+	return &result;
+}
+
+errorstatus *
+fep_free_schedule_32_svc(int *argp, struct svc_req *rqstp)
+{
+	static errorstatus  result;
+
+	/*
+	 * insert server code here
+	 */
+
+	return &result;
+}
+
+errorstatus *
+fep_idleline_32_svc(fep_lineop *argp, struct svc_req *rqstp)
+{
+	static errorstatus  result;
+
+	/*
+	 * insert server code here
+	 */
+
+	return &result;
+}
+
+errorstatus *
+fep_modemsignals_32_svc(fep_lineop *argp, struct svc_req *rqstp)
+{
+	static errorstatus  result;
+
+	/*
+	 * insert server code here
+	 */
+
+	return &result;
+}
+
+reply_ret *
+fep_getreply_32_svc(fep_reply_request *argp, struct svc_req *rqstp)
+{
+	static reply_ret  result;
+	/*
+	 * insert server code here
+	 */
+		
+	return &result;
+}
+
+errorstatus *
+fep_clearreply_32_svc(void *argp, struct svc_req *rqstp)
+{
+	static errorstatus  result;
+
+	/*
+	 * insert server code here
+	 */
+
+	return &result;
+}
+
+schedule_ret *
+fep_updateschedule_32_svc(fep_schedule *argp, struct svc_req *rqstp)
+{
+	static schedule_ret  result;
+
+	/*
+	 * insert server code here
+	 */
+
+	return &result;
+}
+
+int *
+fep_getreportcount_32_svc(void *argp, struct svc_req *rqstp)
+{
+	static int  result;
+
+	/*
+	 * insert server code here
+	 */
+
+	return &result;
+}
+
+report_ret *
+fep_getreport_32_svc(int *argp, struct svc_req *rqstp)
+{
+	static report_ret  result;
+
+	/*
+	 * insert server code here
+	 */
+
+	return &result;
+}
+
+report_ret *
+fep_getreportvalue_32_svc(int *argp, struct svc_req *rqstp)
+{
+	static report_ret  result;
+
+	/*
+	 * insert server code here
+	 */
+
+	return &result;
+}
+
+report_ret *
+fep_sendreport_32_svc(fep_report *argp, struct svc_req *rqstp)
+{
+	static report_ret  result;
+
+	/*
+	 * insert server code here
+	 */
+
+	return &result;
+}
+
+void *
+fep_reply_xfer_32_svc(fep_reply *argp, struct svc_req *rqstp)
+{
+	static reply_ret result;
+	return (void *) &result;
+}
+
+errorstatus *
+fep_set_debug_32_svc(int *argp, struct svc_req *rqstp)
+{
+	static errorstatus  result;
+
+	/*
+	 * insert server code here
+	 */
+
+	return &result;
+}
+
+int *
+fep_get_stack_left_32_svc(void *argp, struct svc_req *rqstp)
+{
+	static int  result;
+
+	/*
+	 * insert server code here
+	 */
+
+	return &result;
+}
+
+errorstatus *
+fep_setlmdebug_32_svc(fep_setschedule *argp, struct svc_req *rqstp)
+{
+	static errorstatus  result;
+
+	/*
+	 * insert server code here
+	 */
+
+	return &result;
+}
+
+errorstatus *
+fep_shutdown_32_svc(void *argp, struct svc_req *rqstp)
+{
+	static errorstatus  result;
+
+	/*
+	 * insert server code here
+	 */
+
+	return &result;
+}
+
+int *
+fep_initsystem_32_svc(int *argp, struct svc_req *rqstp)
+{
+	static int  result;
+
+	/*
+	 * insert server code here
+	 */
+
+	return &result;
+}
+
+int *
+fep_initrealix_32_svc(init_form *argp, struct svc_req *rqstp)
+{
+	static int  result;
+
+	/*
+	 * insert server code here
+	 */
+
+	return &result;
+}
Index: branches/fep_client_cpp/dummyserver/fep_svc.c
===================================================================
--- branches/fep_client_cpp/dummyserver/fep_svc.c	(revision 70)
+++ branches/fep_client_cpp/dummyserver/fep_svc.c	(revision 70)
@@ -0,0 +1,280 @@
+/*
+ * Please do not edit this file.
+ * It was generated using rpcgen.
+ */
+
+#include "fep.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <rpc/pmap_clnt.h>
+#include <string.h>
+#include <memory.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+
+#ifndef SIG_PF
+#define SIG_PF void(*)(int)
+#endif
+/* RPC SVC test */
+
+static void
+fep_program_32(struct svc_req *rqstp, register SVCXPRT *transp)
+{
+	union {
+		int fep_getlineinfo_32_arg;
+		int fep_getlineinfovalue_32_arg;
+		fep_lineinfo fep_sendlineinfo_32_arg;
+		fep_std_time fep_settime_32_arg;
+		int fep_advancetime_32_arg;
+		int fep_getschedule_32_arg;
+		int fep_getschedulevalue_32_arg;
+		fep_schedule fep_sendschedule_32_arg;
+		fep_setschedule fep_setlinemgr_schedule_32_arg;
+		int fep_free_schedule_32_arg;
+		fep_lineop fep_idleline_32_arg;
+		fep_lineop fep_modemsignals_32_arg;
+		fep_reply_request fep_getreply_32_arg;
+		fep_schedule fep_updateschedule_32_arg;
+		int fep_getreport_32_arg;
+		int fep_getreportvalue_32_arg;
+		fep_report fep_sendreport_32_arg;
+		fep_reply fep_reply_xfer_32_arg;
+		int fep_set_debug_32_arg;
+		fep_setschedule fep_setlmdebug_32_arg;
+		int fep_initsystem_32_arg;
+		init_form fep_initrealix_32_arg;
+	} argument;
+	char *result;
+	xdrproc_t _xdr_argument, _xdr_result;
+	char *(*local)(char *, struct svc_req *);
+
+	switch (rqstp->rq_proc) {
+	case NULLPROC:
+		(void) svc_sendreply (transp, (xdrproc_t) xdr_void, (char *)NULL);
+		return;
+
+	case FEP_GETLINEINFOCOUNT:
+		_xdr_argument = (xdrproc_t) xdr_void;
+		_xdr_result = (xdrproc_t) xdr_int;
+		local = (char *(*)(char *, struct svc_req *)) fep_getlineinfocount_32_svc;
+		break;
+
+	case FEP_GETLINEINFO:
+		_xdr_argument = (xdrproc_t) xdr_int;
+		_xdr_result = (xdrproc_t) xdr_lineinfo_ret;
+		local = (char *(*)(char *, struct svc_req *)) fep_getlineinfo_32_svc;
+		break;
+
+	case FEP_GETLINEINFOVALUE:
+		_xdr_argument = (xdrproc_t) xdr_int;
+		_xdr_result = (xdrproc_t) xdr_lineinfo_ret;
+		local = (char *(*)(char *, struct svc_req *)) fep_getlineinfovalue_32_svc;
+		break;
+
+	case FEP_SENDLINEINFO:
+		_xdr_argument = (xdrproc_t) xdr_fep_lineinfo;
+		_xdr_result = (xdrproc_t) xdr_lineinfo_ret;
+		local = (char *(*)(char *, struct svc_req *)) fep_sendlineinfo_32_svc;
+		break;
+
+	case FEP_GETTIME:
+		_xdr_argument = (xdrproc_t) xdr_void;
+		_xdr_result = (xdrproc_t) xdr_std_time_ret;
+		local = (char *(*)(char *, struct svc_req *)) fep_gettime_32_svc;
+		break;
+
+	case FEP_SETTIME:
+		_xdr_argument = (xdrproc_t) xdr_fep_std_time;
+		_xdr_result = (xdrproc_t) xdr_std_time_ret;
+		local = (char *(*)(char *, struct svc_req *)) fep_settime_32_svc;
+		break;
+
+	case FEP_ADVANCETIME:
+		_xdr_argument = (xdrproc_t) xdr_int;
+		_xdr_result = (xdrproc_t) xdr_std_time_ret;
+		local = (char *(*)(char *, struct svc_req *)) fep_advancetime_32_svc;
+		break;
+
+	case FEP_GETSCHEDULECOUNT:
+		_xdr_argument = (xdrproc_t) xdr_void;
+		_xdr_result = (xdrproc_t) xdr_int;
+		local = (char *(*)(char *, struct svc_req *)) fep_getschedulecount_32_svc;
+		break;
+
+	case FEP_GETSCHEDULE:
+		_xdr_argument = (xdrproc_t) xdr_int;
+		_xdr_result = (xdrproc_t) xdr_schedule_ret;
+		local = (char *(*)(char *, struct svc_req *)) fep_getschedule_32_svc;
+		break;
+
+	case FEP_GETSCHEDULEVALUE:
+		_xdr_argument = (xdrproc_t) xdr_int;
+		_xdr_result = (xdrproc_t) xdr_schedule_ret;
+		local = (char *(*)(char *, struct svc_req *)) fep_getschedulevalue_32_svc;
+		break;
+
+	case FEP_SENDSCHEDULE:
+		_xdr_argument = (xdrproc_t) xdr_fep_schedule;
+		_xdr_result = (xdrproc_t) xdr_schedule_ret;
+		local = (char *(*)(char *, struct svc_req *)) fep_sendschedule_32_svc;
+		break;
+
+	case FEP_SETLINEMGR_SCHEDULE:
+		_xdr_argument = (xdrproc_t) xdr_fep_setschedule;
+		_xdr_result = (xdrproc_t) xdr_errorstatus;
+		local = (char *(*)(char *, struct svc_req *)) fep_setlinemgr_schedule_32_svc;
+		break;
+
+	case FEP_FREE_SCHEDULE:
+		_xdr_argument = (xdrproc_t) xdr_int;
+		_xdr_result = (xdrproc_t) xdr_errorstatus;
+		local = (char *(*)(char *, struct svc_req *)) fep_free_schedule_32_svc;
+		break;
+
+	case FEP_IDLELINE:
+		_xdr_argument = (xdrproc_t) xdr_fep_lineop;
+		_xdr_result = (xdrproc_t) xdr_errorstatus;
+		local = (char *(*)(char *, struct svc_req *)) fep_idleline_32_svc;
+		break;
+
+	case FEP_MODEMSIGNALS:
+		_xdr_argument = (xdrproc_t) xdr_fep_lineop;
+		_xdr_result = (xdrproc_t) xdr_errorstatus;
+		local = (char *(*)(char *, struct svc_req *)) fep_modemsignals_32_svc;
+		break;
+
+	case FEP_GETREPLY:
+		_xdr_argument = (xdrproc_t) xdr_fep_reply_request;
+		_xdr_result = (xdrproc_t) xdr_reply_ret;
+		local = (char *(*)(char *, struct svc_req *)) fep_getreply_32_svc;
+		break;
+
+	case FEP_CLEARREPLY:
+		_xdr_argument = (xdrproc_t) xdr_void;
+		_xdr_result = (xdrproc_t) xdr_errorstatus;
+		local = (char *(*)(char *, struct svc_req *)) fep_clearreply_32_svc;
+		break;
+
+	case FEP_UPDATESCHEDULE:
+		_xdr_argument = (xdrproc_t) xdr_fep_schedule;
+		_xdr_result = (xdrproc_t) xdr_schedule_ret;
+		local = (char *(*)(char *, struct svc_req *)) fep_updateschedule_32_svc;
+		break;
+
+	case FEP_GETREPORTCOUNT:
+		_xdr_argument = (xdrproc_t) xdr_void;
+		_xdr_result = (xdrproc_t) xdr_int;
+		local = (char *(*)(char *, struct svc_req *)) fep_getreportcount_32_svc;
+		break;
+
+	case FEP_GETREPORT:
+		_xdr_argument = (xdrproc_t) xdr_int;
+		_xdr_result = (xdrproc_t) xdr_report_ret;
+		local = (char *(*)(char *, struct svc_req *)) fep_getreport_32_svc;
+		break;
+
+	case FEP_GETREPORTVALUE:
+		_xdr_argument = (xdrproc_t) xdr_int;
+		_xdr_result = (xdrproc_t) xdr_report_ret;
+		local = (char *(*)(char *, struct svc_req *)) fep_getreportvalue_32_svc;
+		break;
+
+	case FEP_SENDREPORT:
+		_xdr_argument = (xdrproc_t) xdr_fep_report;
+		_xdr_result = (xdrproc_t) xdr_report_ret;
+		local = (char *(*)(char *, struct svc_req *)) fep_sendreport_32_svc;
+		break;
+
+	case FEP_REPLY_XFER:
+		_xdr_argument = (xdrproc_t) xdr_fep_reply;
+		_xdr_result = (xdrproc_t) xdr_void;
+		local = (char *(*)(char *, struct svc_req *)) fep_reply_xfer_32_svc;
+		break;
+
+	case FEP_SET_DEBUG:
+		_xdr_argument = (xdrproc_t) xdr_int;
+		_xdr_result = (xdrproc_t) xdr_errorstatus;
+		local = (char *(*)(char *, struct svc_req *)) fep_set_debug_32_svc;
+		break;
+
+	case FEP_GET_STACK_LEFT:
+		_xdr_argument = (xdrproc_t) xdr_void;
+		_xdr_result = (xdrproc_t) xdr_int;
+		local = (char *(*)(char *, struct svc_req *)) fep_get_stack_left_32_svc;
+		break;
+
+	case FEP_SETLMDEBUG:
+		_xdr_argument = (xdrproc_t) xdr_fep_setschedule;
+		_xdr_result = (xdrproc_t) xdr_errorstatus;
+		local = (char *(*)(char *, struct svc_req *)) fep_setlmdebug_32_svc;
+		break;
+
+	case FEP_SHUTDOWN:
+		_xdr_argument = (xdrproc_t) xdr_void;
+		_xdr_result = (xdrproc_t) xdr_errorstatus;
+		local = (char *(*)(char *, struct svc_req *)) fep_shutdown_32_svc;
+		break;
+
+	case FEP_INITSYSTEM:
+		_xdr_argument = (xdrproc_t) xdr_int;
+		_xdr_result = (xdrproc_t) xdr_int;
+		local = (char *(*)(char *, struct svc_req *)) fep_initsystem_32_svc;
+		break;
+
+	case FEP_INITREALIX:
+		_xdr_argument = (xdrproc_t) xdr_init_form;
+		_xdr_result = (xdrproc_t) xdr_int;
+		local = (char *(*)(char *, struct svc_req *)) fep_initrealix_32_svc;
+		break;
+
+	default:
+		svcerr_noproc (transp);
+		return;
+	}
+	memset ((char *)&argument, 0, sizeof (argument));
+	if (!svc_getargs (transp, (xdrproc_t) _xdr_argument, (caddr_t) &argument)) {
+		svcerr_decode (transp);
+		return;
+	}
+	result = (*local)((char *)&argument, rqstp);
+	if (result != NULL && !svc_sendreply(transp, (xdrproc_t) _xdr_result, result)) {
+		svcerr_systemerr (transp);
+	}
+	if (!svc_freeargs (transp, (xdrproc_t) _xdr_argument, (caddr_t) &argument)) {
+		fprintf (stderr, "%s", "unable to free arguments");
+		exit (1);
+	}
+	return;
+}
+
+int main (int argc, char **argv)
+{
+	register SVCXPRT *transp;
+
+	pmap_unset (FEP_PROGRAM, FEP_VERSION);
+
+	transp = svcudp_create(RPC_ANYSOCK);
+	if (transp == NULL) {
+		fprintf (stderr, "%s", "cannot create udp service.");
+		exit(1);
+	}
+	if (!svc_register(transp, FEP_PROGRAM, FEP_VERSION, fep_program_32, IPPROTO_UDP)) {
+		fprintf (stderr, "%s", "unable to register (FEP_PROGRAM, FEP_VERSION, udp).");
+		exit(1);
+	}
+
+	transp = svctcp_create(RPC_ANYSOCK, 0, 0);
+	if (transp == NULL) {
+		fprintf (stderr, "%s", "cannot create tcp service.");
+		exit(1);
+	}
+	if (!svc_register(transp, FEP_PROGRAM, FEP_VERSION, fep_program_32, IPPROTO_TCP)) {
+		fprintf (stderr, "%s", "unable to register (FEP_PROGRAM, FEP_VERSION, tcp).");
+		exit(1);
+	}
+
+	svc_run ();
+	fprintf (stderr, "%s", "svc_run returned");
+	exit (1);
+	/* NOTREACHED */
+}
Index: branches/fep_client_cpp/fep_client.cpp
===================================================================
--- branches/fep_client_cpp/fep_client.cpp	(revision 69)
+++ branches/fep_client_cpp/fep_client.cpp	(revision 70)
@@ -1,6 +1,8 @@
 #include "fep.h"
-#include "fep_print.cpp"
 #include <stdio.h>
 #include <stdlib.h>
+#include "network.h"
+#include "network_factory.cpp"
+#include "time.h"
 
 /* Author: John A. Torres
@@ -23,74 +25,90 @@
 	{
 		printf("Successful RPC call to ATMS...\n");
-		printf("Printing ATMS RPC Call response...\n");
-		print_reply_ret(*(reply_ret *) (&response));
 	}
 }
 
-fep_reply generate_reply()
+
+void xfer_replys(CLIENT *clnt, FEP_LINE_LDS *lines, int lines_size, LDS_LOOP *ldsMap)
 {
-	/* Declarations to construct an fep_reply */
-	fep_answer_info fai;
-	fep_pollerror fpe;
-	fep_answer_short_msg fasm;
-	fep_shortanswer fsa;
-	fep_reply  fep_reply_xfer_32_arg; // the reply to be sent to ATMS
+	int i, j; // i == line_index, j == lds_index
 
-	/* Populate fep_shortmessage data */
-	printf("Setting fep_reply values...\n");
+	// Send one reply for every "line" in the FEP
+	for (i = 0; i < lines_size; i++)
+	{
+		fep_reply  fepReply;
+		
+		// populate reply
+		fepReply.reply = SHORTPOLL;
+		fepReply.schedule = fepLine[i].schedule;
+		fepReply.lineinfo = fepLine[i].lineInfo;
+		fepReply.kind = (enum polltype) 0;
+		fepReply.flag = (enum replykind) 0;
+		
+		/***********************************
+			 This is an update to an extern, this should happen on the Java driver side?? 
+		fepLine[i].schedleSeq += 1;
+		fepLine[i].globalSeq += 51;
+		*/
 
-	fasm.message_len = 5;
-	fasm.message[0] = 0x0a;
-	fasm.message[1] = 0x0d;
-	fasm.message[2] = 0x11;
-	fasm.message[3] = 0x12;
-	fasm.message[4] = 0x13;
+		fepReply.schedule_sequence = fepLine[i].schedleSeq;
+		fepReply.global_sequence = fepLine[i].globalSeq;
+		/************************************
+			 Need to find out what appropriate schedule time is: look at uci_unix_simulation_time src code		
+		fepReply.schedule_time = 
+			uci_unix_simulation_time(uci_simulation_time());	// GMT time
+		*/
+		fepReply.user_info1 = fepLine[i].lineNum;
+		fepReply.user_info2 = fepLine[i].lineNum;
+		fepReply.system_key = fepLine[i].systemKey;
 
-	fpe.msgerror = (enum answererror) 0;
-	fpe.state = (enum Polling_FSM_States) 0x00;
-	fpe.perrno = 0;
-	fpe.termination = 0;
-	fpe.count = 0;
+		fepReply.answers.size = 1;
+		fepReply.answers.fep_answer_list_u.shortp.count = 1;
+		
+		/* for each LDS in the Line.... (constructs the short_answer message) */
+		for (j = 0; j < fepLine[i].ldsNum; j++)
+		{
+			fep_shortanswer fsa;
+			int index = fepLine[i].ldsIndex[j];
 
-	fai.poll_time = 1111443466;
-	fai.status = (enum replystatus) 1;
-	fai.poll_user_info1 = 1;
-	fai.poll_user_info2 = 2;
-	fai.retries = 0;
-	fai.poll_error_count = 1;
-	fai.pollerror[0] = fpe;
+			// msg: oa, od, ldsMap[index].dataPack, od, ff
+			fsa.msg.message_len = ldsMap[index].length + 2;
+			fsa.msg.message[0] = 0x0d;
+			fsa.msg.message[1] = 0x0a;
+			for (int k = 0; k < ldsMap[index].length; k++)
+				fsa.msg.message[2 + k]	= ldsMap[index].dataPack[k];
+			int aa = ldsMap[index].length;
+			fsa.msg.message[2 + aa] = 0x0d;
+			fsa.msg.message[3 + aa] = 0xff;	//????????????? warning ?????
 
-	fsa.info = fai;
-	fsa.msg = fasm;
+			// info
+			fsa.info.poll_error_count = 0; 
+			/***************************************
+				 Need to find out polltime uci time function src code
+			fsa.info.poll_time = uci_unix_simulation_time(uci_simulation_time()); 
+			*/
+			fsa.info.poll_user_info1 = ldsMap[index].drop;	// drop number
+			fsa.info.poll_user_info2 = 1;	//always 1
+			fsa.info.retries = 0;
+			fsa.info.status = REPLY_DONE;
+			
+			//fepReply.answers.fep_answer_list_u.shortp.answers[j] = fsa;	
+			fepReply.answers.fep_answer_list_u.shortp.answers[0] = fsa;	
+			
+			// send out data
+			printf("line=%d, lds=%d\n", fepLine[i].lineNum, ldsMap[index].drop);
+			rv = fep_reply_xfer_32(&fepReply, clnt);
 
-	fep_reply_xfer_32_arg.reply = 0;
-	fep_reply_xfer_32_arg.schedule = 0;
-	fep_reply_xfer_32_arg.lineinfo = 0;
-	fep_reply_xfer_32_arg.kind = (enum polltype)0;
-	fep_reply_xfer_32_arg.flag = (enum replykind) 0;
-	fep_reply_xfer_32_arg.schedule_sequence = 0;
-	fep_reply_xfer_32_arg.global_sequence = 0;
-	fep_reply_xfer_32_arg.schedule_time = 1111443466;
-	fep_reply_xfer_32_arg.user_info1 = 0;
-	fep_reply_xfer_32_arg.user_info2 = 0;
-	fep_reply_xfer_32_arg.system_key = 0;
-	fep_reply_xfer_32_arg.answers.size = 1;
-	fep_reply_xfer_32_arg.answers.fep_answer_list_u.shortp.count = 1;
-	fep_reply_xfer_32_arg.answers.fep_answer_list_u.shortp.answers[0] = fsa;
-
-	return fep_reply_xfer_32_arg;
+			/* Handle ATMS response to RPC Call */
+			printf("Handling ATMS response...\n");
+			handle_ATMS_response(clnt, rv);
+		}
+	}		
 }
 
-/* Creates an RPC client, populates the fep_reply data structure,
-   makes an RPC Call to the ATMS Server to pass the fep_reply,
-   destroys the RPC Client and returns
- */
-void fep_program_32(char *host)
+/* Creates an RPC Client which communicates with the ATMS through RPC Calls */
+CLIENT * create_client()
 {
 	CLIENT *clnt;
-
-	/* Var to recieve message back from ATMS */
-	void  *rv;
-
+	
 	/* Create RPC Client to communicate with ATMS */
 	printf("Preparing to create RPC client...\n");
@@ -103,13 +121,23 @@
 		exit(1);
 	}
+	
+	return clnt;
+}
 
-	/* Make RPC Call to transfer reply to ATMS */
-	printf("Transferring data to ATMS Server...\n");
-	fep_reply reply = generate_reply();
-	rv = fep_reply_xfer_32(&reply, clnt);
+/* update_ATMS transfers fep_replys to the ATMS Server. 
+	It creates an RPC client, loads data from line_atms.txt and lds_atms.txt,
+	updates the ATMS with the fep_reply data, and destroys the RPC client.
+ */
+void update_ATMS(char *host)
+{
+	CLIENT *clnt = create_client();
+	
+	/* Load data to be xfered to ATMS */
+	FEP_LINE_LDS *lines;
+	int lines_size = load_lines(&lines, "./lines_atms.txt");
+	FEP_LDS *ldsMap = load_lds("./lds_atms.txt");
 
-	/* Handle ATMS response to RPC Call */
-	printf("Handling ATMS response...\n");
-	handle_ATMS_response(clnt, rv);
+	/* Transfer data to ATMS */
+	xfer_replys(clnt, lines, lines_size, ldsMap);
 
 	/* Destroy client */
@@ -132,5 +160,5 @@
 	/* Create RPC Client to send an fep_reply to ATMS */
 	host = argv[1];
-	fep_program_32(host);
+	update_ATMS(host);
 
 	return 0;
Index: branches/fep_client_cpp/build
===================================================================
--- branches/fep_client_cpp/build	(revision 69)
+++ branches/fep_client_cpp/build	(revision 70)
@@ -1,3 +1,3 @@
 #!/bin/bash
 
-g++ -g fep_client.cpp fep_clnt.c fep_xdr.c -o client && gcc fep_server.c fep_svc.c fep_xdr.c -o server
+g++ -g fep_client.cpp fep_clnt.c fep_xdr.c control.cpp -o client && gcc fep_server.c fep_svc.c fep_xdr.c -o server
Index: branches/fep_client_cpp/network.h
===================================================================
--- branches/fep_client_cpp/network.h	(revision 70)
+++ branches/fep_client_cpp/network.h	(revision 70)
@@ -0,0 +1,56 @@
+#ifndef NETWORK_H
+#define NETWORK_H
+
+typedef struct loopagg LOOPAGG;
+struct loopagg
+{
+	int		index;
+	char	lane;			// how namy lanes at the detector station
+	long	time;
+	int		interval;
+	int 	g_vol;
+	float	g_occ;
+	double	g_spd;
+	int		*vol;
+	float	*occ;
+	double	*spd;
+};
+
+// FEP line: has several lds
+typedef struct fep_line_lds FEP_LINE_LDS;
+struct  fep_line_lds
+{
+	int		lineNum;
+	vector<long> lds;
+	vector<long> ldsIndex;	// location in ldsMap
+	short	ldsNum;			// actual number of lds on the line
+
+	short	count;	// actual count from caltrans
+	int		schedule;
+	int		lineInfo;
+	long	systemKey;
+	long	globalSeq;
+	long	schedleSeq;
+};
+
+typedef struct Lds_loop LDS_LOOP;
+struct  Lds_loop 
+{
+	// Each lds has its own line_num and drop (Caltrans use)
+	long	lds;
+	short	line_num;
+	short	drop;
+
+	int		num;	// number of loops
+	long	*loopID;
+	char	**loop_loc;
+
+	// LDS data
+	unsigned char	*dataPack;
+	int		length;		// total length of data (max: 87)
+	int		pos;		// pointer for data preparation
+	int		MlTotVol;	// each 30 sec, the following will be updated
+	int		OppTotVol;	// each 30 sec, the following will be updated
+};
+
+#endif
Index: branches/fep_client_cpp/ATMSDriverRPC.cbp
===================================================================
--- branches/fep_client_cpp/ATMSDriverRPC.cbp	(revision 69)
+++ 	(revision )
@@ -1,47 +1,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
-<CodeBlocks_project_file>
-	<FileVersion major="1" minor="6" />
-	<Project>
-		<Option title="ATMSDriverRPC" />
-		<Option pch_mode="2" />
-		<Option compiler="gcc" />
-		<Build>
-			<Target title="Debug">
-				<Option output="bin/Debug/ATMSDriverRPC" prefix_auto="1" extension_auto="1" />
-				<Option object_output="obj/Debug/" />
-				<Option type="1" />
-				<Option compiler="gcc" />
-				<Compiler>
-					<Add option="-g" />
-				</Compiler>
-			</Target>
-			<Target title="Release">
-				<Option output="bin/Release/ATMSDriverRPC" prefix_auto="1" extension_auto="1" />
-				<Option object_output="obj/Release/" />
-				<Option type="1" />
-				<Option compiler="gcc" />
-				<Compiler>
-					<Add option="-O2" />
-				</Compiler>
-				<Linker>
-					<Add option="-s" />
-				</Linker>
-			</Target>
-		</Build>
-		<Compiler>
-			<Add option="-Wall" />
-		</Compiler>
-		<Unit filename="fep.h" />
-		<Unit filename="fep_client.cpp" />
-		<Unit filename="fep_clnt.c">
-			<Option compilerVar="CC" />
-		</Unit>
-		<Unit filename="fep_xdr.c">
-			<Option compilerVar="CC" />
-		</Unit>
-		<Extensions>
-			<code_completion />
-			<debugger />
-		</Extensions>
-	</Project>
-</CodeBlocks_project_file>
Index: branches/fep_client_cpp/hexdump.c
===================================================================
--- branches/fep_client_cpp/hexdump.c	(revision 69)
+++ 	(revision )
@@ -1,53 +1,0 @@
-#include <stdio.h>
-
-void hexDump (char *desc, void *addr, int len) {
-    int i;
-    unsigned char buff[17];
-    unsigned char *pc = (unsigned char*)addr;
-
-    // Output description if given.
-    if (desc != NULL)
-        printf ("%s:\n", desc);
-
-    if (len == 0) {
-        printf("  ZERO LENGTH\n");
-        return;
-    }
-    if (len < 0) {
-        printf("  NEGATIVE LENGTH: %i\n",len);
-        return;
-    }
-
-    // Process every byte in the data.
-    for (i = 0; i < len; i++) {
-        // Multiple of 16 means new line (with line offset).
-
-        if ((i % 16) == 0) {
-            // Just don't print ASCII for the zeroth line.
-            if (i != 0)
-                printf ("  %s\n", buff);
-
-            // Output the offset.
-            printf ("  %04x ", i);
-        }
-
-        // Now the hex code for the specific character.
-        printf (" %02x", pc[i]);
-
-        // And store a printable ASCII character for later.
-        if ((pc[i] < 0x20) || (pc[i] > 0x7e))
-            buff[i % 16] = '.';
-        else
-            buff[i % 16] = pc[i];
-        buff[(i % 16) + 1] = '\0';
-    }
-
-    // Pad out last line if not exactly 16 characters.
-    while ((i % 16) != 0) {
-        printf ("   ");
-        i++;
-    }
-
-    // And print the final ASCII bit.
-    printf ("  %s\n", buff);
-}
Index: branches/fep_client_cpp/ATMSDriverRPC.layout
===================================================================
--- branches/fep_client_cpp/ATMSDriverRPC.layout	(revision 69)
+++ 	(revision )
@@ -1,24 +1,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
-<CodeBlocks_layout_file>
-	<ActiveTarget name="Debug" />
-	<File name="fep_xdr.c" open="1" top="0" tabpos="3" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
-		<Cursor>
-			<Cursor1 position="0" topLine="0" />
-		</Cursor>
-	</File>
-	<File name="fep_client.cpp" open="1" top="1" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
-		<Cursor>
-			<Cursor1 position="2810" topLine="0" />
-		</Cursor>
-	</File>
-	<File name="fep.h" open="1" top="0" tabpos="4" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
-		<Cursor>
-			<Cursor1 position="101" topLine="0" />
-		</Cursor>
-	</File>
-	<File name="fep_clnt.c" open="1" top="0" tabpos="2" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
-		<Cursor>
-			<Cursor1 position="0" topLine="0" />
-		</Cursor>
-	</File>
-</CodeBlocks_layout_file>
Index: branches/fep_client_cpp/fep_svc.c
===================================================================
--- branches/fep_client_cpp/fep_svc.c	(revision 69)
+++ 	(revision )
@@ -1,280 +1,0 @@
-/*
- * Please do not edit this file.
- * It was generated using rpcgen.
- */
-
-#include "fep.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include <rpc/pmap_clnt.h>
-#include <string.h>
-#include <memory.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-
-#ifndef SIG_PF
-#define SIG_PF void(*)(int)
-#endif
-/* RPC SVC test */
-
-static void
-fep_program_32(struct svc_req *rqstp, register SVCXPRT *transp)
-{
-	union {
-		int fep_getlineinfo_32_arg;
-		int fep_getlineinfovalue_32_arg;
-		fep_lineinfo fep_sendlineinfo_32_arg;
-		fep_std_time fep_settime_32_arg;
-		int fep_advancetime_32_arg;
-		int fep_getschedule_32_arg;
-		int fep_getschedulevalue_32_arg;
-		fep_schedule fep_sendschedule_32_arg;
-		fep_setschedule fep_setlinemgr_schedule_32_arg;
-		int fep_free_schedule_32_arg;
-		fep_lineop fep_idleline_32_arg;
-		fep_lineop fep_modemsignals_32_arg;
-		fep_reply_request fep_getreply_32_arg;
-		fep_schedule fep_updateschedule_32_arg;
-		int fep_getreport_32_arg;
-		int fep_getreportvalue_32_arg;
-		fep_report fep_sendreport_32_arg;
-		fep_reply fep_reply_xfer_32_arg;
-		int fep_set_debug_32_arg;
-		fep_setschedule fep_setlmdebug_32_arg;
-		int fep_initsystem_32_arg;
-		init_form fep_initrealix_32_arg;
-	} argument;
-	char *result;
-	xdrproc_t _xdr_argument, _xdr_result;
-	char *(*local)(char *, struct svc_req *);
-
-	switch (rqstp->rq_proc) {
-	case NULLPROC:
-		(void) svc_sendreply (transp, (xdrproc_t) xdr_void, (char *)NULL);
-		return;
-
-	case FEP_GETLINEINFOCOUNT:
-		_xdr_argument = (xdrproc_t) xdr_void;
-		_xdr_result = (xdrproc_t) xdr_int;
-		local = (char *(*)(char *, struct svc_req *)) fep_getlineinfocount_32_svc;
-		break;
-
-	case FEP_GETLINEINFO:
-		_xdr_argument = (xdrproc_t) xdr_int;
-		_xdr_result = (xdrproc_t) xdr_lineinfo_ret;
-		local = (char *(*)(char *, struct svc_req *)) fep_getlineinfo_32_svc;
-		break;
-
-	case FEP_GETLINEINFOVALUE:
-		_xdr_argument = (xdrproc_t) xdr_int;
-		_xdr_result = (xdrproc_t) xdr_lineinfo_ret;
-		local = (char *(*)(char *, struct svc_req *)) fep_getlineinfovalue_32_svc;
-		break;
-
-	case FEP_SENDLINEINFO:
-		_xdr_argument = (xdrproc_t) xdr_fep_lineinfo;
-		_xdr_result = (xdrproc_t) xdr_lineinfo_ret;
-		local = (char *(*)(char *, struct svc_req *)) fep_sendlineinfo_32_svc;
-		break;
-
-	case FEP_GETTIME:
-		_xdr_argument = (xdrproc_t) xdr_void;
-		_xdr_result = (xdrproc_t) xdr_std_time_ret;
-		local = (char *(*)(char *, struct svc_req *)) fep_gettime_32_svc;
-		break;
-
-	case FEP_SETTIME:
-		_xdr_argument = (xdrproc_t) xdr_fep_std_time;
-		_xdr_result = (xdrproc_t) xdr_std_time_ret;
-		local = (char *(*)(char *, struct svc_req *)) fep_settime_32_svc;
-		break;
-
-	case FEP_ADVANCETIME:
-		_xdr_argument = (xdrproc_t) xdr_int;
-		_xdr_result = (xdrproc_t) xdr_std_time_ret;
-		local = (char *(*)(char *, struct svc_req *)) fep_advancetime_32_svc;
-		break;
-
-	case FEP_GETSCHEDULECOUNT:
-		_xdr_argument = (xdrproc_t) xdr_void;
-		_xdr_result = (xdrproc_t) xdr_int;
-		local = (char *(*)(char *, struct svc_req *)) fep_getschedulecount_32_svc;
-		break;
-
-	case FEP_GETSCHEDULE:
-		_xdr_argument = (xdrproc_t) xdr_int;
-		_xdr_result = (xdrproc_t) xdr_schedule_ret;
-		local = (char *(*)(char *, struct svc_req *)) fep_getschedule_32_svc;
-		break;
-
-	case FEP_GETSCHEDULEVALUE:
-		_xdr_argument = (xdrproc_t) xdr_int;
-		_xdr_result = (xdrproc_t) xdr_schedule_ret;
-		local = (char *(*)(char *, struct svc_req *)) fep_getschedulevalue_32_svc;
-		break;
-
-	case FEP_SENDSCHEDULE:
-		_xdr_argument = (xdrproc_t) xdr_fep_schedule;
-		_xdr_result = (xdrproc_t) xdr_schedule_ret;
-		local = (char *(*)(char *, struct svc_req *)) fep_sendschedule_32_svc;
-		break;
-
-	case FEP_SETLINEMGR_SCHEDULE:
-		_xdr_argument = (xdrproc_t) xdr_fep_setschedule;
-		_xdr_result = (xdrproc_t) xdr_errorstatus;
-		local = (char *(*)(char *, struct svc_req *)) fep_setlinemgr_schedule_32_svc;
-		break;
-
-	case FEP_FREE_SCHEDULE:
-		_xdr_argument = (xdrproc_t) xdr_int;
-		_xdr_result = (xdrproc_t) xdr_errorstatus;
-		local = (char *(*)(char *, struct svc_req *)) fep_free_schedule_32_svc;
-		break;
-
-	case FEP_IDLELINE:
-		_xdr_argument = (xdrproc_t) xdr_fep_lineop;
-		_xdr_result = (xdrproc_t) xdr_errorstatus;
-		local = (char *(*)(char *, struct svc_req *)) fep_idleline_32_svc;
-		break;
-
-	case FEP_MODEMSIGNALS:
-		_xdr_argument = (xdrproc_t) xdr_fep_lineop;
-		_xdr_result = (xdrproc_t) xdr_errorstatus;
-		local = (char *(*)(char *, struct svc_req *)) fep_modemsignals_32_svc;
-		break;
-
-	case FEP_GETREPLY:
-		_xdr_argument = (xdrproc_t) xdr_fep_reply_request;
-		_xdr_result = (xdrproc_t) xdr_reply_ret;
-		local = (char *(*)(char *, struct svc_req *)) fep_getreply_32_svc;
-		break;
-
-	case FEP_CLEARREPLY:
-		_xdr_argument = (xdrproc_t) xdr_void;
-		_xdr_result = (xdrproc_t) xdr_errorstatus;
-		local = (char *(*)(char *, struct svc_req *)) fep_clearreply_32_svc;
-		break;
-
-	case FEP_UPDATESCHEDULE:
-		_xdr_argument = (xdrproc_t) xdr_fep_schedule;
-		_xdr_result = (xdrproc_t) xdr_schedule_ret;
-		local = (char *(*)(char *, struct svc_req *)) fep_updateschedule_32_svc;
-		break;
-
-	case FEP_GETREPORTCOUNT:
-		_xdr_argument = (xdrproc_t) xdr_void;
-		_xdr_result = (xdrproc_t) xdr_int;
-		local = (char *(*)(char *, struct svc_req *)) fep_getreportcount_32_svc;
-		break;
-
-	case FEP_GETREPORT:
-		_xdr_argument = (xdrproc_t) xdr_int;
-		_xdr_result = (xdrproc_t) xdr_report_ret;
-		local = (char *(*)(char *, struct svc_req *)) fep_getreport_32_svc;
-		break;
-
-	case FEP_GETREPORTVALUE:
-		_xdr_argument = (xdrproc_t) xdr_int;
-		_xdr_result = (xdrproc_t) xdr_report_ret;
-		local = (char *(*)(char *, struct svc_req *)) fep_getreportvalue_32_svc;
-		break;
-
-	case FEP_SENDREPORT:
-		_xdr_argument = (xdrproc_t) xdr_fep_report;
-		_xdr_result = (xdrproc_t) xdr_report_ret;
-		local = (char *(*)(char *, struct svc_req *)) fep_sendreport_32_svc;
-		break;
-
-	case FEP_REPLY_XFER:
-		_xdr_argument = (xdrproc_t) xdr_fep_reply;
-		_xdr_result = (xdrproc_t) xdr_void;
-		local = (char *(*)(char *, struct svc_req *)) fep_reply_xfer_32_svc;
-		break;
-
-	case FEP_SET_DEBUG:
-		_xdr_argument = (xdrproc_t) xdr_int;
-		_xdr_result = (xdrproc_t) xdr_errorstatus;
-		local = (char *(*)(char *, struct svc_req *)) fep_set_debug_32_svc;
-		break;
-
-	case FEP_GET_STACK_LEFT:
-		_xdr_argument = (xdrproc_t) xdr_void;
-		_xdr_result = (xdrproc_t) xdr_int;
-		local = (char *(*)(char *, struct svc_req *)) fep_get_stack_left_32_svc;
-		break;
-
-	case FEP_SETLMDEBUG:
-		_xdr_argument = (xdrproc_t) xdr_fep_setschedule;
-		_xdr_result = (xdrproc_t) xdr_errorstatus;
-		local = (char *(*)(char *, struct svc_req *)) fep_setlmdebug_32_svc;
-		break;
-
-	case FEP_SHUTDOWN:
-		_xdr_argument = (xdrproc_t) xdr_void;
-		_xdr_result = (xdrproc_t) xdr_errorstatus;
-		local = (char *(*)(char *, struct svc_req *)) fep_shutdown_32_svc;
-		break;
-
-	case FEP_INITSYSTEM:
-		_xdr_argument = (xdrproc_t) xdr_int;
-		_xdr_result = (xdrproc_t) xdr_int;
-		local = (char *(*)(char *, struct svc_req *)) fep_initsystem_32_svc;
-		break;
-
-	case FEP_INITREALIX:
-		_xdr_argument = (xdrproc_t) xdr_init_form;
-		_xdr_result = (xdrproc_t) xdr_int;
-		local = (char *(*)(char *, struct svc_req *)) fep_initrealix_32_svc;
-		break;
-
-	default:
-		svcerr_noproc (transp);
-		return;
-	}
-	memset ((char *)&argument, 0, sizeof (argument));
-	if (!svc_getargs (transp, (xdrproc_t) _xdr_argument, (caddr_t) &argument)) {
-		svcerr_decode (transp);
-		return;
-	}
-	result = (*local)((char *)&argument, rqstp);
-	if (result != NULL && !svc_sendreply(transp, (xdrproc_t) _xdr_result, result)) {
-		svcerr_systemerr (transp);
-	}
-	if (!svc_freeargs (transp, (xdrproc_t) _xdr_argument, (caddr_t) &argument)) {
-		fprintf (stderr, "%s", "unable to free arguments");
-		exit (1);
-	}
-	return;
-}
-
-int main (int argc, char **argv)
-{
-	register SVCXPRT *transp;
-
-	pmap_unset (FEP_PROGRAM, FEP_VERSION);
-
-	transp = svcudp_create(RPC_ANYSOCK);
-	if (transp == NULL) {
-		fprintf (stderr, "%s", "cannot create udp service.");
-		exit(1);
-	}
-	if (!svc_register(transp, FEP_PROGRAM, FEP_VERSION, fep_program_32, IPPROTO_UDP)) {
-		fprintf (stderr, "%s", "unable to register (FEP_PROGRAM, FEP_VERSION, udp).");
-		exit(1);
-	}
-
-	transp = svctcp_create(RPC_ANYSOCK, 0, 0);
-	if (transp == NULL) {
-		fprintf (stderr, "%s", "cannot create tcp service.");
-		exit(1);
-	}
-	if (!svc_register(transp, FEP_PROGRAM, FEP_VERSION, fep_program_32, IPPROTO_TCP)) {
-		fprintf (stderr, "%s", "unable to register (FEP_PROGRAM, FEP_VERSION, tcp).");
-		exit(1);
-	}
-
-	svc_run ();
-	fprintf (stderr, "%s", "svc_run returned");
-	exit (1);
-	/* NOTREACHED */
-}
Index: branches/fep_client_cpp/fep_print.cpp
===================================================================
--- branches/fep_client_cpp/fep_print.cpp	(revision 69)
+++ 	(revision )
@@ -1,221 +1,0 @@
-#include "fep.h"
-#include "hexdump.c"
-
-/* The following get_*_text functions are helper functions used to
-   get enum type names as strings */
-const char* get_polltype_text(enum polltype ptype)
-{
-	switch(ptype)
-	{
-		case POLL:
-			return "POLL";
-		case COMMAND:
-			return "COMMAND";
-		case TIMESYNC:
-			return "TIMESYNC";
-		default:
-			return "UNKNOWN";
-	}	
-}
-
-const char* get_status_text(enum errorstatus estat)
-{
-	switch(estat)
-	{ case FEP_OK: 
-			return "FEP_OK";
-		case FEP_OUTOFRANGE: 
-			return "FEP_OUTOFRANGE";
-		case FEP_BADHANDLE: 
-			return "FEP_BADHANDLE";
-		case FEP_NOREPLY: 
-			return "FEP_NOREPLY";
-		case FEP_SCHBUSY: 
-			return "FEP_SCHBUSY";
-		case FEP_LINEBUSY: 
-			return "FEP_LINEBUSY";
-		case FEP_REPORTBUSY: 
-			return "FEP_REPORTBUSY";
-		case FEP_NOREPORT: 
-			return "FEP_NOREPORT";
-		case FEP_NOMEMORY: 
-			return "FEP_NOMEMORY";
-		case FEP_BADTIME: 
-			return "FEP_BADTIME";
-		case FEP_BADTIMESYNCH: 
-			return "FEP_BADTIMESYNCH";
-		case FEP_BADKIND: 
-			return "FEP_BADKIND";
-		case FEP_BADCONNECT: 
-			return "FEP_BADCONNECT";
-		case FEP_NOAUTHORITY: 
-			return "FEP_NOAUTHORITY";
-		default: 
-			return "UNKNOWN";
-	}
-} 
-
-const char* get_answererror_text(enum answererror err)
-{
-	switch(err)
-	{
-		case ERR_BSCF_ERR:
-			return "ERR_BSCF_ERR";
-		case ERR_NONE:
-			return "ERR_NONE";
-		case ERR_MSG_LEN:
-			return "ERR_MSG_LEN";
-		case ERR_MSG_HDR:
-			return "ERR_MSG_HDR";
-		case ERR_MSG_CHKSUM:
-			return "ERR_MSG_CHKSUM";
-		case ERR_MSG_TRAILER:
-			return "ERR_MSG_TRAILER";
-		default:
-			return "UNKNOWN";
-	}
-}
-
-const char * get_pollingfsm_text(enum Polling_FSM_States state)
-{
-	switch(state)
-	{
-		case INITSTATE:
-			return "INITSTATE";
-		case WRALARMSTATE:
-			return "WRALARMSTATE";
-		case CLRSTATE:
-			return "CLRSTATE";
-		case RTSONSTATE:
-			return "RTSONSTATE";
-		case CTSSTATE:
-			return "CTSSTATE";
-		case WRITESTATE:
-			return "WRITESTATE";
-		case RTSOFFSTATE:
-			return "RTSOFFSTATE";
-		case RDALARMSTATE:
-			return "RDALARMSTATE";
-		case RDSTATE:
-			return "RDSTATE";
-		case DONESTATE:
-			return "DONESTATE";
-		default:
-			return "UNKNOWN";
-	}
-}
-
-const char *get_replystatus_text(enum replystatus status)
-{
-	switch(status)
-	{
-		case FAILURE:
-			return "FAILURE";
-		case DONE:
-			return "DONE";
-		case UNUSED:
-			return "UNUSED";
-		default:
-			return "UNKNOWN";
-	}
-}
-
-const char *get_replykind_text(enum replykind kind)
-{
-	switch(kind)
-	{
-		case POLLREPLY:
-			return "POLLREPLY";
-		case SCHEDNEW:
-			return "SCHEDNEW";
-		case SCHEDDONE:
-			return "SCHEDDONE";
-		default:
-			return "UNKNOWN";
-	}
-}
-
-/* The following functions are used to print fep_reply, reply_ret structs and associated structs */
-void print_fep_pollerror(fep_pollerror pollerror)
-{
-	printf("\t\t\t\t\t\tpoll error:\n");
-	printf("\t\t\t\t\t\tanswererror msgerror:\t%s\n", get_answererror_text(pollerror.msgerror));
-	printf("\t\t\t\t\t\tPolling_FSM_States state:\t%s\n", get_pollingfsm_text(pollerror.state));
-	printf("\t\t\t\t\t\t\tint perrno:\t%d\n", pollerror.perrno);
-	printf("\t\t\t\t\t\t\tint termination:\t%d\n", pollerror.termination);
-	printf("\t\t\t\t\t\t\tint count:\t%d\n", pollerror.count);
-}
-
-void print_fep_answer_info(fep_answer_info info)
-{
-	printf("\t\t\t\t\tfep_answer_info:\n");
-	printf("\t\t\t\t\t\tlong poll_time:\t%ld\n", info.poll_time);
-	printf("\t\t\t\t\t\treplystatus status:\t%s\n", get_replystatus_text(info.status));
-	printf("\t\t\t\t\t\tint poll_user_info1:\t%d\n", info.poll_user_info1);
-	printf("\t\t\t\t\t\tint poll_user_info2:\t%d\n", info.poll_user_info2);
-	printf("\t\t\t\t\t\tint retries:\t%d\n", info.retries);
-	printf("\t\t\t\t\t\tint poll_error_count:\t%d\n", info.poll_error_count);
-	for(int i = 0; i < info.poll_error_count; i++)
-	{
-		print_fep_pollerror(*info.pollerror);
-	}
-}
-
-void print_fep_answer_short_msg(fep_answer_short_msg msg)
-{
-	printf("\t\t\t\t\tfep_answer_short:\n");
-	printf("\t\t\t\t\t\tint message_len:\t%d\n", msg.message_len);
-	printf("\t\t\t\t\t\tmessage:\t");
-	for(int i = 0; i < msg.message_len; i++)
-	{
-		printf("%04x ", msg.message[i]);
-	}
-	printf("\n");
-}
-
-void print_fep_shortanswer(fep_shortanswer answer)
-{
-	printf("\t\t\t\tfep_shortanswer:\n");
-	print_fep_answer_info(answer.info);
-	print_fep_answer_short_msg(answer.msg);
-}
-
-void print_fep_shortanswer_list(fep_shortanswer_list answer_list)
-{
-	printf("\t\t\tfep_shortanswer_list:\n");
-	printf("\t\t\t\tcount:\t%d\n", answer_list.count);
-	for(int i = 0; i < answer_list.count; i++)
-	{	
-		print_fep_shortanswer(answer_list.answers[i]);	
-	}
-}
-
-void print_fep_answer_list(fep_answer_list answers)
-{
-	printf("\t\tfep_answer_list:\n");
-	printf("\t\t\tint size:\t%d\n", answers.size);
-	print_fep_shortanswer_list(answers.fep_answer_list_u.shortp);
-}
-
-void print_fep_reply(fep_reply reply)
-{
-	printf("\tfep_reply: \n");
-	printf("\t\tint reply:\t%d\n", reply.reply);
-	printf("\t\tint schedule:\t%d\n", reply.schedule); 
-	printf("\t\tint lineinfo:\t%d\n", reply.lineinfo);
-	printf("\t\tpolltype kind:\t%s\n", get_polltype_text(reply.kind));
-	printf("\t\treplykind flag:\t%s\n", get_replykind_text(reply.flag));
-	printf("\t\tint schedule_sequence:\t%d\n", reply.schedule_sequence);
-	printf("\t\tint global_sequence:\t%d\n", reply.global_sequence);
-	printf("\t\tlong schedule_time:\t%ld\n", reply.schedule_time);
-	printf("\t\tint user_info1:\t%d\n", reply.user_info1);
-	printf("\t\tint user_info2:\t%d\n", reply.user_info2);
-	print_fep_answer_list(reply.answers);
-}
-
-/* Dumps the ATMS's response to RPC Call (struct reply_ret) */
-void print_reply_ret(reply_ret response) {
-	printf("reply_ret:\n");
-	// Print response status
-	printf("\tfep_status: %s\n", get_status_text(response.status));
-	print_fep_reply(response.reply_ret_u.info);
-}
Index: branches/fep_client_cpp/fep_server.c
===================================================================
--- branches/fep_client_cpp/fep_server.c	(revision 69)
+++ 	(revision )
@@ -1,350 +1,0 @@
-/*
- * This is sample code generated by rpcgen.
- * These are only templates and you can use them
- * as a guideline for developing your own functions.
- */
-
-#include "fep.h"
-#include "fep_print.cpp"		
-
-int *
-fep_getlineinfocount_32_svc(void *argp, struct svc_req *rqstp)
-{
-	static int  result;
-
-	/*
-	 * insert server code here
-	 */
-
-	return &result;
-}
-
-lineinfo_ret *
-fep_getlineinfo_32_svc(int *argp, struct svc_req *rqstp)
-{
-	static lineinfo_ret  result;
-
-	/*
-	 * insert server code here
-	 */
-
-	return &result;
-}
-
-lineinfo_ret *
-fep_getlineinfovalue_32_svc(int *argp, struct svc_req *rqstp)
-{
-	static lineinfo_ret  result;
-
-	/*
-	 * insert server code here
-	 */
-	return &result;
-}
-
-lineinfo_ret *
-fep_sendlineinfo_32_svc(fep_lineinfo *argp, struct svc_req *rqstp)
-{
-	static lineinfo_ret  result;
-
-	/*
-	 * insert server code here
-	 */
-
-	return &result;
-}
-
-std_time_ret *
-fep_gettime_32_svc(void *argp, struct svc_req *rqstp)
-{
-	static std_time_ret  result;
-
-	/*
-	 * insert server code here
-	 */
-
-	return &result;
-}
-
-std_time_ret *
-fep_settime_32_svc(fep_std_time *argp, struct svc_req *rqstp)
-{
-	static std_time_ret  result;
-
-	/*
-	 * insert server code here
-	 */
-
-	return &result;
-}
-
-std_time_ret *
-fep_advancetime_32_svc(int *argp, struct svc_req *rqstp)
-{
-	static std_time_ret  result;
-
-	/*
-	 * insert server code here
-	 */
-
-	return &result;
-}
-
-int *
-fep_getschedulecount_32_svc(void *argp, struct svc_req *rqstp)
-{
-	static int  result;
-
-	/*
-	 * insert server code here
-	 */
-
-	return &result;
-}
-
-schedule_ret *
-fep_getschedule_32_svc(int *argp, struct svc_req *rqstp)
-{
-	static schedule_ret  result;
-
-	/*
-	 * insert server code here
-	 */
-
-	return &result;
-}
-
-schedule_ret *
-fep_getschedulevalue_32_svc(int *argp, struct svc_req *rqstp)
-{
-	static schedule_ret  result;
-
-	/*
-	 * insert server code here
-	 */
-
-	return &result;
-}
-
-schedule_ret *
-fep_sendschedule_32_svc(fep_schedule *argp, struct svc_req *rqstp)
-{
-	static schedule_ret  result;
-
-	/*
-	 * insert server code here
-	 */
-
-	return &result;
-}
-
-errorstatus *
-fep_setlinemgr_schedule_32_svc(fep_setschedule *argp, struct svc_req *rqstp)
-{
-	static errorstatus  result;
-
-	/*
-	 * insert server code here
-	 */
-
-	return &result;
-}
-
-errorstatus *
-fep_free_schedule_32_svc(int *argp, struct svc_req *rqstp)
-{
-	static errorstatus  result;
-
-	/*
-	 * insert server code here
-	 */
-
-	return &result;
-}
-
-errorstatus *
-fep_idleline_32_svc(fep_lineop *argp, struct svc_req *rqstp)
-{
-	static errorstatus  result;
-
-	/*
-	 * insert server code here
-	 */
-
-	return &result;
-}
-
-errorstatus *
-fep_modemsignals_32_svc(fep_lineop *argp, struct svc_req *rqstp)
-{
-	static errorstatus  result;
-
-	/*
-	 * insert server code here
-	 */
-
-	return &result;
-}
-
-reply_ret *
-fep_getreply_32_svc(fep_reply_request *argp, struct svc_req *rqstp)
-{
-	static reply_ret  result;
-	/*
-	 * insert server code here
-	 */
-		
-	return &result;
-}
-
-errorstatus *
-fep_clearreply_32_svc(void *argp, struct svc_req *rqstp)
-{
-	static errorstatus  result;
-
-	/*
-	 * insert server code here
-	 */
-
-	return &result;
-}
-
-schedule_ret *
-fep_updateschedule_32_svc(fep_schedule *argp, struct svc_req *rqstp)
-{
-	static schedule_ret  result;
-
-	/*
-	 * insert server code here
-	 */
-
-	return &result;
-}
-
-int *
-fep_getreportcount_32_svc(void *argp, struct svc_req *rqstp)
-{
-	static int  result;
-
-	/*
-	 * insert server code here
-	 */
-
-	return &result;
-}
-
-report_ret *
-fep_getreport_32_svc(int *argp, struct svc_req *rqstp)
-{
-	static report_ret  result;
-
-	/*
-	 * insert server code here
-	 */
-
-	return &result;
-}
-
-report_ret *
-fep_getreportvalue_32_svc(int *argp, struct svc_req *rqstp)
-{
-	static report_ret  result;
-
-	/*
-	 * insert server code here
-	 */
-
-	return &result;
-}
-
-report_ret *
-fep_sendreport_32_svc(fep_report *argp, struct svc_req *rqstp)
-{
-	static report_ret  result;
-
-	/*
-	 * insert server code here
-	 */
-
-	return &result;
-}
-
-void *
-fep_reply_xfer_32_svc(fep_reply *argp, struct svc_req *rqstp)
-{
-	static reply_ret result;
-	print_fep_reply(*argp);
-	return (void *) &result;
-}
-
-errorstatus *
-fep_set_debug_32_svc(int *argp, struct svc_req *rqstp)
-{
-	static errorstatus  result;
-
-	/*
-	 * insert server code here
-	 */
-
-	return &result;
-}
-
-int *
-fep_get_stack_left_32_svc(void *argp, struct svc_req *rqstp)
-{
-	static int  result;
-
-	/*
-	 * insert server code here
-	 */
-
-	return &result;
-}
-
-errorstatus *
-fep_setlmdebug_32_svc(fep_setschedule *argp, struct svc_req *rqstp)
-{
-	static errorstatus  result;
-
-	/*
-	 * insert server code here
-	 */
-
-	return &result;
-}
-
-errorstatus *
-fep_shutdown_32_svc(void *argp, struct svc_req *rqstp)
-{
-	static errorstatus  result;
-
-	/*
-	 * insert server code here
-	 */
-
-	return &result;
-}
-
-int *
-fep_initsystem_32_svc(int *argp, struct svc_req *rqstp)
-{
-	static int  result;
-
-	/*
-	 * insert server code here
-	 */
-
-	return &result;
-}
-
-int *
-fep_initrealix_32_svc(init_form *argp, struct svc_req *rqstp)
-{
-	static int  result;
-
-	/*
-	 * insert server code here
-	 */
-
-	return &result;
-}
Index: branches/fep_client_cpp/ATMSDriverRPC.depend
===================================================================
--- branches/fep_client_cpp/ATMSDriverRPC.depend	(revision 69)
+++ 	(revision )
@@ -1,11 +1,0 @@
-# depslib dependency file v1.0
-1504297240 source:/home/andrew/ATMSDriverRPC/fep_clnt.c
-	<memory.h>
-	"fep.h"
-
-1504297240 /home/andrew/ATMSDriverRPC/fep.h
-	<rpc/rpc.h>
-
-1504297240 source:/home/andrew/ATMSDriverRPC/fep_xdr.c
-	"fep.h"
-
