TSP: The Transport Sample Protocol



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

GLUServer
[Provider]


Data Structures

struct  glu_item_t
 Item used to transmit a data sample. More...


Defines

#define GLU_GLOBAL_HANDLE   ((GLU_handle_t)0x1)
 GLU global handle dummy value.


Typedefs

typedef void * GLU_handle_t
 Handle for a GLU instance.


Enumerations

enum  GLU_server_type_t { GLU_SERVER_TYPE_ACTIVE, GLU_SERVER_TYPE_PASSIVE }
 GLU server type. More...

enum  GLU_get_state_t {
  GLU_GET_NEW_ITEM, GLU_GET_NO_ITEM, GLU_GET_EOF, GLU_GET_RECONF,
  GLU_GET_DATA_LOST
}

Functions

char * GLU_get_server_name (void)
 GLU server name.

int GLU_init (int fallback_argc, char *fallback_argv[])
 GLU initialization function.

int GLU_start (void)
 Start the loop that will had data to datapool whith pus_next_item.

GLU_server_type_t GLU_get_server_type (void)
 GLU server type : ACTIVE or PASSIVE.

GLU_handle_t GLU_get_instance (int custom_argc, char *custom_argv[], char **error_info)
 GLU instance creation.

int GLU_get_sample_symbol_info_list (GLU_handle_t h_glu, TSP_sample_symbol_info_list_t *symbol_list)
 List of symbols managed by the GLU.

double GLU_get_base_frequency (void)
 GLU base frequency.


Detailed Description

The GLU server is the part of the TSP provider that should be coded each time the underlying 'real' sampled system (hardware card, simulator, ...) change. The GLU interface should be implemented in order to combine the TSP provider lib int a real TSP provider.

Define Documentation

#define GLU_GLOBAL_HANDLE   ((GLU_handle_t)0x1)
 

GLU global handle dummy value.

For an active GLU, the function GLU_get_instance always returns GLU_GLOBAL_HANDLE, as for the active case there is always one single GLU in the system

Definition at line 114 of file glue_sserver.h.

Referenced by GLU_get_instance().


Typedef Documentation

typedef void* GLU_handle_t
 

Handle for a GLU instance.

Definition at line 107 of file glue_sserver.h.

Referenced by GLU_get_instance(), GLU_get_sample_symbol_info_list(), TSP_add_session(), and TSP_local_datapool_allocate().


Enumeration Type Documentation

enum GLU_get_state_t
 

Enumeration values:
GLU_GET_NEW_ITEM  new item available
GLU_GET_NO_ITEM  no item available
GLU_GET_EOF  end of data stream
GLU_GET_RECONF  end of data stream, and GLU list of symbols changed, all client will have to ask fo the new symbol list
GLU_GET_DATA_LOST  Data were lost in GLU internals ; The provider might be too slow and/or the GLU too fast, and/or the CPU overloaded : all clients will be notified by the provider.

Definition at line 71 of file glue_sserver.h.

enum GLU_server_type_t
 

GLU server type.

Enumeration values:
GLU_SERVER_TYPE_ACTIVE  GLU is active.

Means that the data are continuously produced and must be read at the same pace (or faster) by the provider

GLU_SERVER_TYPE_PASSIVE  GLU is passive.

Means that the data are produced only when the provider ask for them (typically File Based Glu/Provider)

Definition at line 57 of file glue_sserver.h.


Function Documentation

double GLU_get_base_frequency void   ) 
 

GLU base frequency.

Returns:
GLU base frequency (Hz)

Definition at line 262 of file bb_tsp_provider.c.

Referenced by TSP_session_create_data_sender_by_channel().

GLU_handle_t GLU_get_instance int  custom_argc,
char *  custom_argv[],
char **  error_info
 

GLU instance creation.

