GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> LIM / V1-22-4 > lim / mv2304
#include <string.h>
#include <CCSDS/CCSDS_pkt.h>
#include <ITC/ITC_drvdefs.h>
#include <ITC/ITC_pubdefs.h>
#include <LIM/LIM_msgs.h>
#include <LIM/LIM_pubdefs.h>
#include <MSG/MSG_pubdefs.h>
#include <PBS/MBA.h>
#include <PBS/WCT.h>
#include <LIM_pkt_send.h>
#include <LIM_pool.h>
Classes | |
struct | _LIM_Pkt_Send |
State information for a LIM packet sending object. More... | |
Defines | |
#define | LIM_PKT_SEND_VALID_KEY (('L'<<24)+('P'<<16)+('K'<<8)+'S') |
Value that indicates LIM packet sending object state is valid. | |
Functions | |
static unsigned int | lim_pkt_send_check (LIM_Pkt_Send *object_p) |
Validate a LIM packet sending object pointer. | |
static void | lim_pkt_send_cb (ITC_QueueItem *qitem_p, unsigned int status_in, void *parm_0, void *parm_1, void *parm_2, unsigned int tx) |
Callback for freeing queue items for packets sent. | |
unsigned int | LIM_pkt_send_new (LIM_Pkt_Send **object_pp, LIM_Pool *pool_p) |
Create and initialize a new packet sending object. | |
unsigned int | LIM_pkt_send_delete (LIM_Pkt_Send *object_p) |
Shutdown and delete a packet sending object. | |
char * | LIM_pkt_send_get_desc (LIM_Pkt_Send *object_p) |
Return the description field for a packet. | |
ITC_TaskID | LIM_pkt_send_get_tid (LIM_Pkt_Send *object_p) |
Return the ID of the task associated with a packet. | |
unsigned int | LIM_pkt_set_info (LIM_Pkt_Send *object_p, ITC_NodeID nid, ITC_TaskID tid, ITC_QueueID qid, unsigned int apid, unsigned int func, int use_checksum, char *desc) |
Update information about a packet. | |
static unsigned int | lim_pkt_send_pkt (LIM_Pkt_Send *object_p, const unsigned char *pkt_p, unsigned int pkt_bytes, CCSDS_Pkt_Type ccsds_pkt_type, ITC_QueueItem **status_qitem_pp) |
Send a command or telemetry packet. | |
unsigned int | LIM_pkt_send_cmd (LIM_Pkt_Send *object_p, const unsigned char *pkt_p, unsigned int pkt_bytes, ITC_QueueItem **status_qitem_pp) |
Send a command packet. | |
unsigned int | LIM_pkt_send_tlm (LIM_Pkt_Send *object_p, const unsigned char *pkt_p, unsigned int pkt_bytes) |
Send a telemetry packet. | |
unsigned int | LIM_pkt_fwd_pkt (LIM_Pkt_Send *object_p, const ITC_QueueItem *qitem_p) |
Forward a packet. |
** CVS $Id: LIM_pkt_send.c,v 1.13 2011/03/29 21:20:29 apw Exp $ **
These are functions related to sending command and telemetry packets. They basically encapsulate the ITC_bind, ITC_send, and ITC_forward functions. They also handle the details of building the packets and allocating memory for them.
unsigned int LIM_pkt_fwd_pkt | ( | LIM_Pkt_Send * | object_p, | |
const ITC_QueueItem * | qitem_p | |||
) |
Forward a packet.
object_p | Pointer to packet sending object. | |
qitem_p | Pointer to queue item to forward. |
References lim_pkt_send_check(), _LIM_Pkt_Send::nid, _LIM_Pkt_Send::qid, and _LIM_Pkt_Send::tid.
Referenced by LIM_other_fwd_active(), LIM_other_fwd_idle(), and LIM_other_fwd_stop().
void lim_pkt_send_cb | ( | ITC_QueueItem * | qitem_p, | |
unsigned int | status_in, | |||
void * | parm_0, | |||
void * | parm_1, | |||
void * | parm_2, | |||
unsigned int | tx | |||
) | [static] |
Callback for freeing queue items for packets sent.
qitem_p | Pointer to queue item. | |
status_in | Completion code. | |
parm_0 | Callback parameter 0 (original cb_parm_0 value). | |
parm_1 | Callback parameter 1 (original free_cb value). | |
parm_2 | Callback parameter 2 (pointer to pkt sending object). | |
tx | Flag indicating sender-side failure. |
References _LIM_Pkt_Send_Status::pkt_send_p, and _LIM_Pkt_Send_Status::status.
Referenced by lim_pkt_send_pkt().
unsigned int lim_pkt_send_check | ( | LIM_Pkt_Send * | object_p | ) | [static] |
Validate a LIM packet sending object pointer.
object_p | Pointer to packet sending object. |
References _LIM_Pkt_Send::key, and LIM_PKT_SEND_VALID_KEY.
Referenced by LIM_pkt_fwd_pkt(), LIM_pkt_send_cmd(), LIM_pkt_send_delete(), LIM_pkt_send_get_desc(), LIM_pkt_send_get_tid(), LIM_pkt_send_tlm(), and LIM_pkt_set_info().
unsigned int LIM_pkt_send_cmd | ( | LIM_Pkt_Send * | object_p, | |
const unsigned char * | pkt_p, | |||
unsigned int | pkt_bytes, | |||
ITC_QueueItem ** | status_qitem_pp | |||
) |
Send a command packet.
object_p | Pointer to packet sending object. | |
pkt_p | Pointer to packet data. | |
pkt_bytes | Size of packet data, in bytes. | |
status_qitem_pp | Location to store pointer to queue item. |
References lim_pkt_send_check(), and lim_pkt_send_pkt().
Referenced by LIM_ltc_send_stop(), LIM_other_send_start(), LIM_other_send_stop(), and LIM_sc_send_slew_request().
unsigned int LIM_pkt_send_delete | ( | LIM_Pkt_Send * | object_p | ) |
Shutdown and delete a packet sending object.
object_p | Pointer to packet sending object. |
References _LIM_Pkt_Send::key, and lim_pkt_send_check().
Referenced by lim_delete_pkt_send(), LIM_intercept_delete(), and LIM_pkt_send_new().
char * LIM_pkt_send_get_desc | ( | LIM_Pkt_Send * | object_p | ) |
Return the description field for a packet.
object_p | Pointer to packet send object. |
References _LIM_Pkt_Send::desc, and lim_pkt_send_check().
ITC_TaskID LIM_pkt_send_get_tid | ( | LIM_Pkt_Send * | object_p | ) |
Return the ID of the task associated with a packet.
object_p | Pointer to packet send object. |
References lim_pkt_send_check(), and _LIM_Pkt_Send::tid.
Referenced by LIM_mode_handle_bulk().
unsigned int LIM_pkt_send_new | ( | LIM_Pkt_Send ** | object_pp, | |
LIM_Pool * | pool_p | |||
) |
Create and initialize a new packet sending object.
object_pp | Location to return pointer to new object. | |
pool_p | Pointer to a memory pool object. |
References _LIM_Pkt_Send::desc, _LIM_Pkt_Send::func, _LIM_Pkt_Send::key, LIM_pkt_send_delete(), LIM_PKT_SEND_VALID_KEY, and _LIM_Pkt_Send::pool_p.
Referenced by LIM_initialize(), and lim_intercept_apid().
unsigned int lim_pkt_send_pkt | ( | LIM_Pkt_Send * | object_p, | |
const unsigned char * | pkt_p, | |||
unsigned int | pkt_bytes, | |||
CCSDS_Pkt_Type | ccsds_pkt_type, | |||
ITC_QueueItem ** | status_qitem_pp | |||
) | [static] |
Send a command or telemetry packet.
object_p | Pointer to packet sending object. | |
pkt_p | Pointer to packet payload. | |
pkt_bytes | Size of packet payload, in bytes. | |
ccsds_pkt_type | Packet type value for the CCSDS header. | |
status_qitem_pp | Location to store pointer to queue item. |
References _LIM_Pkt_Send::apid, _LIM_Pkt_Send::desc, _LIM_Pkt_Send::func, lim_pkt_send_cb(), LIM_pool_alloc(), _LIM_Pkt_Send::nid, _LIM_Pkt_Send::pool_p, _LIM_Pkt_Send::qid, _LIM_Pkt_Send::tid, and _LIM_Pkt_Send::use_checksum.
Referenced by LIM_pkt_send_cmd(), and LIM_pkt_send_tlm().
unsigned int LIM_pkt_send_tlm | ( | LIM_Pkt_Send * | object_p, | |
const unsigned char * | pkt_p, | |||
unsigned int | pkt_bytes | |||
) |
Send a telemetry packet.
object_p | Pointer to packet sending object. | |
pkt_p | Pointer to packet data. | |
pkt_bytes | Size of packet data, in bytes. |
References lim_pkt_send_check(), and lim_pkt_send_pkt().
Referenced by LIM_action_report(), lim_mode_load_shed(), LIM_sc_handle_slew_response(), and LIM_sc_send_slew_request().
unsigned int LIM_pkt_set_info | ( | LIM_Pkt_Send * | object_p, | |
ITC_NodeID | nid, | |||
ITC_TaskID | tid, | |||
ITC_QueueID | qid, | |||
unsigned int | apid, | |||
unsigned int | func, | |||
int | use_checksum, | |||
char * | desc | |||
) |
Update information about a packet.
object_p | Pointer to packet sending object. | |
nid | ID of target node. | |
tid | ID of target task. | |
qid | ID of target queue. | |
apid | APID of the packet. | |
func | Function code of the packet. | |
use_checksum | Flag to indicate if packet includes a checksum. | |
desc | Description of the packet. |
References _LIM_Pkt_Send::apid, _LIM_Pkt_Send::desc, _LIM_Pkt_Send::func, lim_pkt_send_check(), _LIM_Pkt_Send::nid, _LIM_Pkt_Send::qid, _LIM_Pkt_Send::tid, and _LIM_Pkt_Send::use_checksum.
Referenced by LIM_action_new(), lim_intercept_command(), LIM_ltc_new(), LIM_mode_new(), and LIM_sc_new().