GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> CTDB / V5-5-6 > co1553_bc_sim / rhel6-64


Interface   Data Structures   File List   Data Fields   Globals  

CO1553_bc_sim.h File Reference

1553 Bus Controller Simulator. More...

#include <CTDB/CTDB_msg.h>

Classes

struct  _CO1553_BC_Sim_Config

Typedefs

typedef struct _CO1553_BC_Sim CO1553_BC_Sim
typedef struct
_CO1553_BC_Sim_Config 
CO1553_BC_Sim_Config

Functions

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_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.
unsigned int CO1553_bcSimPktCmdRxSend (CO1553_BC_Sim *bc, void *pkt)
 Send a CCSDS telecommand receive packet.


Detailed Description

1553 Bus Controller Simulator.

Author:
D.L. Wood
This simulator provides a UNIX compatable environment for command and telemetry. TCP/IP sockets are used to simulate the various 1553 subaddress types.

The recognized subaddress types are shown below,

Subaddress Direction Description
Command Receive (CmdRx) Receive (BC->RT) Telecommand input
Command Transmit(CmdTx) Transmit (RT->BC) Telecommand output
Telemetry (Telem) Transmit (RT->BC) Low rate telemetry

The remote terminal simulator acts as the TCP servers. Once started, it waits for connections from the bus controller simulator, which acts as a TCP client. Only one bus controller simulator may connect to the remote terminal simulator at a given time.


Typedef Documentation

The bus controller simulator descriptor.

The typedef for _CO1553_BC_Sim_Config.


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.

References _CO1553_BC_Sim::check, _CO1553_BC_Sim::cmd_tx_fpa, _CO1553_BC_Sim::cmd_tx_pool, CO1553_bcSimStop(), _CO1553_BC_Sim::telem_fpa, and _CO1553_BC_Sim::telem_pool.

Referenced by CTDB_bcExit().

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.

Referenced by CTDB_bcGet().

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.

References _CO1553_BC_Sim::check, _CO1553_BC_Sim_Config::cmd_rx_pkt_size, _CO1553_BC_Sim_Config::cmd_rx_port, _CO1553_BC_Sim::cmd_tx_fpa, _CO1553_BC_Sim_Config::cmd_tx_pkt_size, _CO1553_BC_Sim::cmd_tx_pool, _CO1553_BC_Sim_Config::cmd_tx_port, _CO1553_BC_Sim_Config::cmd_tx_queue_size, _CO1553_BC_Sim::hdr_size_cmd, _CO1553_BC_Sim::hdr_size_telem, _CO1553_BC_Sim::rt_addr, _CO1553_BC_Sim::sim_config, _CO1553_BC_Sim::telem_fpa, _CO1553_BC_Sim_Config::telem_pkt_size, _CO1553_BC_Sim::telem_pool, _CO1553_BC_Sim_Config::telem_port, and _CO1553_BC_Sim_Config::telem_queue_size.

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.

References _CO1553_BC_Sim::check, _CO1553_BC_Sim_Config::cmd_rx_pkt_size, _CO1553_BC_Sim::cmd_rx_sock, CO1553_bcSimSockWrite(), CO1553_MSG_SIZE, _CO1553_BC_Sim::hdr_size_cmd, and _CO1553_BC_Sim::sim_config.

Referenced by CTDB_bcPktCmdRxSend().

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.

References _CO1553_BC_Sim::check, and _CO1553_BC_Sim::cmd_tx_fpa.

Referenced by CTDB_bcPktCmdTxFree().

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.

References _CO1553_BC_Sim::check, _CO1553_BC_Sim::cmd_tx_fpa, _CO1553_BC_Sim_Config::cmd_tx_pkt_size, _CO1553_BC_Sim::cmd_tx_sock, CO1553_bcSimSockRead(), CO1553_MSG_SIZE, _CO1553_BC_Sim::hdr_size_cmd, and _CO1553_BC_Sim::sim_config.

Referenced by CTDB_bcPktCmdTxRecv().

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.

References _CO1553_BC_Sim::check, and _CO1553_BC_Sim::telem_fpa.

Referenced by CTDB_bcPktTelemFree().

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.

References _CO1553_BC_Sim::check, CO1553_bcSimSockRead(), CO1553_MSG_SIZE, _CO1553_BC_Sim::hdr_size_telem, _CO1553_BC_Sim::sim_config, _CO1553_BC_Sim::telem_fpa, _CO1553_BC_Sim_Config::telem_pkt_size, and _CO1553_BC_Sim::telem_sock.

Referenced by CTDB_bcPktTelemRecv().

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.

Referenced by CTDB_bcSizeof().

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.

References _CO1553_BC_Sim::check, _CO1553_BC_Sim_Config::cmd_rx_port, _CO1553_BC_Sim::cmd_rx_sock, _CO1553_BC_Sim_Config::cmd_tx_port, _CO1553_BC_Sim::cmd_tx_sock, _CO1553_BC_Sim::rt_addr, _CO1553_BC_Sim::sim_config, _CO1553_BC_Sim_Config::telem_port, and _CO1553_BC_Sim::telem_sock.

Referenced by CTDB_bcStart().

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.

References _CO1553_BC_Sim::check, _CO1553_BC_Sim::cmd_rx_sock, _CO1553_BC_Sim::cmd_tx_sock, and _CO1553_BC_Sim::telem_sock.

Referenced by CO1553_bcSimExit(), and CTDB_bcStop().


Generated on Tue Nov 29 16:47:44 2011 by  doxygen 1.5.8