GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> CPU_DB / V0-4-4 > cpu_db_server / rad750


Interface   Data Structures   File List   Data Fields   Globals  

CPU_DB_serial.c File Reference

Serial number facilities. More...

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <CPU_DB/CPU_DB_msgs.h>
#include <CPU_DB/CPU_DB_pubdefs.h>
#include <MDB/MDB_pubdefs.h>
#include <CPU_DB_prvdefs.h>
#include <CPU_DB_serial.c.ux-xxx-xxx>

Functions

unsigned int CPU_DB_getEBM ()
 Return the address of this CPU on the EBM.
unsigned int CPU_DB_getInstrument ()
 Return the instrument ID of this CPU.
unsigned int CPU_DB_getNode ()
 Return the ITC node of this CPU.
unsigned int CPU_DB_getSerial ()
 Return the (compound) CPU serial number.
unsigned int CPU_DB_getSN ()
 Return the "trivial" (simple) CPU serial number.
unsigned int CPU_DB_reportOnce ()
 Report the result of setting up the CPU serial numbers.
void CPU_DB_setSerial (unsigned char ser[4])
 Set the serial number based on the decoded elements.

Variables

unsigned int CPU_DB_msgCode
 Message code (most recent message).
char CPU_DB_msgText [CPU_DB_L_MSG_TEXT]
 Message text (most recent message).
static unsigned int CPU_DB_serial
 CPU (compound) serial number.
static CPU_DB_Bounds bounds [4]
 Boundary conditions on elements of the serial number.
static const char * s_cpu [4] = { "SIU", "EPU0", "EPU1", "EPU2" }
 String constants used in error messages.


Detailed Description

Serial number facilities.

CVS $Id: CPU_DB_serial.c,v 1.4 2011/03/25 00:33:37 apw Exp $

Function Documentation

unsigned int CPU_DB_getEBM ( void   ) 

Return the address of this CPU on the EBM.

Return values:
-1 EBM address cannot be determined
x EBM address
CPU_DB_getEBM() returns the EBM address of this CPU.

References CPU_DB_serial.

unsigned int CPU_DB_getInstrument ( void   ) 

Return the instrument ID of this CPU.

Return values:
-1 Instrument cannot be determined
x Instrument
CPU_DB_getInstrument() returns the instrument ID of this CPU.

References CPU_DB_serial.

unsigned int CPU_DB_getNode ( void   ) 

Return the ITC node of this CPU.

Return values:
-1 ITC node cannot be determined
x ITC node
CPU_DB_getNode() returns the CPU's serial number.

References CPU_DB_serial.

unsigned int CPU_DB_getSerial ( void   ) 

Return the (compound) CPU serial number.

Return values:
-1 CPU serial number cannot be determined
0 CPU serial number has not been initialized
x CPU serial number
CPU_DB_setSerial() returns the CPU's full, compound serial number.

References CPU_DB_serial.

Referenced by CPU_DB_reportOnce().

unsigned int CPU_DB_getSN ( void   ) 

Return the "trivial" (simple) CPU serial number.

Return values:
-1 Trivial (simple) CPU serial number cannot be determined
x Trivial (simple) CPU serial number
CPU_DB_getSN() returns the CPU's "trivial" serial number. This is a one byte "trivial" number (in the case of RAD750 it's the manufacturer's production serial number). This should not be confused with the compound serial number (the number returned by CPU_DB_getSerial()), which binds together the CPU's instrument number, EBM address, ITC node, and this "trivial" serial number.

References CPU_DB_serial.

unsigned int CPU_DB_reportOnce ( void   ) 

Report the result of setting up the CPU serial numbers.

Return values:
CPU_DB_SUCCESS Always
CPU_DB_reportOnce() reports the results of setting up the CPU serial number

References CPU_DB_getSerial(), CPU_DB_msgCode, and CPU_DB_msgText.

void CPU_DB_setSerial ( unsigned char  ser[4]  ) 

Set the serial number based on the decoded elements.

Parameters:
ser (in) Serial number elements.
CPU_DB_setSerial() sets the CPU serial number based on the decoded elements given to it. In the case of an ambiguous assignment (classically EBM address 0x21) it will update the serial number according to the CPU_DB database type (SIU of EPU) that's been loaded. Otherwise, any conflicts will result in the CPU serial number being set to -1 (no information).

References CPU_DB_getType(), CPU_DB_msgCode, CPU_DB_msgText, CPU_DB_serial, CPU_DB_TYPE_EPU, CPU_DB_TYPE_SIU, _CPU_DB_Bounds::max, _CPU_DB_Bounds::min, and s_cpu.

Referenced by CPU_DB_initialize().


Variable Documentation

static CPU_DB_Bounds bounds[4] [static]

Initial value:

{
    { CPU_DB_K_SERIAL    , CPU_DB_K_SERIAL     + CPU_DB_L_SERIAL     },
    { CPU_DB_K_ITC       , CPU_DB_K_ITC        + CPU_DB_L_ITC        },
    { CPU_DB_K_EBM       , CPU_DB_K_EBM        + CPU_DB_L_EBM        },
    { CPU_DB_K_INSTRUMENT, CPU_DB_K_INSTRUMENT + CPU_DB_L_INSTRUMENT }
}
Boundary conditions on elements of the serial number.

Referenced by CPU_DB_initialize().


Generated on Wed Nov 21 18:12:11 2012 by  doxygen 1.5.8