Commit 77771ea8 authored by Claes Sjofors's avatar Claes Sjofors

Status monitor, timeout for receive added

parent 6c0c724d
...@@ -264,6 +264,7 @@ int main() ...@@ -264,6 +264,7 @@ int main()
errh_SetStatus( PWR__SRUN); errh_SetStatus( PWR__SRUN);
soap_init( &soap); soap_init( &soap);
soap.bind_flags = 0;
for ( int k = 0; k < restarts + 1; k++) { for ( int k = 0; k < restarts + 1; k++) {
m = soap_bind( &soap, NULL, opcsrv->m_config->Port, 100); m = soap_bind( &soap, NULL, opcsrv->m_config->Port, 100);
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#include "statussrv_utl.h" #include "statussrv_utl.h"
#include "co_time.h" #include "co_time.h"
#include "co_cdh.h" #include "co_cdh.h"
#include "co_cnf.h"
#include "co_syi.h" #include "co_syi.h"
#include "rt_pwr_msg.h" #include "rt_pwr_msg.h"
...@@ -12,6 +13,24 @@ static struct soap soap; ...@@ -12,6 +13,24 @@ static struct soap soap;
static int init_done = 0; static int init_done = 0;
static int port = 18084; static int port = 18084;
static void init()
{
float timeout;
char timeoutstr[20];
if ( init_done)
return;
soap_init( &soap);
if ( cnf_get_value("statusMonitorTimeout", timeoutstr, sizeof(timeoutstr)) != 0 &&
sscanf( timeoutstr, "%f", &timeout) == 1)
soap.recv_timeout = -1000000 * timeout; // Negative value is us, positive is s
else
soap.recv_timeout = -200000;
init_done = 1;
}
static char *nname( const char *nodename) static char *nname( const char *nodename)
{ {
static char n[80]; static char n[80];
...@@ -31,10 +50,8 @@ pwr_tStatus statussrv_GetStatus( const char *nodename, statussrv_sGetStatus *res ...@@ -31,10 +50,8 @@ pwr_tStatus statussrv_GetStatus( const char *nodename, statussrv_sGetStatus *res
pwr_tStatus sts = PWR__SUCCESS; pwr_tStatus sts = PWR__SUCCESS;
char endpoint[80]; char endpoint[80];
if ( !init_done) { if ( !init_done)
soap_init( &soap); init();
init_done = 1;
}
sprintf( endpoint, "http://%s:%d", nname(nodename), port); sprintf( endpoint, "http://%s:%d", nname(nodename), port);
...@@ -125,10 +142,8 @@ pwr_tStatus statussrv_GetExtStatus( const char *nodename, statussrv_sGetExtStatu ...@@ -125,10 +142,8 @@ pwr_tStatus statussrv_GetExtStatus( const char *nodename, statussrv_sGetExtStatu
pwr_tStatus sts = PWR__SUCCESS; pwr_tStatus sts = PWR__SUCCESS;
char endpoint[80]; char endpoint[80];
if ( !init_done) { if ( !init_done)
soap_init( &soap); init();
init_done = 1;
}
sprintf( endpoint, "http://%s:%d", nname(nodename), port); sprintf( endpoint, "http://%s:%d", nname(nodename), port);
...@@ -398,10 +413,8 @@ pwr_tStatus statussrv_Restart( const char *nodename) ...@@ -398,10 +413,8 @@ pwr_tStatus statussrv_Restart( const char *nodename)
pwr_tStatus sts = PWR__SUCCESS; pwr_tStatus sts = PWR__SUCCESS;
char endpoint[80]; char endpoint[80];
if ( !init_done) { if ( !init_done)
soap_init( &soap); init();
init_done = 1;
}
sprintf( endpoint, "http://%s:%d", nname(nodename), port); sprintf( endpoint, "http://%s:%d", nname(nodename), port);
...@@ -428,10 +441,8 @@ pwr_tStatus statussrv_XttStart( const char *nodename, const char *opplace, const ...@@ -428,10 +441,8 @@ pwr_tStatus statussrv_XttStart( const char *nodename, const char *opplace, const
pwr_tStatus sts = PWR__SUCCESS; pwr_tStatus sts = PWR__SUCCESS;
char endpoint[80]; char endpoint[80];
if ( !init_done) { if ( !init_done)
soap_init( &soap); init();
init_done = 1;
}
sprintf( endpoint, "http://%s:%d", nname(nodename), port); sprintf( endpoint, "http://%s:%d", nname(nodename), port);
...@@ -476,10 +487,8 @@ pwr_tStatus statussrv_RtMonStart( const char *nodename, const char *lang, const ...@@ -476,10 +487,8 @@ pwr_tStatus statussrv_RtMonStart( const char *nodename, const char *lang, const
pwr_tStatus sts = PWR__SUCCESS; pwr_tStatus sts = PWR__SUCCESS;
char endpoint[80]; char endpoint[80];
if ( !init_done) { if ( !init_done)
soap_init( &soap); init();
init_done = 1;
}
sprintf( endpoint, "http://%s:%d", nname(nodename), port); sprintf( endpoint, "http://%s:%d", nname(nodename), port);
......
...@@ -331,7 +331,7 @@ if test $pwre_hw == "hw_arm"; then ...@@ -331,7 +331,7 @@ if test $pwre_hw == "hw_arm"; then
echo "export pwre_conf_cc_define=\"$conf_cc_define\"" >> $cfile echo "export pwre_conf_cc_define=\"$conf_cc_define\"" >> $cfile
echo "export pwre_conf_libpwrco=\"-lpwr_co\"" >> $cfile echo "export pwre_conf_libpwrco=\"-lpwr_co\"" >> $cfile
echo "export pwre_conf_libpwrrt=\"-lpwr_rt -lpwr_co -lpwr_statussrv -lpwr_msg_dummy\"" >> $cfile echo "export pwre_conf_libpwrrt=\"-lpwr_rt -lpwr_statussrv -lpwr_co -lpwr_msg_dummy\"" >> $cfile
echo "export pwre_conf_libpwrdtt=\"-lpwr_dtt\"" >> $cfile echo "export pwre_conf_libpwrdtt=\"-lpwr_dtt\"" >> $cfile
echo "export pwre_conf_libpwrotherio=\"-lpwr_usbio_dummy -lpwr_usb_dummy -lpwr_cifx_dummy\"" >> $cfile echo "export pwre_conf_libpwrotherio=\"-lpwr_usbio_dummy -lpwr_usb_dummy -lpwr_cifx_dummy\"" >> $cfile
echo "export pwre_conf_libpwrprofibus=\"-lpwr_pnak_dummy\"" >> $cfile echo "export pwre_conf_libpwrprofibus=\"-lpwr_pnak_dummy\"" >> $cfile
...@@ -416,7 +416,7 @@ else ...@@ -416,7 +416,7 @@ else
echo "export pwre_conf_cc_define=\"$conf_cc_define\"" >> $cfile echo "export pwre_conf_cc_define=\"$conf_cc_define\"" >> $cfile
echo "export pwre_conf_libpwrco=\"-lpwr_co\"" >> $cfile echo "export pwre_conf_libpwrco=\"-lpwr_co\"" >> $cfile
echo "export pwre_conf_libpwrrt=\"-lpwr_rt -lpwr_co -lpwr_statussrv -lpwr_msg_dummy\"" >> $cfile echo "export pwre_conf_libpwrrt=\"-lpwr_rt -lpwr_statussrv -lpwr_co -lpwr_msg_dummy\"" >> $cfile
echo "export pwre_conf_libpwrdtt=\"-lpwr_dtt\"" >> $cfile echo "export pwre_conf_libpwrdtt=\"-lpwr_dtt\"" >> $cfile
echo "export pwre_conf_libpwrotherio=\"-lpwr_usbio_dummy -lpwr_usb_dummy -lpwr_cifx_dummy\"" >> $cfile echo "export pwre_conf_libpwrotherio=\"-lpwr_usbio_dummy -lpwr_usb_dummy -lpwr_cifx_dummy\"" >> $cfile
echo "export pwre_conf_libpwrprofibus=\"-lpwr_pnak_dummy\"" >> $cfile echo "export pwre_conf_libpwrprofibus=\"-lpwr_pnak_dummy\"" >> $cfile
......
...@@ -329,7 +329,7 @@ echo "export wb_rtt=\$pwr_exe/wb_rtt" >> $cfile ...@@ -329,7 +329,7 @@ echo "export wb_rtt=\$pwr_exe/wb_rtt" >> $cfile
echo "export pwre_conf_cc_define=\"$conf_cc_define\"" >> $cfile echo "export pwre_conf_cc_define=\"$conf_cc_define\"" >> $cfile
echo "export pwre_conf_libpwrco=\"-lpwr_co\"" >> $cfile echo "export pwre_conf_libpwrco=\"-lpwr_co\"" >> $cfile
echo "export pwre_conf_libpwrrt=\"-lpwr_rt -lpwr_co -lpwr_statussrv -lpwr_msg_dummy\"" >> $cfile echo "export pwre_conf_libpwrrt=\"-lpwr_rt -lpwr_statussrv -lpwr_co -lpwr_msg_dummy\"" >> $cfile
echo "export pwre_conf_libpwrdtt=\"-lpwr_dtt\"" >> $cfile echo "export pwre_conf_libpwrdtt=\"-lpwr_dtt\"" >> $cfile
echo "export pwre_conf_libpwrotherio=\"-lpwr_usbio_dummy -lpwr_usb_dummy\"" >> $cfile echo "export pwre_conf_libpwrotherio=\"-lpwr_usbio_dummy -lpwr_usb_dummy\"" >> $cfile
echo "export pwre_conf_libpwrxtt=\"-lpwr_xtt -lpwr_ge -lpwr_cow -lpwr_flow -lpwr_glow\"" >> $cfile echo "export pwre_conf_libpwrxtt=\"-lpwr_xtt -lpwr_ge -lpwr_cow -lpwr_flow -lpwr_glow\"" >> $cfile
......
...@@ -389,7 +389,7 @@ if [ $pwre_hw == "hw_arm" ] && [ $ebuild -eq 1 ]; then ...@@ -389,7 +389,7 @@ if [ $pwre_hw == "hw_arm" ] && [ $ebuild -eq 1 ]; then
echo "export pwre_conf_cc_define=\"$conf_cc_define\"" >> $cfile echo "export pwre_conf_cc_define=\"$conf_cc_define\"" >> $cfile
echo "export pwre_conf_libpwrco=\"-lpwr_co\"" >> $cfile echo "export pwre_conf_libpwrco=\"-lpwr_co\"" >> $cfile
echo "export pwre_conf_libpwrrt=\"-lpwr_rt -lpwr_co -lpwr_statussrv -lpwr_msg_dummy\"" >> $cfile echo "export pwre_conf_libpwrrt=\"-lpwr_rt -lpwr_statussrv -lpwr_co -lpwr_msg_dummy\"" >> $cfile
echo "export pwre_conf_libpwrdtt=\"-lpwr_dtt\"" >> $cfile echo "export pwre_conf_libpwrdtt=\"-lpwr_dtt\"" >> $cfile
echo "export pwre_conf_libpwrotherio=\"-lpwr_usbio_dummy -lpwr_usb_dummy -lpwr_cifx_dummy\"" >> $cfile echo "export pwre_conf_libpwrotherio=\"-lpwr_usbio_dummy -lpwr_usb_dummy -lpwr_cifx_dummy\"" >> $cfile
echo "export pwre_conf_libpwrprofibus=\"-lpwr_pnak_dummy\"" >> $cfile echo "export pwre_conf_libpwrprofibus=\"-lpwr_pnak_dummy\"" >> $cfile
...@@ -492,7 +492,7 @@ else ...@@ -492,7 +492,7 @@ else
echo "export pwre_conf_cc_define=\"$conf_cc_define\"" >> $cfile echo "export pwre_conf_cc_define=\"$conf_cc_define\"" >> $cfile
echo "export pwre_conf_libpwrco=\"-lpwr_co\"" >> $cfile echo "export pwre_conf_libpwrco=\"-lpwr_co\"" >> $cfile
echo "export pwre_conf_libpwrrt=\"-lpwr_rt -lpwr_co -lpwr_statussrv -lpwr_msg_dummy\"" >> $cfile echo "export pwre_conf_libpwrrt=\"-lpwr_rt -lpwr_statussrv -lpwr_co -lpwr_msg_dummy\"" >> $cfile
echo "export pwre_conf_libpwrdtt=\"-lpwr_dtt\"" >> $cfile echo "export pwre_conf_libpwrdtt=\"-lpwr_dtt\"" >> $cfile
echo "export pwre_conf_libpwrotherio=\"-lpwr_usbio_dummy -lpwr_usb_dummy -lpwr_cifx_dummy -lpwr_nodave_dummy -lpwr_epl_dummy\"" >> $cfile echo "export pwre_conf_libpwrotherio=\"-lpwr_usbio_dummy -lpwr_usb_dummy -lpwr_cifx_dummy -lpwr_nodave_dummy -lpwr_epl_dummy\"" >> $cfile
echo "export pwre_conf_libpwrprofibus=\"-lpwr_pnak_dummy\"" >> $cfile echo "export pwre_conf_libpwrprofibus=\"-lpwr_pnak_dummy\"" >> $cfile
......
...@@ -329,7 +329,7 @@ echo "export PKG_CONFIG_PATH=/sw/fink/pkgconfig" >> $cfile ...@@ -329,7 +329,7 @@ echo "export PKG_CONFIG_PATH=/sw/fink/pkgconfig" >> $cfile
echo "export pwre_conf_cc_define=\"$conf_cc_define\"" >> $cfile echo "export pwre_conf_cc_define=\"$conf_cc_define\"" >> $cfile
echo "export pwre_conf_libpwrco=\"-lpwr_co\"" >> $cfile echo "export pwre_conf_libpwrco=\"-lpwr_co\"" >> $cfile
echo "export pwre_conf_libpwrrt=\"-lpwr_rt -lpwr_co -lpwr_statussrv -lpwr_msg_dummy\"" >> $cfile echo "export pwre_conf_libpwrrt=\"-lpwr_rt -lpwr_statussrv -lpwr_co -lpwr_msg_dummy\"" >> $cfile
echo "export pwre_conf_libpwrdtt=\"-lpwr_dtt\"" >> $cfile echo "export pwre_conf_libpwrdtt=\"-lpwr_dtt\"" >> $cfile
echo "export pwre_conf_libpwrotherio=\"-lpwr_usbio_dummy -lpwr_usb_dummy\"" >> $cfile echo "export pwre_conf_libpwrotherio=\"-lpwr_usbio_dummy -lpwr_usb_dummy\"" >> $cfile
echo "export pwre_conf_libpwrxtt=\"-lpwr_xtt -lpwr_ge -lpwr_cow -lpwr_flow -lpwr_glow\"" >> $cfile echo "export pwre_conf_libpwrxtt=\"-lpwr_xtt -lpwr_ge -lpwr_cow -lpwr_flow -lpwr_glow\"" >> $cfile
......
...@@ -333,7 +333,7 @@ echo "export PKG_CONFIG_PATH=/sw/fink/pkgconfig" >> $cfile ...@@ -333,7 +333,7 @@ echo "export PKG_CONFIG_PATH=/sw/fink/pkgconfig" >> $cfile
echo "export pwre_conf_cc_define=\"$conf_cc_define\"" >> $cfile echo "export pwre_conf_cc_define=\"$conf_cc_define\"" >> $cfile
echo "export pwre_conf_libpwrco=\"-lpwr_co\"" >> $cfile echo "export pwre_conf_libpwrco=\"-lpwr_co\"" >> $cfile
echo "export pwre_conf_libpwrrt=\"-lpwr_rt -lpwr_co -lpwr_statussrv -lpwr_msg_dummy\"" >> $cfile echo "export pwre_conf_libpwrrt=\"-lpwr_rt -lpwr_statussrv -lpwr_co -lpwr_msg_dummy\"" >> $cfile
echo "export pwre_conf_libpwrdtt=\"-lpwr_dtt\"" >> $cfile echo "export pwre_conf_libpwrdtt=\"-lpwr_dtt\"" >> $cfile
echo "export pwre_conf_libpwrotherio=\"-lpwr_usbio_dummy -lpwr_usb_dummy\"" >> $cfile echo "export pwre_conf_libpwrotherio=\"-lpwr_usbio_dummy -lpwr_usb_dummy\"" >> $cfile
echo "export pwre_conf_libpwrxtt=\"-lpwr_xtt -lpwr_ge -lpwr_cow -lpwr_flow -lpwr_glow\"" >> $cfile echo "export pwre_conf_libpwrxtt=\"-lpwr_xtt -lpwr_ge -lpwr_cow -lpwr_flow -lpwr_glow\"" >> $cfile
......
...@@ -331,7 +331,7 @@ echo "export wb_rtt=\$pwr_exe/wb_rtt" >> $cfile ...@@ -331,7 +331,7 @@ echo "export wb_rtt=\$pwr_exe/wb_rtt" >> $cfile
echo "export pwre_conf_cc_define=\"$conf_cc_define\"" >> $cfile echo "export pwre_conf_cc_define=\"$conf_cc_define\"" >> $cfile
echo "export pwre_conf_libpwrco=\"-lpwr_co\"" >> $cfile echo "export pwre_conf_libpwrco=\"-lpwr_co\"" >> $cfile
echo "export pwre_conf_libpwrrt=\"-lpwr_rt -lpwr_co -lpwr_statussrv -lpwr_msg_dummy\"" >> $cfile echo "export pwre_conf_libpwrrt=\"-lpwr_rt -lpwr_statussrv -lpwr_co -lpwr_msg_dummy\"" >> $cfile
echo "export pwre_conf_libpwrdtt=\"-lpwr_dtt\"" >> $cfile echo "export pwre_conf_libpwrdtt=\"-lpwr_dtt\"" >> $cfile
echo "export pwre_conf_libpwrotherio=\"-lpwr_usbio_dummy -lpwr_usb_dummy\"" >> $cfile echo "export pwre_conf_libpwrotherio=\"-lpwr_usbio_dummy -lpwr_usb_dummy\"" >> $cfile
echo "export pwre_conf_libpwrxtt=\"-lpwr_xtt -lpwr_ge -lpwr_cow -lpwr_flow -lpwr_glow\"" >> $cfile echo "export pwre_conf_libpwrxtt=\"-lpwr_xtt -lpwr_ge -lpwr_cow -lpwr_flow -lpwr_glow\"" >> $cfile
......
...@@ -271,7 +271,7 @@ done ...@@ -271,7 +271,7 @@ done
echo "export pwre_conf_cc_define=\"$conf_cc_define\"" >> $cfile echo "export pwre_conf_cc_define=\"$conf_cc_define\"" >> $cfile
echo "export pwre_conf_libpwrco=\"-lpwr_co\"" >> $cfile echo "export pwre_conf_libpwrco=\"-lpwr_co\"" >> $cfile
echo "export pwre_conf_libpwrrt=\"-lpwr_rt -lpwr_co -lpwr_statussrv -lpwr_msg_dummy\"" >> $cfile echo "export pwre_conf_libpwrrt=\"-lpwr_rt -lpwr_statussrv -lpwr_co -lpwr_msg_dummy\"" >> $cfile
echo "export pwre_conf_libpwrotherio=\"-lpwr_usbio_dummy -lpwr_usb_dummy\"" >> $cfile echo "export pwre_conf_libpwrotherio=\"-lpwr_usbio_dummy -lpwr_usb_dummy\"" >> $cfile
echo "export pwre_conf_libpwrxtt=\"-lpwr_xtt -lpwr_ge -lpwr_cow -lpwr_flow -lpwr_glow\"" >> $cfile echo "export pwre_conf_libpwrxtt=\"-lpwr_xtt -lpwr_ge -lpwr_cow -lpwr_flow -lpwr_glow\"" >> $cfile
echo "export pwre_conf_libpwrxttgtk=\" -lpwr_xtt_gtk -lpwr_ge_gtk -lpwr_cow_gtk -lpwr_flow_gtk -lpwr_glow_gtk\"" >> $cfile echo "export pwre_conf_libpwrxttgtk=\" -lpwr_xtt_gtk -lpwr_ge_gtk -lpwr_cow_gtk -lpwr_flow_gtk -lpwr_glow_gtk\"" >> $cfile
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment