86 while ((opt =
getopt(argc, argv,
":hvVM:r:w:p:ds:a:")) != -1) {
96 fprintf(
stdout,
"pvAccess %u.%u.%u%s\n",
97 EPICS_PVA_MAJOR_VERSION,
98 EPICS_PVA_MINOR_VERSION,
99 EPICS_PVA_MAINTENANCE_VERSION,
100 (EPICS_PVA_DEVELOPMENT_FLAG)?
"-SNAPSHOT":
"");
101 fprintf(
stdout,
"pvData %u.%u.%u%s\n",
102 EPICS_PVD_MAJOR_VERSION,
103 EPICS_PVD_MINOR_VERSION,
104 EPICS_PVD_MAINTENANCE_VERSION,
105 (EPICS_PVD_DEVELOPMENT_FLAG)?
"-SNAPSHOT":
"");
106 fprintf(
stdout,
"Base %s\n", EPICS_VERSION_FULL);
111 if(strcmp(
optarg,
"raw")==0) {
112 outmode = pvd::PVStructure::Formatter::Raw;
113 }
else if(strcmp(
optarg,
"nt")==0) {
114 outmode = pvd::PVStructure::Formatter::NT;
115 }
else if(strcmp(
optarg,
"json")==0) {
116 outmode = pvd::PVStructure::Formatter::JSON;
119 outmode = pvd::PVStructure::Formatter::Raw;
127 fprintf(
stderr,
"'%s' is not a valid timeout value " 148 args.push_back(parseArg(
optarg));
149 }
catch(std::exception& e){
150 std::cerr<<
"Error parsing argument '"<<
optarg<<
"'\n";
156 "Unrecognized option: '-%c'. ('" EXECNAME " -h' for help.)\n",
161 "Option '-%c' requires an argument. ('" EXECNAME " -h' for help.)\n",
172 }
else if (argc <=
optind) {
173 fprintf(
stderr,
"No pv name specified. ('pvput -h' for help.)\n");
182 args.push_back(parseArg(argv[
i]));
183 }
catch(std::exception& e){
184 std::cerr<<
"Error parsing argument '"<<
optarg<<
"'\n";
189 pvd::PVStructure::shared_pointer pvRequest;
192 }
catch(std::exception& e){
193 fprintf(
stderr,
"failed to parse request string: %s\n", e.what());
200 builder = builder->setId(
"epics:nt/NTURI:1.0")
204 ->addNestedStructure(
"query");
206 for(args_t::const_iterator it(args.begin()), end(args.end()); it!=end; ++it) {
207 builder = builder->add(it->first, it->second->getField());
211 ->createStructure());
218 for(args_t::const_iterator it(args.begin()), end(args.end()); it!=end; ++it) {
219 query->getSubFieldT(it->first)->copy(*it->second);
224 std::cout<<
"# Argument\n"<<argument->stream().format(
outmode);
230 pvd::PVStructure::const_shared_pointer ret;
234 std::cerr<<
"Timeout\n";
236 }
catch(std::exception& e) {
237 std::cerr<<
"Error: "<<e.what()<<
"\n";
242 std::cout<<
"# Result\n";
244 std::cout<<ret->stream().format(
outmode);
247 }
catch(std::exception& e) {
248 std::cerr<<
"Error: "<<e.what()<<
"\n";
Thrown by blocking methods of ClientChannel on operation timeout.
int getopt(int nargc, char *const *nargv, const char *ostr)
std::tr1::shared_ptr< detail::SharedPut > put
Operation rpc(GetCallback *cb, const epics::pvData::PVStructure::const_shared_pointer &arguments, epics::pvData::PVStructure::const_shared_pointer pvRequest=epics::pvData::PVStructure::const_shared_pointer())
pvd::StructureConstPtr type
std::tr1::shared_ptr< const Structure > StructureConstPtr
#define epicsScanDouble(str, to)
std::tr1::shared_ptr< FieldBuilder > FieldBuilderPtr
PVStructure::shared_pointer createRequest(std::string const &request)
PVString is special case, since it implements SerializableArray.
Data interface for a structure,.
FORCE_INLINE const FieldCreatePtr & getFieldCreate()
std::tr1::shared_ptr< PVStructure > PVStructurePtr
std::string defaultProvider
pvd::PVStructure::Formatter::format_t outmode
FORCE_INLINE const PVDataCreatePtr & getPVDataCreate()