GLAST/LAT > DAQ and FSW > FSW > Doxygen Index > CTDB / V5-5-3

Constituent: co1553_bc_sim     Tag: mv2304


Interface   Data Structures   File List   Data Fields   Globals  

CO1553_bc_sim.c File Reference

Function definitions for 1553 bus controller simulator. More...

#include "string.h"
#include "stdlib.h"
#include "unistd.h"
#include "errno.h"
#include "ctype.h"
#include "netinet/in.h"
#include "sys/socket.h"
#include "arpa/inet.h"
#include "netdb.h"
#include "CTDB/CO1553_bc_sim.h"
#include "CTDB/CO1553_util.h"
#include "CCSDS/CCSDS_pkt.h"
#include "CCSDS/CCSDS_swap.h"
#include "PBS/FPA.h"
#include "PBS/MBA.h"
#include "MSG/MSG_pubdefs.h"
#include "CO1553_bc_sim_private.h"

Include dependency graph for CO1553_bc_sim.c:


Simulator Control Functions

unsigned int CO1553_bcSimSizeof (void)
 Get the size of a bus controller simulator descriptor.
CO1553_BC_SimCO1553_bcSimGet (void)
 Get a pointer to the bus controller simulator static descriptor.
unsigned int CO1553_bcSimInit (CO1553_BC_Sim *bc, const CO1553_BC_Sim_Config *simConfig, const char *rtAddr)
 Intialize a 1553 bus controller simulator.
unsigned int CO1553_bcSimExit (CO1553_BC_Sim *bc)
 Shutdown a 1553 bus controller simulator.
unsigned int CO1553_bcSimStart (CO1553_BC_Sim *bc)
 Start the bus controller simulator sending 1553 bus commands.
unsigned int CO1553_bcSimStop (CO1553_BC_Sim *bc)
 Stop the bus controller simulator sending 1553 bus commands.

Packet Queue Functions

unsigned int CO1553_bcSimPktCmdRxSend (CO1553_BC_Sim *bc, void *pkt)
 Send a CCSDS telecommand receive packet.
unsigned int CO1553_bcSimPktTelemRecv (CO1553_BC_Sim *bc, void **pkt)
 Receive a CCSDS telemetry packet.
unsigned int CO1553_bcSimPktTelemFree (CO1553_BC_Sim *bc, void *pkt)
 Free a CCSDS telemetry packet buffer.
unsigned int CO1553_bcSimPktCmdTxRecv (CO1553_BC_Sim *bc, void **pkt)
 Receive a CCSDS telecommand transmit packet.
unsigned int CO1553_bcSimPktCmdTxFree (CO1553_BC_Sim *bc, void *pkt)
 Free a CCSDS telecommand transmit packet buffer.

Functions

static unsigned int CO1553_bcSimSockRead (int sock, unsigned char *buf, unsigned int size)
static unsigned int CO1553_bcSimSockWrite (int sock, unsigned char *buf, unsigned int size)

Variables

static CO1553_BC_Sim simDesc

Detailed Description

Function definitions for 1553 bus controller simulator.

Author:
D.L. Wood

Function Documentation

unsigned int CO1553_bcSimExit CO1553_BC_Sim bc  ) 
 

Shutdown a 1553 bus controller simulator.

Disconnects the bus controller simulator and releases system resources claimed by the simulator.

Parameters:
bc A device descriptor.
Returns:
A CTDB MSG code.

CO1553_BC_Sim * CO1553_bcSimGet void   ) 
 

Get a pointer to the bus controller simulator static descriptor.

Returns a pointer to a static instance of the simulator descriptor. This pointer may be passed in as the first paramter to all of the other simulator functions. CO1553_bcSimInit() must be called before use.

Returns:
A pointer to the BC simulator descriptor.

unsigned int CO1553_bcSimInit CO1553_BC_Sim bc,
const CO1553_BC_Sim_Config simConfig,
const char *  rtAddr
 

Intialize a 1553 bus controller simulator.

Intializes the bus controller simulator descriptor and simlator software.

Parameters:
bc An uninitialized simlator descriptor.
simConfig The configuration values for the simulator.
rtAddr The name or dot numerical IP address of the RT simulator node.
Returns:
A CTDB MSG code.

