Commit in epics/trunk/epics_example on MAIN
include/client_util.h+1748 -> 749
iocBoot/iocmyexample/st.cmd+1-1748 -> 749
myexampleApp/src/client_util.c+3-9748 -> 749
                /dbSubExample.c+11-9748 -> 749
+16-19
4 modified files
Cleaned up. Work in progrss.

epics/trunk/epics_example/include
client_util.h 748 -> 749
--- epics/trunk/epics_example/include/client_util.h	2014-06-27 02:18:29 UTC (rev 748)
+++ epics/trunk/epics_example/include/client_util.h	2014-06-27 22:50:17 UTC (rev 749)
@@ -11,6 +11,7 @@
 #include <netdb.h> 
 #include <libxml/parser.h>
 
+
 double extractTempValFromString(char value[]);
 void getSubStrFromName(char name[],const int i, char board_type[], const int MAX);
 void getType(char name[], char board_type[], const int MAX);

epics/trunk/epics_example/iocBoot/iocmyexample
st.cmd 748 -> 749
--- epics/trunk/epics_example/iocBoot/iocmyexample/st.cmd	2014-06-27 02:18:29 UTC (rev 748)
+++ epics/trunk/epics_example/iocBoot/iocmyexample/st.cmd	2014-06-27 22:50:17 UTC (rev 749)
@@ -18,7 +18,7 @@
 dbLoadRecords "db/dbHybLV.db"
 
 ## Set this to see messages from mySub
-var mySubDebug 1
+var mySubDebug 0
 
 ## Run this to trace the stages of iocInit
 traceIocInit

epics/trunk/epics_example/myexampleApp/src
client_util.c 748 -> 749
--- epics/trunk/epics_example/myexampleApp/src/client_util.c	2014-06-27 02:18:29 UTC (rev 748)
+++ epics/trunk/epics_example/myexampleApp/src/client_util.c	2014-06-27 22:50:17 UTC (rev 749)
@@ -4,7 +4,6 @@
 const unsigned int MAX_BUFFERS = 1000;
 int client_util_debug = 0;
 
-
 double extractTempValFromString(char value[]) {
   double t = 0.0;
   char* p_start = strstr(value,"C (");
@@ -108,7 +107,7 @@
   //int debug = 0;
   char xml_string[300*256];
   read_system_xml_string2(sockfd,xml_string,300*256);
-  if(client_util_debug!=0) printf("Got %d long xml string\n",strlen(xml_string));
+  if(client_util_debug!=0) printf("Got %d long xml string:\n\n%s\n",strlen(xml_string),xml_string);
   if(client_util_debug!=0) printf("create xml document\n");
   *document = xmlReadMemory(xml_string,strlen(xml_string),"noname.xml",NULL,0);
   if(client_util_debug!=0) printf("xml doc done %p\n",*document);
@@ -137,16 +136,11 @@
   int n;
   //char buffer[] = "<system><command>ReadConfig</command></system>\f";
   char buffer[] = "<system><command><ReadConfig/></command></system>\f";
-  //if(client_util_debug) 
-    printf("Executing:\"%s\"\n",buffer);
+  if(client_util_debug) printf("Executing:\"%s\"\n",buffer);
   n = write(sockfd,buffer,strlen(buffer));
   if(n<0) 
     socket_error("ERROR writing to socket");
-  //if(sleep(1)!=0) {
-  //  printf("ERROR sleeping\n");
-  //}
   return;
-
 }
 
 
@@ -175,7 +169,7 @@
 
 void readCalDelay(int* sockfd,char value[],const unsigned int MAX) {
   //int debug=0;
-  char tag[] = "system:status:cntrlFpga:CalDelay";
+  char tag[] = "system:config:cntrlFpga:CalDelay";
   xmlDoc* document = NULL;
   xmlNode* root = NULL;
   if(client_util_debug!=0) printf("readCalDelay: get DOM\n");

epics/trunk/epics_example/myexampleApp/src
dbSubExample.c 748 -> 749
--- epics/trunk/epics_example/myexampleApp/src/dbSubExample.c	2014-06-27 02:18:29 UTC (rev 748)
+++ epics/trunk/epics_example/myexampleApp/src/dbSubExample.c	2014-06-27 22:50:17 UTC (rev 749)
@@ -8,7 +8,9 @@
 #include <tcpipExample.h>
 #include <client_util.h>
 
-int mySubDebug = 1;
+int mySubDebug = 0;
+char *hostName = "134.79.229.141";
+int port = 8090;
 int sockfd = -1;
 int counter = 0;
 const int BUF_SIZE = 256;
@@ -32,7 +34,8 @@
   //set to default
   precord->val = def_hyb_v;
 
-  sockfd = open_socket("134.79.229.141",8090);
+  //sockfd = open_socket("134.79.229.141",8090);
+  sockfd = open_socket(hostName,port);
   if(sockfd<0) {
     printf("ERROR could not open socket in readHybridVoltageNear\n");
     return;
@@ -71,7 +74,7 @@
   }
 
 
-  sockfd = open_socket("134.79.229.141",8090);
+  sockfd = open_socket(hostName,port);
   if(sockfd<0) {
     printf("ERROR could not open socket in readHybridVoltageNear\n");
     return;
@@ -94,12 +97,11 @@
   if (mySubDebug) {
     printf("Read CalDelay\n");
   }
-
-  readCalDelay(&sockfd,value,BUF_SIZE);    
   if (mySubDebug) {
+    char value2[BUF_SIZE];
+    memset(value2,0,BUF_SIZE);    
+    readCalDelay(&sockfd,value2,BUF_SIZE);    
     printf("read directly after got value=\"%s\"\n",value);
-  }
-  if (mySubDebug) {
     printf("close socket\n");
   }
   close_socket(sockfd);
@@ -197,7 +199,7 @@
   if(mySubDebug) {
     printf("Record %s called mySubTempProcess(%p)\n",precord->name,(void*) precord);
   }
-  sockfd = open_socket("134.79.229.141",8090);
+  sockfd = open_socket(hostName,port);
   if (mySubDebug) {
     printf("Opened TCP/IP socket %d\n",sockfd);
   }
@@ -230,7 +232,7 @@
   if(mySubDebug) {
     printf("Record %s called mySubCalDelayProcess(%p)\n",precord->name,(void*) precord);
   }
-  sockfd = open_socket("134.79.229.141",8090);
+  sockfd = open_socket(hostName,port);
   if (mySubDebug) {
     printf("Opened TCP/IP socket %d\n",sockfd);
   }
SVNspam 0.1