Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

/MbsAPI/f_mbs_status.c

Go to the documentation of this file.
00001 //---------------------------------------------------------------
00002 //        Go4 Release Package v2.10-5 (build 21005) 
00003 //                      03-Nov-2005
00004 //---------------------------------------------------------------
00005 //       The GSI Online Offline Object Oriented (Go4) Project
00006 //       Experiment Data Processing at DVEE 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 "sbs_def.h"
00023 #include "sys_def.h"
00024 #include "ml_def.h"
00025 #include "portnum_def.h"
00026 #include "s_daqst.h"
00027 #include "s_setup.h"
00028 #include "s_set_ml.h"
00029 #include "s_set_mo.h"
00030 #include "f_stccomm.h"
00031 #include "f_ut_status.h"
00032 
00033 long l_gl_tcp_chan;
00034 
00035 int l_status,l;
00036 
00037 #define VERSION__DAQST  2
00038 #define VERSION__SETUP  1
00039 #define VERSION__SET_ML 1
00040 #define VERSION__SET_MO 1
00041 
00042 /*1+ C Procedure *************+****************************************/
00043 /*                                                                    */
00044 /*+ Module      : f_mbs_status                                       */
00045 /*                                                                    */
00046 /*--------------------------------------------------------------------*/
00047 /*+ CALLING     : l_status=f_mbs_status(s_daqst, socket)             */
00048 /*--------------------------------------------------------------------*/
00049 /*                                                                    */
00050 /*+ PURPOSE     : Read s_daqst from socket.                           */
00051 /*                                                                    */
00052 /*+ ARGUMENTS   :                                                     */
00053 /*+  s_daqst    : pointer to s_daqst                                  */
00054 /*+  socket     : Tcp socket from connect                             */
00055 /*1- C Procedure *************+****************************************/
00056 INTS4 f_mbs_status(CHARS *c_node, s_daqst *ps_daqst)
00057 {
00058   struct s_tcpcomm *ps_tcpcomm;
00059 
00060   ps_tcpcomm = (struct s_tcpcomm *) malloc (sizeof( struct s_tcpcomm));
00061   l_status = f_stc_connectserver (c_node,PORT__STAT_SERV,&l_gl_tcp_chan,ps_tcpcomm);
00062   if (l_status != STC__SUCCESS)
00063     {
00064       free(ps_tcpcomm);
00065       return(-2);
00066     }
00067   l_status = f_ut_status_r (ps_daqst, l_gl_tcp_chan);
00068   f_stc_discclient (l_gl_tcp_chan);
00069   free(ps_tcpcomm);
00070   return l_status;
00071 }
00072 
00073 
00074 /*1+ C Procedure *************+****************************************/
00075 /*                                                                    */
00076 /*+ Module      : f_mbs_setup                                        */
00077 /*                                                                    */
00078 /*--------------------------------------------------------------------*/
00079 /*+ CALLING     : l_status=f_mbs_setup(s_setup, socket)              */
00080 /*--------------------------------------------------------------------*/
00081 /*                                                                    */
00082 /*+ PURPOSE     : Read s_setup from socket.                           */
00083 /*                                                                    */
00084 /*+ ARGUMENTS   :                                                     */
00085 /*+  s_setup    : pointer to s_setup                                  */
00086 /*+  socket     : Tcp socket from connect                             */
00087 /*1- C Procedure *************+****************************************/
00088 INTS4 f_mbs_setup(CHARS *c_node, s_setup *ps_setup)
00089 {
00090   s_daqst *ps_daqst;
00091   struct s_tcpcomm *ps_tcpcomm;
00092 
00093   ps_tcpcomm = (struct s_tcpcomm *) malloc (sizeof( struct s_tcpcomm));
00094   l_status = f_stc_connectserver (c_node,PORT__STAT_SERV,&l_gl_tcp_chan,ps_tcpcomm);
00095   if (l_status != STC__SUCCESS)
00096     {
00097       free(ps_tcpcomm);
00098       return(-2);
00099     }
00100   ps_daqst   = (s_daqst *) malloc (sizeof( s_daqst));
00101   l_status = f_ut_status_r (ps_daqst, l_gl_tcp_chan);
00102   f_stc_discclient (l_gl_tcp_chan);
00103   l_status = f_stc_connectserver (c_node,PORT__STAT_SERV,&l_gl_tcp_chan,ps_tcpcomm);
00104   if (l_status != STC__SUCCESS)
00105     {
00106       free(ps_tcpcomm);
00107       free(ps_daqst);
00108       return(-1);
00109     }
00110   if(ps_daqst->bh_setup_loaded == 0) l_status=-3;
00111   else l_status = f_ut_setup_r (ps_setup, l_gl_tcp_chan);
00112   f_stc_discclient (l_gl_tcp_chan);
00113   free(ps_daqst);
00114   free(ps_tcpcomm);
00115   return l_status;
00116 }
00117 
00118 
00119 /*1+ C Procedure *************+****************************************/
00120 /*                                                                    */
00121 /*+ Module      : f_mbs_ml_setup                                       */
00122 /*                                                                    */
00123 /*--------------------------------------------------------------------*/
00124 /*+ CALLING     : l_status=f_mbs_ml_setup(s_set_ml, socket)            */
00125 /*--------------------------------------------------------------------*/
00126 /*                                                                    */
00127 /*+ PURPOSE     : Read s_set_ml from socket.                          */
00128 /*                                                                    */
00129 /*+ ARGUMENTS   :                                                     */
00130 /*+  s_set_ml   : pointer to s_set_ml                                 */
00131 /*+  socket     : Tcp socket from connect                             */
00132 /*1- C Procedure *************+****************************************/
00133 INTS4 f_mbs_ml_setup(CHARS *c_node, s_set_ml *ps_set_ml)
00134 {
00135   s_daqst *ps_daqst;
00136   struct s_tcpcomm *ps_tcpcomm;
00137 
00138   ps_tcpcomm = (struct s_tcpcomm *) malloc (sizeof( struct s_tcpcomm));
00139   l_status = f_stc_connectserver (c_node,PORT__STAT_SERV,&l_gl_tcp_chan,ps_tcpcomm);
00140   if (l_status != STC__SUCCESS)
00141     {
00142       free(ps_tcpcomm);
00143       return(-2);
00144     }
00145   ps_daqst   = (s_daqst *) malloc (sizeof( s_daqst));
00146   l_status = f_ut_status_r (ps_daqst, l_gl_tcp_chan);
00147   f_stc_discclient (l_gl_tcp_chan);
00148   l_status = f_stc_connectserver (c_node,PORT__STAT_SERV,&l_gl_tcp_chan,ps_tcpcomm);
00149   if (l_status != STC__SUCCESS)
00150     {
00151       free(ps_tcpcomm);
00152       free(ps_daqst);
00153       return(-1);
00154     }
00155   if(ps_daqst->bh_set_ml_loaded == 0) l_status=-3;
00156   else l_status = f_ut_set_ml_r (ps_set_ml, l_gl_tcp_chan);
00157   f_stc_discclient (l_gl_tcp_chan);
00158   free(ps_tcpcomm);
00159   free(ps_daqst);
00160   return l_status;
00161 }
00162 /*1+ C Procedure *************+****************************************/
00163 /*                                                                    */
00164 /*+ Module      : f_mbs_mo_setup                                       */
00165 /*                                                                    */
00166 /*--------------------------------------------------------------------*/
00167 /*+ CALLING     : l_status=f_mbs_mo_setup(s_set_mo, socket)            */
00168 /*--------------------------------------------------------------------*/
00169 /*                                                                    */
00170 /*+ PURPOSE     : Read s_set_mo from socket.                          */
00171 /*                                                                    */
00172 /*+ ARGUMENTS   :                                                     */
00173 /*+  s_set_mo   : pointer to s_set_mo                                 */
00174 /*+  socket     : Tcp socket from connect                             */
00175 /*1- C Procedure *************+****************************************/
00176 INTS4 f_mbs_mo_setup(CHARS *c_node, s_set_mo *ps_set_mo)
00177 {
00178   s_daqst *ps_daqst;
00179   struct s_tcpcomm *ps_tcpcomm;
00180 
00181   ps_tcpcomm = (struct s_tcpcomm *) malloc (sizeof( struct s_tcpcomm));
00182   l_status = f_stc_connectserver (c_node,PORT__STAT_SERV,&l_gl_tcp_chan,ps_tcpcomm);
00183   if (l_status != STC__SUCCESS)
00184     {
00185       free(ps_tcpcomm);
00186       return(-2);
00187     }
00188   ps_daqst   = (s_daqst *) malloc (sizeof( s_daqst));
00189   l_status = f_ut_status_r (ps_daqst, l_gl_tcp_chan);
00190   f_stc_discclient (l_gl_tcp_chan);
00191   l_status = f_stc_connectserver (c_node,PORT__STAT_SERV,&l_gl_tcp_chan,ps_tcpcomm);
00192   if (l_status != STC__SUCCESS)
00193     {
00194       free(ps_tcpcomm);
00195       free(ps_daqst);
00196       return(-1);
00197     }
00198   if(ps_daqst->bh_set_mo_loaded == 0) l_status=-3;
00199   else l_status = f_ut_set_mo_r (ps_set_mo, l_gl_tcp_chan);
00200   f_stc_discclient (l_gl_tcp_chan);
00201   free(ps_tcpcomm);
00202   free(ps_daqst);
00203   return l_status;
00204 }
00205 
00206 //----------------------------END OF GO4 SOURCE FILE ---------------------

Generated on Tue Nov 8 10:56:08 2005 for Go4-v2.10-5 by doxygen1.2.15