unsigned int CO1553_bcSimPktCmdRxSend CO1553_BC_Sim bc,
void *  pkt
 

Send a CCSDS telecommand receive packet.

Places a CCSDS telecommand receive packet on the bus controller output queue. The packet will be sent when bandwidth becomes available.

Parameters:
bc A device descriptor.
pkt A pointer to the packet to send. The packet buffer should start with a properly formatted CCSDS packet header.
Returns:
A CTDB MSG code.

unsigned int CO1553_bcSimPktCmdTxFree CO1553_BC_Sim bc,
void *  pkt
 

Free a CCSDS telecommand transmit packet buffer.

Returns a telecommand transmit packet buffer to the simulator.

Parameters:
bc A device descriptor.
pkt The telecommand packet buffer.
Returns:
A CTDB MSG code.

unsigned int CO1553_bcSimPktCmdTxRecv CO1553_BC_Sim bc,
void **  pkt
 

Receive a CCSDS telecommand transmit packet.

Waits for a new CCSDS telecommand transmit packet on the bus controller input queue. The function will place a pointer to the new packet in pkt. Call CO1553_bcSimPktCmdTxFree() to return the packet buffer to the simulator.

Parameters:
bc A simulator descriptor.
pkt Holds the telecommand packet pointer.
Returns:
A CTDB MSG code.

unsigned int CO1553_bcSimPktTelemFree CO1553_BC_Sim bc,
void *  pkt
 

Free a CCSDS telemetry packet buffer.

Returns a telemetry packet buffer to the simulator.

Parameters:
bc A device descriptor.
pkt The telemetry packet buffer.
Returns:
A CTDB MSG code.

unsigned int CO1553_bcSimPktTelemRecv CO1553_BC_Sim bc,
void **  pkt
 

Receive a CCSDS telemetry packet.

Waits for a new CCSDS telemetry packet on the bus controller input queue. The function will place a pointer to the new packet in pkt. Call CO1553_bcSimPktTelemFree() to return the packet buffer to the simulator.

Parameters:
bc A simulator descriptor.
pkt Holds the telemetry packet pointer.
Returns:
A CTDB MSG code.

unsigned int CO1553_bcSimSizeof void   ) 
 

Get the size of a bus controller simulator descriptor.

Returns the size of a Summit bus controller simulator descriptor. The user is responsible for allocating this memory before calling SUMT_bcSimInit().

This function is obsolete. Use CO1553_bcSimGet() to provide an instance of the simulator descriptor instead.

Returns:
The size in bytes of the simulator descriptor.

static unsigned int CO1553_bcSimSockRead int  sock,
unsigned char *  buf,
unsigned int  size
[static]
 

Reads a packet buffer from a socket.

Parameters:
sock The socket to write to.
buf The packet buffer.
size The packet size.
Returns:
A CTDB MSG code.

static unsigned int CO1553_bcSimSockWrite int  sock,
unsigned char *  buf,
unsigned int  size
[static]
 

Writes a packet buffer to a socket.

Parameters:
sock The socket to write to.
buf The packet buffer.
size The packet size.
Returns:
A CTDB MSG code.

unsigned int CO1553_bcSimStart CO1553_BC_Sim bc  ) 
 

Start the bus controller simulator sending 1553 bus commands.

Starts the bus controller sending commands on the bus for the remote terminal. For the simulator, the bus controller TCP client connects to the subaddress sockets.

Parameters:
bc A simultator descriptor.
Returns:
A CTDB MSG code.

unsigned int CO1553_bcSimStop CO1553_BC_Sim bc  ) 
 

Stop the bus controller simulator sending 1553 bus commands.

Stops the bus controller sending commands on the bus for the remote terminal. For the simulator, the bus controller TCP client disconnects from the RT server.

Parameters:
bc A simultator descriptor.
Returns:
A CTDB MSG code.


Variable Documentation

simDesc [static]
 

An instance of the simulator descriptor; used for CO1553_bcSimGet().


Generated on Mon Nov 14 21:54:02 2005 by  doxygen 1.4.4