pvaTestClient: simple blocking get/rpc
This commit is contained in:
@ -9,6 +9,8 @@ TESTPROD_HOST += putme
|
||||
TESTPROD_HOST += monitorme
|
||||
TESTPROD_HOST += spamme
|
||||
|
||||
TESTPROD_HOST += miniget
|
||||
|
||||
include $(TOP)/configure/RULES
|
||||
#----------------------------------------
|
||||
# ADD RULES AFTER THIS LINE
|
||||
|
32
examples/miniget.cpp
Normal file
32
examples/miniget.cpp
Normal file
@ -0,0 +1,32 @@
|
||||
/*
|
||||
* Copyright information and license terms for this software can be
|
||||
* found in the file LICENSE that is included with the distribution
|
||||
*/
|
||||
// The simplest possible PVA get
|
||||
|
||||
#include <iostream>
|
||||
|
||||
#include "pv/clientFactory.h"
|
||||
#include "pv/pvaTestClient.h"
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
try {
|
||||
if(argc<=1) {
|
||||
std::cerr<<"Usage: "<<argv[0]<<" <pvname>\n";
|
||||
return 1;
|
||||
}
|
||||
|
||||
epics::pvAccess::ClientFactory::start();
|
||||
|
||||
TestClientProvider provider("pva");
|
||||
|
||||
TestClientChannel channel(provider.connect(argv[1]));
|
||||
|
||||
std::cout<<channel.name()<<" : "<<channel.get()<<"\n";
|
||||
|
||||
}catch(std::exception& e){
|
||||
std::cerr<<"Error: "<<e.what()<<"\n";
|
||||
return 1;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user