This function will be called by the provider for each consumer connection. This function is the place where the GLU must be instanciated.

  • When the GLU is type ACTIVE, it must be a singleton and must be instanciated once ( i.e. the first time this function is called). When the instanciation of an ACTIVE GLU succed this function always returns the value GLU_GLOBAL_HANDLE (and for all the subsequent calls that should not create a new GLU, and always should always succed).

  • When the GLU is type PASSIVE, for each consumer connection a new GLU must be instanciated ; use the GLU_handle_t type to reference your GLU object and return this handle when the instanciation succed

Parameters:
custom_argc Number of consumer initialisation elements (when the consumer do not provide any parameters this parameter is equal to fallback_argc of GLU_init)
custom_argv Initialisation elements The first usefull parameter is always fallback_argv[1], so as the getopt* functions may be used to parse those parameters (when the consumer do not provide any parameters this parameter is equal to fallback_argv of GLU_init)
error_info When the function fail the GLU may use this parameter to return an error string that will be transmited to the consumer to get detailed information about the error.
Returns:
The created GLU handle. Returns 0 when the function fail

Definition at line 343 of file bb_tsp_provider.c.

References GLU_GLOBAL_HANDLE, and GLU_handle_t.

int GLU_get_sample_symbol_info_list GLU_handle_t  h_glu,
TSP_sample_symbol_info_list_t *  symbol_list
 

List of symbols managed by the GLU.

Parameters:
h_glu Handle for the GLU (when the GLU is ACTIVE, it is always equal to GLU_GLOBAL_HANDLE)
symbol_list List of symbols
Returns:
TRUE of FALSE. TRUE = OK;

Definition at line 252 of file bb_tsp_provider.c.

References GLU_handle_t.

Referenced by TSP_add_session(), TSP_session_get_sample_symbol_info_list_by_channel(), and TSP_session_get_symbols_global_index_by_channel().

char* GLU_get_server_name void   ) 
 

GLU server name.

This string will be used by the consumers to get informations about a provider. It must be meaningfull (ex : "Temperatures Sampler" )

Definition at line 104 of file bb_tsp_provider.c.

GLU_server_type_t GLU_get_server_type void   ) 
 

GLU server type : ACTIVE or PASSIVE.

Returns:
GLU server type.

Definition at line 236 of file bb_tsp_provider.c.

References GLU_SERVER_TYPE_ACTIVE.

int GLU_init int  fallback_argc,
char *  fallback_argv[]
 

GLU initialization function.

The code in this function will be called once, and may do any usefull global check and initialization. Usually the data stream should not be started in this function as there is no connected consumer when this function is called. To start your data stream, wait for the first GLU_get_instance function that will be called for each consumer connection

The parameters for this function come from the parameters that may have been provided thrue the command line that was used to launch the provider. In this function the GLU should not use these parameters, but it should check their value, as these value will be used as fallback parameters for the GLU_get_instance function each time a consumer connect to the provider and does not provide its own parameters

the GLU may then for this function return :

  • FALSE if it does not want to be started ( ex : when the parameters are incorrect, or when there is no parameters at all and this GLU exepects parameters). The provider will stop.
  • TRUE if everything is OK

NOTE1 : Sometimes, the the only way to check the provided parameters is to start the data stream. If so, the data stream must not be started a second time in the get_instance function.

NOTE2 : This string is provided in this function for fallback test only and should not be memorized by the GLU server

NOTE3 : When there is not fallback stream at all, the value of fallback_argv is 0. It is up to the GLU server to decide if it is acceptable for the provider to be started with no fallback stream at all (it usually is acceptable)

Parameters:
fallback_argc Number of fallback initialisation elements as used in main(argc, argv)
fallback_argv Fallback initialisation elements as used in main(argc, argv) The first usefull parameter is always fallback_argv[1], so as the getopt* functions may be used to parse those parameters
Returns:
Return FALSE if a fatal error occur during initialisation or if there is a probleme with the provided parameters

Definition at line 110 of file bb_tsp_provider.c.

int GLU_start void   ) 
 

Start the loop that will had data to datapool whith pus_next_item.

Returns:
status

Definition at line 333 of file bb_tsp_provider.c.

Framework Home Page.


Beware !! TSP wave is coming...