11 #include <epicsGetopt.h> 32 fprintf (
stderr,
"\nUsage: pvinfo [options] <PV name>...\n\n" 34 " -h: Help: Print this message\n" 35 " -V: Print version and exit\n" 36 " -w <sec>: Wait time, specifies timeout, default is %f second(s)\n" 37 " -p <provider>: Set default provider name, default is '%s'\n" 38 " -d: Enable debug output\n" 39 " -c: Wait for clean shutdown and report used instance count (for expert users)" 40 "\nExample: pvinfo double01\n\n" 69 peerName = evt.peerName;
84 std::cerr<<op.
name()<<
" Error: "<<evt.message<<
"\n";
88 std::cout<<op.
name()<<
"\n" 89 "Server: "<<pname<<
"\n" 91 pvd::format::indent_scope I(std::cout);
92 std::cout<<evt.type<<
"\n";
103 int main (
int argc,
char *argv[])
110 while ((opt =
getopt(argc, argv,
":hVw:p:dc")) != -1) {
117 fprintf(
stdout,
"pvAccess %u.%u.%u%s\n",
118 EPICS_PVA_MAJOR_VERSION,
119 EPICS_PVA_MINOR_VERSION,
120 EPICS_PVA_MAINTENANCE_VERSION,
121 (EPICS_PVA_DEVELOPMENT_FLAG)?
"-SNAPSHOT":
"");
122 fprintf(
stdout,
"pvData %u.%u.%u%s\n",
123 EPICS_PVD_MAJOR_VERSION,
124 EPICS_PVD_MINOR_VERSION,
125 EPICS_PVD_MAINTENANCE_VERSION,
126 (EPICS_PVD_DEVELOPMENT_FLAG)?
"-SNAPSHOT":
"");
127 fprintf(
stdout,
"Base %s\n", EPICS_VERSION_FULL);
135 fprintf(
stderr,
"'%s' is not a valid timeout value " 136 "- ignored. ('pvget -h' for help.)\n",
optarg);
152 "Unrecognized option: '-%c'. ('pvinfo -h' for help.)\n",
157 "Option '-%c' requires an argument. ('pvinfo -h' for help.)\n",
168 fprintf(
stderr,
"No pv name(s) specified. ('pvinfo -h' for help.)\n");
174 std::vector<std::tr1::shared_ptr<GetInfo> > infos;
176 pva::ca::CAClientFactory::start();
183 std::tr1::shared_ptr<GetInfo> info(
new GetInfo(chan));
184 info->op = chan.
info(info.get());
185 infos.push_back(info);
198 std::cerr<<
"Timeout\n";
205 return haderror ? 1 : 0;
int getopt(int nargc, char *const *nargv, const char *ostr)
static epicsMutex doneLock
int main(int argc, char *argv[])
std::string name() const
Channel name.
#define SET_LOG_LEVEL(level)
static epicsEvent doneEvt
#define epicsScanDouble(str, to)
Handle for in-progress get/put/rpc operation.
Connection state change CB.
Extended replacement for the Posix exit and atexit routines.
information on connect/disconnect
request cancelled before completion
ClientChannel connect(const std::string &name, const ClientChannel::Options &conf=ClientChannel::Options())
request ends in failure. Check message
Operation info(InfoCallback *cb, const std::string &subfld=std::string())
ChannelPut::shared_pointer op
C++ and C descriptions for a thread.
std::string defaultProvider
void removeConnectListener(ConnectCallback *)
Remove from list of listeners.
void addConnectListener(ConnectCallback *)