Skip to content
Snippets Groups Projects
Commit 59605bac authored by zimoch's avatar zimoch
Browse files

put here from utilities

these are EPICS dependend, utilities not
parent 35eaf82d
No related branches found
No related tags found
No related merge requests found
include /ioc/tools/driver.makefile
/* bootNotify.c
*
* call a script on the boot PC and give it a lot of boot infos
*
* $Author: zimoch $
*
* $Log: bootNotify.c,v $
* Revision 1.1 2004/04/16 08:07:12 zimoch
* put here from utilities
* these are EPICS dependend, utilities not
*
* Revision 1.4 2004/04/02 14:52:15 zimoch
* generic ethernet address support added
*
* Revision 1.3 2003/03/20 14:57:50 zimoch
* upload of ethernet address added
*
* Revision 1.2 2003/03/18 08:03:28 zimoch
* debugged
*
* Revision 1.1 2003/02/18 17:26:59 zimoch
* split bootUntil.c into 3 parts
*
*
*/
#include <stdio.h>
#include <bootInfo.h>
#include <rsh.h>
#include <version.h>
extern char* epicsRelease1;
int bootNotify (char* script, char* script2)
{
char command[256];
char epicsver[15];
if (script == NULL)
{
printErr ("usage: bootNotify [\"<path>\",] \"<script>\"\n");
return ERROR;
}
if (script2)
{
sprintf (command, "%s/%s", script, script2);
}
else
{
sprintf (command, "%s", script);
}
sscanf (epicsRelease1, "@(#)Version R%s", epicsver);
return rsh (bootHost(), command, bootInfo("%T %e %n %d %F %s"),
vxWorksVersion, epicsver, etherAddr((char *)1), 0);
}
/* subroutine for checking the status of an IOC
*
* This subroutine assumes the following use of the subroutine record inputs:
*
* VAL : ioc health status: 1= ok; 0 = bad
* A : if set, subroutine will clear bad status and reset A. (used if task is restarted)
*/
/* mods ...
*
* 06/17/94 nda initial coding. Simply checks all tasks monitored by watchdog
*
*/
#include <vxWorks.h>
#include <stdlib.h>
#include <stdio.h>
#include <vme.h>
#include <dbDefs.h>
#include <subRecord.h>
#include <taskwd.h>
void taskFault();
long iocStatus;
long iocCheckInit(psub)
struct subRecord *psub;
{
long ret = 0;
taskwdAnyInsert(NULL, taskFault, NULL);
iocStatus = 1; /* assume OK during init */
psub->val = iocStatus;
return(ret);
}
long iocCheck(psub)
struct subRecord *psub;
{
short a;
a=psub->a;
/* if a is set, make status = OK, reset a */
if(a) {
iocStatus = 1;
psub->a = 0;
}
psub->val = iocStatus;
return(0);
}
void taskFault(userarg)
VOID *userarg;
{
iocStatus = 0;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment