Main Page   Interface   Data Structures   File List   Data Fields   Globals  

IREC.c File Reference

#include "vxWorks.h"
#include "stdlib.h"
#include "stdio.h"
#include "logLib.h"
#include "sigLib.h"
#include "semLib.h"
#include "intLib.h"
#include "iv.h"
#include "ISOMAX/IREC.h"
#include "ISOMAX/ISOMAX.h"
#include "MV2X/ravenDisconnect.h"

Functions

int IREC_init (char *fileName, int mode)
 Initialize application resources. More...

void IREC_exit (int signal)
 Cleaup application resources. More...

void IREC_intHandler (void)
 Frame sync interrupt handler. More...

void IREC (char *fileName, int mode)
 Application main function. More...


Variables

unsigned short IREC_buf [ISOMAX_FIFO_FRAMES][ISOMAX_FRAME_WORDS]
FILE * IREC_out = NULL
char * IREC_outBuf = NULL
SEM_ID IREC_flag

Detailed Description


Function Documentation

void IREC char *    fileName,
int    mode
 

Application main function.

After initialization, runs forever pending on the IREC_flag semaphore. When new data is available, it is written to the IREC_out file. An incorrectly formatted frame will cause the application to halt.

Parameters:
fileName  The name of the output data file.
mode  The ISOMAX operational mode.

void IREC_exit int    signal [static]
 

Cleaup application resources.

This function peforms the following actions to shutdown the application:

  • Disables the ISOMAX board.
  • Closes the BIU_out file.
  • Frees the output file buffer.
  • Deletes the IREC_flag semaphore.
This function is called when signal SIGTERM is sent to the application.
Parameters:
signal  Ignored.

int IREC_init char *    fileName,
int    mode
[static]
 

Initialize application resources.

This function peforms the following actions to setup the application for operation:

Parameters:
fileName  The name of the output data file.
mode  The ISOMAX operational mode.
Return values:
0  Success.
-1  Failure because a resource could not be created or initialized.

void IREC_intHandler void    [static]
 

Frame sync interrupt handler.

This function is attached to the ISOMAX frame sync board receive FIFO half-full interrupt. The newly received data is read into IREC_buf and the condition signalled through IREC_flag.


Variable Documentation

unsigned short IREC_buf[ISOMAX_FIFO_FRAMES][ISOMAX_FRAME_WORDS] [static]
 

Buffer to hold incomming frame data.

SEM_ID IREC_flag [static]
 

Semaphore to signal frame sync FIFO receive condition.

FILE* IREC_out = NULL [static]
 

Descriptor for output data file.

char* IREC_outBuf = NULL [static]
 

Buffer for output file.


Generated on Fri Mar 1 17:16:21 2002 by doxygen1.2.13.1 written by Dimitri van Heesch, © 1997-2001