TSP: The Transport Sample Protocol



Main Page | Modules | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

tsp_data_sender.c File Reference

#include "tsp_sys_headers.h"
#include <rpc/types.h>
#include <rpc/xdr.h>
#include "tsp_data_sender.h"
#include "tsp_datastruct.h"
#include "tsp_group_algo.h"
#include "tsp_group_algo_data.h"
#include "tsp_stream_sender.h"
#include "tsp_const_def.h"

Go to the source code of this file.

Functions

TSP_data_sender_t TSP_data_sender_create (int fifo_size, int max_group_size)
 Create a data sender.

void TSP_data_sender_destroy (TSP_data_sender_t sender)
 Destroy a data sender.

void TSP_data_sender_stop (TSP_data_sender_t sender)
 Stop a data sender.

int TSP_data_sender_send_msg_ctrl (TSP_data_sender_t sender, TSP_msg_ctrl_t msg_ctrl)
 Send a message control to the consumer.

int TSP_data_sender_send (TSP_data_sender_t _sender, TSP_groups_t _groups, time_stamp_t time_stamp)
 Send data to the consumer.

const char * TSP_data_sender_get_data_address_string (TSP_data_sender_t sender)
 Get the address string to which the client must connect to receive data.(format depends on the used protocol ; for TCP/IP it is 'hostname : port').

TSP_data_encoder_t TSP_data_sender_get_double_encoder (void)
 Returns the function used to encode a double type.

int TSP_data_sender_is_consumer_connected (TSP_data_sender_t sender)
 Is the consumer connected to the data sender ?


Detailed Description

Header
/cvsroot/tsp/tsp/src/core/ctrl/tsp_data_sender.c,v 1.16 2004/09/22 14:25:58 tractobob Exp

-----------------------------------------------------------------------

TSP Library - core components for a generic Transport Sampling Protocol.

Copyright (c) 2002 Yves DUFRENNE, Stephane GALLES, Eric NOULARD and Robert PAGNOT

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

-----------------------------------------------------------------------

Project : TSP Maintainer : tsp@astrium-space.com Component : Provider

-----------------------------------------------------------------------

Purpose : Implementation for the functions used to encode and send the data stream for the asked symbols

-----------------------------------------------------------------------

Definition in file tsp_data_sender.c.


Function Documentation

TSP_data_sender_t TSP_data_sender_create int  fifo_size,
int  max_group_size
 

Create a data sender.

Parameters:
fifo_size If fifo_size > 0, a ringbuffer will be created with a fifo_size depth, to send the data
max_group_size Size of the bigger group (used to calculate the buffer size )
Returns:
The created data sender handle

Definition at line 117 of file tsp_data_sender.c.

References TSP_data_sender_t, TSP_stream_sender_create(), TSP_stream_sender_get_buffer(), and TSP_stream_sender_get_ringbuf().

Referenced by TSP_session_create_data_sender_by_channel().

void TSP_data_sender_destroy TSP_data_sender_t  sender  ) 
 

Destroy a data sender.

Parameters:
sender The data sender handle.

Definition at line 167 of file tsp_data_sender.c.

References TSP_data_sender_t, and TSP_stream_sender_destroy().

Referenced by TSP_session_destroy_data_sender_by_channel().

const char* TSP_data_sender_get_data_address_string TSP_data_sender_t  sender  ) 
 

Get the address string to which the client must connect to receive data.(format depends on the used protocol ; for TCP/IP it is 'hostname : port').

Parameters:
sender The data sender handle.
Returns:
data address. An error returns 0;

Definition at line 411 of file tsp_data_sender.c.

References TSP_data_sender_t, and TSP_stream_sender_get_data_address_string().

Referenced by TSP_session_get_data_address_string_by_channel().

TSP_data_encoder_t TSP_data_sender_get_double_encoder void   ) 
 

Returns the function used to encode a double type.

This value is stored in the group table to encode the data as fast as possible. FIXME : manage more types : RAW, STRING ...

Returns:
The double encoder function

Definition at line 417 of file tsp_data_sender.c.

References TSP_data_encoder_t.

Referenced by TSP_group_algo_create_symbols_table().

int TSP_data_sender_is_consumer_connected TSP_data_sender_t  sender  ) 
 

Is the consumer connected to the data sender ?

Parameters:
sender The data sender handle.
Returns:
TRUE or FALSE. TRUE = OK

Definition at line 424 of file tsp_data_sender.c.

References TSP_data_sender_t, and TSP_stream_sender_is_client_connected().

Referenced by TSP_session_is_consumer_connected_by_channel().

int TSP_data_sender_send TSP_data_sender_t  _sender,
TSP_groups_t  _groups,
time_stamp_t  time_stamp
 

Send data to the consumer.

Parameters:
_sender sender used to send the data
_groups groups used to calculate the data
t time stamp sent with the data
Returns:
TRUE = OK

Definition at line 341 of file tsp_data_sender.c.

References TSP_data_sender_t, and TSP_STREAM_SENDER_ITEM_BUF.

Referenced by TSP_session_all_session_send_data(), and TSP_session_send_data_by_channel().

int TSP_data_sender_send_msg_ctrl TSP_data_sender_t  sender,
TSP_msg_ctrl_t  msg_ctrl
 

Send a message control to the consumer.

Parameters:
sender sender used to send the data The special group ID groupe EOF indicate the End of Stream for the consumer
msg_ctrl The message that must be sent
Returns:
TRUE = OK

Definition at line 280 of file tsp_data_sender.c.

References TSP_data_sender_t, TSP_MSG_CTRL_CONSUMER_DATA_LOST, TSP_MSG_CTRL_EOF, TSP_MSG_CTRL_GLU_DATA_LOST, TSP_MSG_CTRL_RECONF, TSP_RESERVED_GROUP_EOF, and TSP_STREAM_SENDER_ITEM_BUF.

Referenced by TSP_session_all_session_send_msg_ctrl(), and TSP_session_send_msg_ctrl_by_channel().

void TSP_data_sender_stop TSP_data_sender_t  sender  ) 
 

Stop a data sender.

Parameters:
sender The data sender handle.

Definition at line 180 of file tsp_data_sender.c.

References TSP_data_sender_t, and TSP_stream_sender_stop().

Referenced by TSP_session_destroy_data_sender_by_channel().

Framework Home Page.


Beware !! TSP wave is coming...