/*============================================================================= Name: mgntRegister.c mgntRegistrar - registers all "mgnt*" commands with the iocsh Abs: shell commands must be registered before they can be recognized by IOC shell. Registration is achieved by calling a registration function with the appropiate parameters for each command. Auth: 10-Feb-2010, Debbie Rogind (drogind): created -----------------------------------------------------------------------------*/ #include "copyright_SLAC.h" /* SLAC copyright comments */ /*----------------------------------------------------------------------------- Mod: (newest to oldest) =============================================================================*/ #include "debugPrint.h" #ifdef DEBUG_PRINT int mgntRegFlag = DP_DEBUG; #endif /* c library includes */ #include /* epics includes */ #include /* NELEMENTS */ #include /* ioc shell stuff */ #include #include /* for registering mgntfcomInit */ #include "mgntRegister.h" #include "mgntPauUsr.h" /* re-define mgntfcom.h */ /* mgntCreatePau */ static const iocshArg mgntCreatePauArg0 = { "PAU Name", iocshArgString}; static const iocshArg mgntCreatePauArg1 = { "Pipeline Index", iocshArgInt}; static const iocshArg mgntCreatePauArg2 = { "Description", iocshArgString}; static const iocshArg * const mgntCreatePauArgs[3] = {&mgntCreatePauArg0, &mgntCreatePauArg1, &mgntCreatePauArg2}; LOCAL iocshFuncDef mgntCreatePauFuncDef = {"mgntCreatePau", 3, mgntCreatePauArgs}; LOCAL void mgntCreatePauCallFunc(const iocshArgBuf *args) { mgntCreatePau(args[0].sval, args[1].ival, args[2].sval); } /* mgntCreateMux */ static const iocshArg mgntCreateMuxArg0 = { "PAU Name", iocshArgString}; static const iocshArg mgntCreateMuxArg1 = { "Attribute", iocshArgString}; static const iocshArg mgntCreateMuxArg2 = { "Push Function Name", iocshArgString}; static const iocshArg mgntCreateMuxArg3 = { "Pull Function Name", iocshArgString}; static const iocshArg mgntCreateMuxArg4 = { "Description", iocshArgString}; static const iocshArg * const mgntCreateMuxArgs[5] = {&mgntCreateMuxArg0, &mgntCreateMuxArg1, &mgntCreateMuxArg2, &mgntCreateMuxArg3, &mgntCreateMuxArg4}; LOCAL iocshFuncDef mgntCreateMuxFuncDef = {"mgntCreateMux", 5, mgntCreateMuxArgs}; LOCAL void mgntCreateMuxCallFunc(const iocshArgBuf *args) { mgntCreateMux(args[0].sval, args[1].sval, args[2].sval, args[3].sval, args[4].sval); } /* mgntfcomInit */ static const iocshArg mgntfcomInitArg0 = { "IP Addr", iocshArgString}; static const iocshArg * const mgntfcomInitArgs[1] = {&mgntfcomInitArg0}; LOCAL iocshFuncDef mgntfcomInitFuncDef = {"mgntfcomInit", 1, &mgntfcomInitArg0 }; LOCAL void mgntfcomInitCallFunc(const iocshArgBuf *args) { mgntfcomInit(args[0].sval); } /* mgntfcomPVName */ static const iocshArg mgntfcomPVNameArg0 = { "PV Name", iocshArgString}; static const iocshArg * const mgntfcomPVNameArgs[1] = {&mgntfcomPVNameArg0}; LOCAL iocshFuncDef mgntfcomPVNameFuncDef = {"mgntfcomPVName", 1, mgntfcomPVNameArgs }; LOCAL void mgntfcomPVNameCallFunc(const iocshArgBuf *args) { mgntfcomPVName(args[0].sval); } /* mgntfcomStatus */ LOCAL iocshFuncDef mgntfcomStatusFuncDef = {"mgntfcomStatus", 0, NULL }; LOCAL void mgntfcomStatusCallFunc(const iocshArgBuf *args) { mgntfcomStatus(); } LOCAL registryFunctionRef mgntRef[] = { {"mgntCreatePau", (REGISTRYFUNCTION)mgntCreatePau}, {"mgntCreateMux", (REGISTRYFUNCTION)mgntCreateMux}, {"mgntfcomInit", (REGISTRYFUNCTION)mgntfcomInit}, {"mgntfcomStatus",(REGISTRYFUNCTION)mgntfcomStatus}, {"mgntfcomPVName", (REGISTRYFUNCTION)mgntfcomPVName} }; /*============================================================================= Name: mgntRegistrar Abs: add mgntfcomInit and mgntfcomPVName to the function registry Args: none Rem: epics requires global functions to be registered for proper linking Side: Ret: none ==============================================================================*/ void mgntRegistrar(void) { registryFunctionRefAdd(mgntRef,NELEMENTS(mgntRef)); iocshRegister(&mgntCreatePauFuncDef, mgntCreatePauCallFunc); iocshRegister(&mgntCreateMuxFuncDef, mgntCreateMuxCallFunc); iocshRegister(&mgntfcomInitFuncDef, mgntfcomInitCallFunc); iocshRegister(&mgntfcomStatusFuncDef, mgntfcomStatusCallFunc); iocshRegister(&mgntfcomPVNameFuncDef, mgntfcomPVNameCallFunc); } epicsExportRegistrar(mgntRegistrar);