Go to the documentation of this file.00001
00002
00003
00004 #include <stddef.h>
00005 #include <stdlib.h>
00006 #include <stddef.h>
00007 #include <string.h>
00008 #include <stdio.h>
00009
00010 #include "epicsThread.h"
00011 #include "iocsh.h"
00012
00013
00014
00015 extern "C" void Shutdown();
00016 extern "C" void SetSigShutdownHandler();
00017
00018 int main(int argc,char *argv[])
00019 {
00020 int i, j;
00021 extern short DEBUG;
00022 short daemon;
00023 char stcmd[256];
00024 #if 0
00025 char *str;
00026 int crnlen;
00027 char crname[32], craddr[32];
00028 #else
00029 short naddr;
00030 char straddr[32][255];
00031 #endif
00032
00033
00034 SetSigShutdownHandler();
00035
00036 daemon = 0;
00037 if(argc>=2) {
00038 snprintf( stcmd, 255, "%s", argv[1]);
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104 }
00105 else
00106 {
00107 printf( "Syntax: hvcontrol <st.cmd> [-c <name>@<hostname>[:<slotlist>]] [-d] [-D <debuglevel>]\n");
00108 printf( " where <slotlist> = comma and dash separated list of slots.\n");
00109 printf( " -d = run in daemon mode\n");
00110 printf( " <debuglevel> = 0 no messages\n");
00111 printf( " <debuglevel> = 10 all available messages\n");
00112 }
00113
00114 if(stcmd)
00115 iocsh(stcmd);
00116
00117 if( daemon)
00118 {
00119 for(;;)
00120 epicsThreadSleep(1.0);
00121 }
00122 else
00123 iocsh(NULL);
00124
00125 Shutdown();
00126
00127 return(0);
00128 }