GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> CTDB / V5-5-6 > co1553_rt_sim / rad750


Interface   Data Structures   File List   Data Fields   Globals  

CTDB_rt_sim.c File Reference

Functions to implement general CTDB RT interface for 1553 simulator. More...

#include <string.h>
#include <CTDB/CTDB_rt.h>
#include <CTDB/CO1553_rt_sim.h>
#include <MSG/MSG_pubdefs.h>

Functions

Control Functions


unsigned int CTDB_rtSizeof (void)
 Get the size of a remote terminal interface descriptor.
void * CTDB_rtGet (void)
 Get a pointer to the remote terminal interface static descriptor.
unsigned int CTDB_rtExit (void *rt)
 Shutdown a 1553 remote terminal interface.
unsigned int CTDB_rtStart (void *rt)
 Start the remote terminal listening for 1553 bus commands.
unsigned int CTDB_rtStop (void *rt)
 Stop the remote terminal listening for 1553 bus commands.
unsigned int CTDB_rtHkpSet (void *rt, CTDB_RT_Hkp_Handler *hkpHandler, void *hkpArg)
 Change the HKP application callback.
unsigned int CTDB_rtHkpGet (void *rt, CTDB_RT_Hkp_Handler **hkpHandler, void **hkpArg)
 Get current HKP application callback information.
Packet Queue Functions


unsigned int CTDB_rtPktTelemSend (void *rt, void *pkt, CTDB_RT_Pkt_Free *freeHandler, void *freeArg, CTDB_RT_Priority priority, const TOC *timeout)
 Send a CCSDS telemetry packet.
unsigned int CTDB_rtPktCmdTxSend (void *rt, void *pkt, CTDB_RT_Pkt_Free *freeHandler, void *freeArg, const TOC *timeout)
 Send a CCSDS telecommand transmit packet.
unsigned int CTDB_rtPktCmdRxRecv (void *rt, void **pkt, const TOC *timeout)
 Receive a CCSDS telecommand receive packet.
unsigned int CTDB_rtPktCmdRxFree (void *rt, void *pkt)
 Free a CCSDS telecommand receive packet buffer.
Diagnostics Functions


unsigned int CTDB_rtDiagGet (void *rt, CTDB_RT_Diag *diag)
 Read the diagnostics information.
unsigned int CTDB_rtDiagClear (void *rt)
 Clear the diagnostics information.


Detailed Description

Functions to implement general CTDB RT interface for 1553 simulator.

Author:
D.L. Wood

Function Documentation

unsigned int CTDB_rtDiagClear ( void *  rt  ) 

Clear the diagnostics information.

Sets to zero the current diagnostics counter values.

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

unsigned int CTDB_rtDiagGet ( void *  rt,
CTDB_RT_Diag diag 
)

Read the diagnostics information.

Places the current diagnostics counter values into diag.

Parameters:
rt A device descriptor.
diag Contains diagnostics info upon return.
Returns:
A CTDB MSG code.

unsigned int CTDB_rtExit ( void *  rt  ) 

Shutdown a 1553 remote terminal interface.

Disconnects the remote terminal and releases system resources.

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

References CO1553_rtSimExit().

void * CTDB_rtGet ( void   ) 

Get a pointer to the remote terminal interface static descriptor.

Returns a pointer to a static instance of the interface descriptor. This pointer may be passed in as the first paramter to all of the other interface functions. The device-specific intialization function must be called before use.

Returns:
A pointer to the RT interface descriptor.

References CO1553_rtSimGet().

unsigned int CTDB_rtHkpGet ( void *  rt,
CTDB_RT_Hkp_Handler **  hkpHandler,
void **  hkpArg 
)

Get current HKP application callback information.

Retrieves the HKP application callback function and arguments current values.

Parameters:
rt A device descriptor.
hkpHandler Stores the pointer to the application HKP function.
hkpArg Stores user argument for hkpHandler.
Returns:
A CTDB MSG code.

References CO1553_rtSimHkpGet().

