]> jspc29.x-matter.uni-frankfurt.de Git - trbnettools.git/commitdiff
update fpga_register_read ...
authorhadaq <hadaq>
Mon, 10 Oct 2011 21:09:59 +0000 (21:09 +0000)
committerhadaq <hadaq>
Mon, 10 Oct 2011 21:09:59 +0000 (21:09 +0000)
trbnetd/trbnetrpc.c

index 3161db3c183991f7cf897a9b0216259ad3848bfb..0bcc8f643ebb695482d6af5e8913801d463c23ae 100644 (file)
@@ -5,7 +5,7 @@
 
 #include "trbnet.h"
 
-const char trbnet_version[] = "$Revision: 1.6 $";
+const char trbnet_version[] = "$Revision: 1.7 $";
 unsigned int trb_debug = 0;
 unsigned int trb_dma = 0;
 
@@ -371,9 +371,29 @@ int trb_send_trigger_rich(uint8_t input,
 
 int fpga_register_read(uint16_t reg_address, uint32_t* value)
 {
-  return -1;
-}
+  enum clnt_stat status;
+  RetVal retVal;
+  
+  if (trb_client == NULL) return -1;
 
+  retVal.data.Buffer_val = value;
+  retVal.data.Buffer_len = 1;
+
+  status = fpga_register_read_1(reg_address,
+                                &retVal, trb_client);
+  
+  if (status != RPC_SUCCESS) {
+    /*
+     * An error occurred while calling the server.
+     * Print error message and stop.
+     */
+    clnt_perror(trb_client, trb_server);
+    return -1;
+  }
+  
+  copyStatus(&retVal.status);
+  return retVal.status.retVal;
+}
 
 int fpga_register_write(uint16_t reg_address, uint32_t value)
 {