#!$(INSTALL)/bin/$(ARCH)/gpibdevice

epicsEnvSet("EPICS_CA_SERVER_PORT","6064")
epicsEnvSet("EPICS_CA_REPEATER_PORT","6065")

cd "$(INSTALL)"

# Load binaries on architectures that need to do so.
# VXWORKS_ONLY, LINUX_ONLY and RTEMS_ONLY are macros that resolve
# to a comment symbol on architectures that are not the current
# build architecture, so they can be used liberally to do architecture
# specific things. Alternatively, you can include an architecture
# specific file.
$(VXWORKS_ONLY)ld < bin/$(ARCH)/gpibdevice.munch

## This drvTS initializer is needed if the IOC has a hardware event system
#TSinit

epicsEnvSet("STREAM_PROTOCOL_PATH", "/home/mp49/epics/support/gpibdevice/data/")

## Register all support components
dbLoadDatabase("dbd/gpibdevice.dbd")
gpibdevice_registerRecordDeviceDriver(pdbbase)

## Load record instances
dbLoadRecords("db/testGpib.db","P=mp49:gpib:,R=Test,PORT=L0,A=12")
dbLoadRecords("db/asynRecord.db","P=mp49:asyn:,R=Record,PORT=L0,ADDR=12,OMAX=0,IMAX=200")
dbLoadRecords("db/ls340.vdb", "P=BL16I-EA-LS340-01")

#The following two commands are for the E5810
E5810Reboot("172.23.116.185",0)

# vxi11Configure parameters:
# portName
# host name
# recover with IFC?
# default timeout
# vxiName
# priority
# disable auto-connect
vxi11Configure("L0","172.23.116.185",0,0.0,"gpib0",0,0)
#asynOctetSetInputEos("L0", 12, "\n")
#asynOctetSetOutputEos("L0", 12, "\n")

#drvAsynIPPortConfigure("L0","172.23.116.185:4002",0,0,0)

###The following two commands are for the E5810 serial port
###E5810Reboot("172.23.116.185",0)
###vxi11Configure("L1","172.23.116.185",0,0.0,"COM1,1",0,0)

###asynSetTraceMask("L0",1,0xff)
###asynSetTraceIOMask("L0",1,0x2)
###asynSetTraceMask("L0",-1,0xff)

iocInit()

