Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

f_mbs_status.c

Go to the documentation of this file.
00001 //-------------------------------------------------------------
00002 //        Go4 Release Package v3.04-01 (build 30401)
00003 //                      28-November-2008
00004 //---------------------------------------------------------------
00005 //   The GSI Online Offline Object Oriented (Go4) Project
00006 //   Experiment Data Processing at EE department, GSI
00007 //---------------------------------------------------------------
00008 //
00009 //Copyright (C) 2000- Gesellschaft f. Schwerionenforschung, GSI
00010 //                    Planckstr. 1, 64291 Darmstadt, Germany
00011 //Contact:            http://go4.gsi.de
00012 //----------------------------------------------------------------
00013 //This software can be used under the license agreements as stated
00014 //in Go4License.txt file which is part of the distribution.
00015 //----------------------------------------------------------------
00016 #include "typedefs.h"
00017 #include <stdio.h>
00018 #include <errno.h>
00019 #include <string.h>
00020 #include <sys/types.h>
00021 #include <ctype.h>
00022 #include <stdlib.h>
00023 #include "sbs_def.h"
00024 #include "sys_def.h"
00025 #include "ml_def.h"
00026 #include "portnum_def.h"
00027 #include "s_daqst.h"
00028 #include "s_setup.h"
00029 #include "s_set_ml.h"
00030 #include "s_set_mo.h"
00031 #include "f_stccomm.h"
00032 #include "f_ut_status.h"
00033 
00034 long l_gl_tcp_chan;
00035 
00036 int l_status,l;
00037 
00038 #define VERSION__DAQST  2
00039 #define VERSION__SETUP  1
00040 #define VERSION__SET_ML 1
00041 #define VERSION__SET_MO 1
00042 
00043 /*1+ C Procedure *************+****************************************/
00044 /*                                                                    */
00045 /*+ Module      : f_mbs_status                                       */
00046 /*                                                                    */
00047 /*--------------------------------------------------------------------*/
00048 /*+ CALLING     : l_status=f_mbs_status(s_daqst, socket)             */
00049 /*--------------------------------------------------------------------*/
00050 /*                                                                    */
00051 /*+ PURPOSE     : Read s_daqst from socket.                           */
00052 /*                                                                    */
00053 /*+ ARGUMENTS   :                                                     */
00054 /*+  s_daqst    : pointer to s_daqst                                  */
00055 /*+  socket     : Tcp socket from connect                             */
00056 /*1- C Procedure *************+****************************************/
00057 INTS4 f_mbs_status(CHARS *c_node, s_daqst *ps_daqst)
00058 {
00059   struct s_tcpcomm *ps_tcpcomm;
00060 
00061   ps_tcpcomm = (struct s_tcpcomm *) malloc (sizeof( struct s_tcpcomm));
00062   l_status = f_stc_connectserver (c_node,PORT__STAT_SERV,&l_gl_tcp_chan,ps_tcpcomm);
00063   if (l_status != STC__SUCCESS)
00064     {
00065       free(ps_tcpcomm);
00066       return(-2);
00067     }
00068   l_status = f_ut_status_r (ps_daqst, l_gl_tcp_chan);
00069   f_stc_discclient (l_gl_tcp_chan);
00070   free(ps_tcpcomm);
00071   return l_status;
00072 }
00073 
00074 
00075 /*1+ C Procedure *************+****************************************/
00076 /*                                                                    */
00077 /*+ Module      : f_mbs_setup                                        */
00078 /*                                                                    */
00079 /*--------------------------------------------------------------------*/
00080 /*+ CALLING     : l_status=f_mbs_setup(s_setup, socket)              */
00081 /*--------------------------------------------------------------------*/
00082 /*                                                                    */
00083 /*+ PURPOSE     : Read s_setup from socket.                           */
00084 /*                                                                    */
00085 /*+ ARGUMENTS   :                                                     */
00086 /*+  s_setup    : pointer to s_setup                                  */
00087 /*+  socket     : Tcp socket from connect                             */
00088 /*1- C Procedure *************+****************************************/
00089 INTS4 f_mbs_setup(CHARS *c_node, s_setup *ps_setup)
00090 {
00091   s_daqst *ps_daqst;
00092   struct s_tcpcomm *ps_tcpcomm;
00093 
00094   ps_tcpcomm = (struct s_tcpcomm *) malloc (sizeof( struct s_tcpcomm));
00095   l_status = f_stc_connectserver (c_node,PORT__STAT_SERV,&l_gl_tcp_chan,ps_tcpcomm);
00096   if (l_status != STC__SUCCESS)
00097     {
00098       free(ps_tcpcomm);
00099       return(-2);
00100     }
00101   ps_daqst   = (s_daqst *) malloc (sizeof( s_daqst));
00102   l_status = f_ut_status_r (ps_daqst, l_gl_tcp_chan);
00103   f_stc_discclient (l_gl_tcp_chan);
00104   l_status = f_stc_connectserver (c_node,PORT__STAT_SERV,&l_gl_tcp_chan,ps_tcpcomm);
00105   if (l_status != STC__SUCCESS)
00106     {
00107       free(ps_tcpcomm);
00108       free(ps_daqst);
00109       return(-1);
00110     }
00111   if(ps_daqst->bh_setup_loaded == 0) l_status=-3;
00112   else l_status = f_ut_setup_r (ps_setup, l_gl_tcp_chan);
00113   f_stc_discclient (l_gl_tcp_chan);
00114   free(ps_daqst);
00115   free(ps_tcpcomm);
00116   return l_status;
00117 }
00118 
00119 
00120 /*1+ C Procedure *************+****************************************/
00121 /*                                                                    */
00122 /*+ Module      : f_mbs_ml_setup                                       */
00123 /*                                                                    */
00124 /*--------------------------------------------------------------------*/
00125 /*+ CALLING     : l_status=f_mbs_ml_setup(s_set_ml, socket)            */
00126 /*--------------------------------------------------------------------*/
00127 /*                                                                    */
00128 /*+ PURPOSE     : Read s_set_ml from socket.                          */
00129 /*                                                                    */
00130 /*+ ARGUMENTS   :                                                     */
00131 /*+  s_set_ml   : pointer to s_set_ml                                 */
00132 /*+  socket     : Tcp socket from connect                             */
00133 /*1- C Procedure *************+****************************************/
00134 INTS4 f_mbs_ml_setup(CHARS *c_node, s_set_ml *ps_set_ml)
00135 {
00136   s_daqst *ps_daqst;
00137   struct s_tcpcomm *ps_tcpcomm;
00138 
00139   ps_tcpcomm = (struct s_tcpcomm *) malloc (sizeof( struct s_tcpcomm));
00140   l_status = f_stc_connectserver (c_node,PORT__STAT_SERV,&l_gl_tcp_chan,ps_tcpcomm);
00141   if (l_status != STC__SUCCESS)
00142     {
00143       free(ps_tcpcomm);
00144       return(-2);
00145     }
00146   ps_daqst   = (s_daqst *) malloc (sizeof( s_daqst));
00147   l_status = f_ut_status_r (ps_daqst, l_gl_tcp_chan);
00148   f_stc_discclient (l_gl_tcp_chan);
00149   l_status = f_stc_connectserver (c_node,PORT__STAT_SERV,&l_gl_tcp_chan,ps_tcpcomm);
00150   if (l_status != STC__SUCCESS)
00151     {
00152       free(ps_tcpcomm);
00153       free(ps_daqst);
00154       return(-1);
00155     }
00156   if(ps_daqst->bh_set_ml_loaded == 0) l_status=-3;
00157   else l_status = f_ut_set_ml_r (ps_set_ml, l_gl_tcp_chan);
00158   f_stc_discclient (l_gl_tcp_chan);
00159   free(ps_tcpcomm);
00160   free(ps_daqst);
00161   return l_status;
00162 }
00163 /*1+ C Procedure *************+****************************************/
00164 /*                                                                    */
00165 /*+ Module      : f_mbs_mo_setup                                       */
00166 /*                                                                    */
00167 /*--------------------------------------------------------------------*/
00168 /*+ CALLING     : l_status=f_mbs_mo_setup(s_set_mo, socket)            */
00169 /*--------------------------------------------------------------------*/
00170 /*                                                                    */
00171 /*+ PURPOSE     : Read s_set_mo from socket.                          */
00172 /*                                                                    */
00173 /*+ ARGUMENTS   :                                                     */
00174 /*+  s_set_mo   : pointer to s_set_mo                                 */
00175 /*+  socket     : Tcp socket from connect                             */
00176 /*1- C Procedure *************+****************************************/
00177 INTS4 f_mbs_mo_setup(CHARS *c_node, s_set_mo *ps_set_mo)
00178 {
00179   s_daqst *ps_daqst;
00180   struct s_tcpcomm *ps_tcpcomm;
00181 
00182   ps_tcpcomm = (struct s_tcpcomm *) malloc (sizeof( struct s_tcpcomm));
00183   l_status = f_stc_connectserver (c_node,PORT__STAT_SERV,&l_gl_tcp_chan,ps_tcpcomm);
00184   if (l_status != STC__SUCCESS)
00185     {
00186       free(ps_tcpcomm);
00187       return(-2);
00188     }
00189   ps_daqst   = (s_daqst *) malloc (sizeof( s_daqst));
00190   l_status = f_ut_status_r (ps_daqst, l_gl_tcp_chan);
00191   f_stc_discclient (l_gl_tcp_chan);
00192   l_status = f_stc_connectserver (c_node,PORT__STAT_SERV,&l_gl_tcp_chan,ps_tcpcomm);
00193   if (l_status != STC__SUCCESS)
00194     {
00195       free(ps_tcpcomm);
00196       free(ps_daqst);
00197       return(-1);
00198     }
00199   if(ps_daqst->bh_set_mo_loaded == 0) l_status=-3;
00200   else l_status = f_ut_set_mo_r (ps_set_mo, l_gl_tcp_chan);
00201   f_stc_discclient (l_gl_tcp_chan);
00202   free(ps_tcpcomm);
00203   free(ps_daqst);
00204   return l_status;
00205 }
00206 
00207 //----------------------------END OF GO4 SOURCE FILE ---------------------

Generated on Fri Nov 28 12:59:33 2008 for Go4-v3.04-1 by  doxygen 1.4.2