unsigned int CTDB_rtHkpSet ( void *  rt,
CTDB_RT_Hkp_Handler hkpHandler,
void *  hkpArg 
)

Change the HKP application callback.

Changes the HKP application callback function and arguments to new values.

Parameters:
rt A device descriptor.
hkpHandler The synchronous callback to handle insertion of HKP telemety packets into the telemetry blocks.
hkpArg A user argument for hkpHandler.
Returns:
A CTDB MSG code.

References CO1553_rtSimHkpSet().

int CTDB_rtPktCmdRxFree ( void *  rt,
void *  pkt 
)

Free a CCSDS telecommand receive packet buffer.

Returns a CCSDS telecommand input packet buffer to the interface.

Parameters:
rt A device descriptor.
pkt A pointer to the packet buffer to free.
Returns:
A CTDB MSG code.

References CO1553_rtSimPktCmdRxFree().

int CTDB_rtPktCmdRxRecv ( void *  rt,
void **  pkt,
const TOC *  timeout 
)

Receive a CCSDS telecommand receive packet.

Waits for a new CCSDS telecommand receive packet on the remote terminal input queue. The function will place a pointer to the new packet buffer in pkt.

Parameters:
rt A device descriptor.
pkt Holds a pointer to the telecommand packet.
timeout The time to wait for a packet on the queue. This value is ignored for the simulator implementation.
Returns:
A CTDB MSG code.

References CO1553_rtSimPktCmdRxRecv().

nt CTDB_rtPktCmdTxSend ( void *  rt,
void *  pkt,
CTDB_RT_Pkt_Free freeHandler,
void *  freeArg,
const TOC *  timeout 
)

Send a CCSDS telecommand transmit packet.

Places a CCSDS telecommand packet on the remote terminal output queue. The packet will be sent when bandwidth becomes available.

Parameters:
rt A device descriptor.
pkt A pointer to the packet to send. The packet buffer should start with a properly formatted CCSDS packet header.
freeHandler The function to be called after the packet has been sent.
freeArg A user argument to be passed to the freeHandler function.
timeout The time to wait for a packet on the queue. This value is ignored for the simulator implementation.
Returns:
A CTDB MSG code.

References CO1553_rtSimPktCmdTxSend().

unsigned int CTDB_rtPktTelemSend ( void *  rt,
void *  pkt,
CTDB_RT_Pkt_Free freeHandler,
void *  freeArg,
CTDB_RT_Priority  priority,
const TOC *  timeout 
)

Send a CCSDS telemetry packet.

Places a CCSDS telemetry packet on the remote terminal output queue. The packet will be sent when bandwidth becomes available.

Parameters:
rt A device descriptor.
pkt A pointer to the packet to send. The packet buffer should start with a properly formatted CCSDS packet header.
freeHandler The function to be called after the packet has been sent.
freeArg A user argument to be passed to the freeHandler function.
priority The priority of the packet: CTDB_RT_PRIORITY_HIGH or CTDB_RT_PRIORITY_LOW.
timeout The time to wait for a packet on the queue. This value is ignored for the simulator implementation.
Returns:
A CTDB MSG code.

References CO1553_rtSimPktTelemSend().

unsigned int CTDB_rtSizeof ( void   ) 

Get the size of a remote terminal interface descriptor.

Returns the size of a remote terminal descriptor.

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

Returns:
The size in bytes of the descriptor.

References CO1553_rtSimSizeof().

unsigned int CTDB_rtStart ( void *  rt  ) 

Start the remote terminal listening for 1553 bus commands.

Starts the remote terminal listening on the 1553 bus for commands from the bus controller.

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

References CO1553_rtSimStart().

unsigned int CTDB_rtStop ( void *  rt  ) 

Stop the remote terminal listening for 1553 bus commands.

Stops the remote terminal from listening on the 1553 bus for commands from the bus controller.

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

References CO1553_rtSimStop().


Generated on Wed Nov 21 20:04:10 2012 by  doxygen 1.5.8