Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #include "typedefs.h"
00015 #include <stdio.h>
00016 #include <errno.h>
00017 #include <string.h>
00018 #include <sys/types.h>
00019 #include <ctype.h>
00020 #include <stdlib.h>
00021 #include "sbs_def.h"
00022 #include "sys_def.h"
00023 #include "ml_def.h"
00024 #include "portnum_def.h"
00025 #include "s_daqst.h"
00026 #include "s_setup.h"
00027 #include "s_set_ml.h"
00028 #include "s_set_mo.h"
00029 #include "f_stccomm.h"
00030 #include "f_ut_status.h"
00031
00032 INTS4 l_gl_tcp_chan;
00033
00034 int l_status,l;
00035
00036 #define VERSION__DAQST 2
00037 #define VERSION__SETUP 1
00038 #define VERSION__SET_ML 1
00039 #define VERSION__SET_MO 1
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055 INTS4 f_mbs_status(CHARS *c_node, s_daqst *ps_daqst)
00056 {
00057 struct s_tcpcomm *ps_tcpcomm;
00058
00059 ps_tcpcomm = (struct s_tcpcomm *) malloc (sizeof( struct s_tcpcomm));
00060 l_status = f_stc_connectserver (c_node,PORT__STAT_SERV,&l_gl_tcp_chan,ps_tcpcomm);
00061 if (l_status != STC__SUCCESS)
00062 {
00063 free(ps_tcpcomm);
00064 return(-2);
00065 }
00066 l_status = f_ut_status_r (ps_daqst, l_gl_tcp_chan);
00067 f_stc_discclient (l_gl_tcp_chan);
00068 free(ps_tcpcomm);
00069 return l_status;
00070 }
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087 INTS4 f_mbs_setup(CHARS *c_node, s_setup *ps_setup)
00088 {
00089 s_daqst *ps_daqst;
00090 struct s_tcpcomm *ps_tcpcomm;
00091
00092 ps_tcpcomm = (struct s_tcpcomm *) malloc (sizeof( struct s_tcpcomm));
00093 l_status = f_stc_connectserver (c_node,PORT__STAT_SERV,&l_gl_tcp_chan,ps_tcpcomm);
00094 if (l_status != STC__SUCCESS)
00095 {
00096 free(ps_tcpcomm);
00097 return(-2);
00098 }
00099 ps_daqst = (s_daqst *) malloc (sizeof( s_daqst));
00100 l_status = f_ut_status_r (ps_daqst, l_gl_tcp_chan);
00101 f_stc_discclient (l_gl_tcp_chan);
00102 l_status = f_stc_connectserver (c_node,PORT__STAT_SERV,&l_gl_tcp_chan,ps_tcpcomm);
00103 if (l_status != STC__SUCCESS)
00104 {
00105 free(ps_tcpcomm);
00106 free(ps_daqst);
00107 return(-1);
00108 }
00109 if(ps_daqst->bh_setup_loaded == 0) l_status=-3;
00110 else l_status = f_ut_setup_r (ps_setup, l_gl_tcp_chan);
00111 f_stc_discclient (l_gl_tcp_chan);
00112 free(ps_daqst);
00113 free(ps_tcpcomm);
00114 return l_status;
00115 }
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132 INTS4 f_mbs_ml_setup(CHARS *c_node, s_set_ml *ps_set_ml)
00133 {
00134 s_daqst *ps_daqst;
00135 struct s_tcpcomm *ps_tcpcomm;
00136
00137 ps_tcpcomm = (struct s_tcpcomm *) malloc (sizeof( struct s_tcpcomm));
00138 l_status = f_stc_connectserver (c_node,PORT__STAT_SERV,&l_gl_tcp_chan,ps_tcpcomm);
00139 if (l_status != STC__SUCCESS)
00140 {
00141 free(ps_tcpcomm);
00142 return(-2);
00143 }
00144 ps_daqst = (s_daqst *) malloc (sizeof( s_daqst));
00145 l_status = f_ut_status_r (ps_daqst, l_gl_tcp_chan);
00146 f_stc_discclient (l_gl_tcp_chan);
00147 l_status = f_stc_connectserver (c_node,PORT__STAT_SERV,&l_gl_tcp_chan,ps_tcpcomm);
00148 if (l_status != STC__SUCCESS)
00149 {
00150 free(ps_tcpcomm);
00151 free(ps_daqst);
00152 return(-1);
00153 }
00154 if(ps_daqst->bh_set_ml_loaded == 0) l_status=-3;
00155 else l_status = f_ut_set_ml_r (ps_set_ml, l_gl_tcp_chan);
00156 f_stc_discclient (l_gl_tcp_chan);
00157 free(ps_tcpcomm);
00158 free(ps_daqst);
00159 return l_status;
00160 }
00161
00162
00163
00164
00165
00166
00167
00168
00169
00170
00171
00172
00173
00174
00175 INTS4 f_mbs_mo_setup(CHARS *c_node, s_set_mo *ps_set_mo)
00176 {
00177 s_daqst *ps_daqst;
00178 struct s_tcpcomm *ps_tcpcomm;
00179
00180 ps_tcpcomm = (struct s_tcpcomm *) malloc (sizeof( struct s_tcpcomm));
00181 l_status = f_stc_connectserver (c_node,PORT__STAT_SERV,&l_gl_tcp_chan,ps_tcpcomm);
00182 if (l_status != STC__SUCCESS)
00183 {
00184 free(ps_tcpcomm);
00185 return(-2);
00186 }
00187 ps_daqst = (s_daqst *) malloc (sizeof( s_daqst));
00188 l_status = f_ut_status_r (ps_daqst, l_gl_tcp_chan);
00189 f_stc_discclient (l_gl_tcp_chan);
00190 l_status = f_stc_connectserver (c_node,PORT__STAT_SERV,&l_gl_tcp_chan,ps_tcpcomm);
00191 if (l_status != STC__SUCCESS)
00192 {
00193 free(ps_tcpcomm);
00194 free(ps_daqst);
00195 return(-1);
00196 }
00197 if(ps_daqst->bh_set_mo_loaded == 0) l_status=-3;
00198 else l_status = f_ut_set_mo_r (ps_set_mo, l_gl_tcp_chan);
00199 f_stc_discclient (l_gl_tcp_chan);
00200 free(ps_tcpcomm);
00201 free(ps_daqst);
00202 return l_status;
00203 }