Add example of record which supports RPC and a client
Record has x and y-coordinate fields and a timestamp and also provides a service which sets (x,y) to a sequence of values. An RPC client application (move) sends positions as an array.
This commit is contained in:
41
exampleRPC/ioc/src/Makefile
Normal file
41
exampleRPC/ioc/src/Makefile
Normal file
@@ -0,0 +1,41 @@
|
||||
TOP=../..
|
||||
|
||||
include $(TOP)/configure/CONFIG
|
||||
#----------------------------------------
|
||||
# ADD MACRO DEFINITIONS AFTER THIS LINE
|
||||
#=============================
|
||||
|
||||
#==================================================
|
||||
# Build an IOC support library
|
||||
#
|
||||
|
||||
DBD += exampleRPC.dbd
|
||||
|
||||
#=============================
|
||||
# build an ioc application
|
||||
|
||||
PROD_IOC += exampleRPC
|
||||
|
||||
|
||||
# <name>_registerRecordDeviceDriver.cpp will be created from <name>.dbd
|
||||
exampleRPC_SRCS += exampleRPC_registerRecordDeviceDriver.cpp
|
||||
exampleRPC_SRCS_DEFAULT += exampleRPCMain.cpp
|
||||
exampleRPC_SRCS_vxWorks += -nil-
|
||||
|
||||
|
||||
# The following adds support from base/src/vxWorks
|
||||
exampleRPC_OBJS_vxWorks += $(EPICS_BASE_BIN)/vxComLibrary
|
||||
|
||||
exampleRPC_LIBS += exampleRPC
|
||||
exampleRPC_LIBS += pvDatabase
|
||||
exampleRPC_LIBS += pvaSrv
|
||||
exampleRPC_LIBS += pvAccess
|
||||
exampleRPC_LIBS += pvData
|
||||
exampleRPC_LIBS += $(EPICS_BASE_IOC_LIBS)
|
||||
|
||||
#===========================
|
||||
|
||||
include $(TOP)/configure/RULES
|
||||
#----------------------------------------
|
||||
# ADD RULES AFTER THIS LINE
|
||||
|
||||
6
exampleRPC/ioc/src/exampleRPCInclude.dbd
Normal file
6
exampleRPC/ioc/src/exampleRPCInclude.dbd
Normal file
@@ -0,0 +1,6 @@
|
||||
include "base.dbd"
|
||||
include "PVAClientRegister.dbd"
|
||||
include "PVAServerRegister.dbd"
|
||||
include "registerChannelProviderLocal.dbd"
|
||||
include "dbPv.dbd"
|
||||
include "exampleRPC.dbd"
|
||||
31
exampleRPC/ioc/src/exampleRPCMain.cpp
Normal file
31
exampleRPC/ioc/src/exampleRPCMain.cpp
Normal file
@@ -0,0 +1,31 @@
|
||||
/* exampleRPCMain.cpp */
|
||||
/**
|
||||
* Copyright - See the COPYRIGHT that is included with this distribution.
|
||||
* EPICS pvData is distributed subject to a Software License Agreement found
|
||||
* in file LICENSE that is included with this distribution.
|
||||
*/
|
||||
/**
|
||||
* @author mrk
|
||||
* @date 2013.07.24
|
||||
*/
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdlib.h>
|
||||
#include <stddef.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "epicsExit.h"
|
||||
#include "epicsThread.h"
|
||||
#include "iocsh.h"
|
||||
|
||||
int main(int argc,char *argv[])
|
||||
{
|
||||
if(argc>=2) {
|
||||
iocsh(argv[1]);
|
||||
epicsThreadSleep(.2);
|
||||
}
|
||||
iocsh(NULL);
|
||||
epicsExit(0);
|
||||
return(0);
|
||||
}
|
||||
Reference in New Issue
Block a user