TSP: The Transport Sample Protocol



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

SimpleBlackBoard
[BlackBoard]


Functions

void * bb_simple_publish (S_BB_T *bb_simple, const char *var_name, const char *module_name, const int module_instance, E_BB_TYPE_T bb_type, int type_size, int dimension)
 Publish data in a simple BB.

void * bb_simple_subscribe (S_BB_T *bb_simple, const char *var_name, const char *module_name, const int module_instance, E_BB_TYPE_T *bb_type, int *type_size, int *dimension)
 Subscribe to a data in simple BB.

int32_t bb_simple_synchro_config (int synchro_type)
 Configure synchronization type (thread or process).

int32_t bb_simple_synchro_go (S_BB_T *bb_simple, int msg_type)
 Send a simple synchro message through the BB message queue.

int32_t bb_simple_synchro_wait (S_BB_T *bb_simple, int type_msg)
 Attente d'un message de deblocage de synchronisation SIMPLE.

int32_t bb_simple_synchro_verify (S_BB_T *bb_simple)
 Verification de la synchronisation SIMPLE.

int32_t bb_simple_thread_synchro_go (int type_msg)
 Envoi d'un message de déblocage de synchronisation SIMPLE (version thread).

int32_t bb_simple_thread_synchro_wait (int type_msg)
 Attente d'un message de déblocage de synchronisation SIMPLE (version thread).


Detailed Description

A simplest way to use blackboard. The simple blackboard interface is an easy to use publish subscribe interface using simple synchronization primitive.

Function Documentation

void* bb_simple_publish S_BB_T bb_simple,
const char *  var_name,
const char *  module_name,
const int  module_instance,
E_BB_TYPE_T  bb_type,
int  type_size,
int  dimension
 

Publish data in a simple BB.

This is a normal BB publish operation with an added automatic subscribe facility. If the to be published data already exists in BB then the publish operation automatically triggers the corresponding subscribe operation. If first publish, the data is initialized to 0 if automatically subscribed the data is not initialized by the call and one obtain the previously set value. The name of the variable to be published is mangled using 3 field:

  • variable name
  • the module name whose variable belongs to
  • the module instance in case there may be several instance of the same moule.
    Parameters:
    bb_simple INOUT, a pointer to a valid BB.
    var_name IN, the name of the data
    module_name IN, the module name
    module_instance IN, the module instance, -1 signify no instance.
    bb_type IN, BlackBoard data type.
    type_size IN, the data type size in byte (correspond to the size of an element of this type to be allocated).
    dimension IN, dimension of the variable
    • 1 for scalar
    • > 1 for array var.
    Returns:
    address of the allocated data on success, NULL if allocation failed.

Definition at line 52 of file bb_simple.c.

References bb_logMsg(), bb_publish(), S_BB_DATADESC::dimension, S_BB_DATADESC::name, S_BB_DATADESC_T, S_BB_T, S_BB_DATADESC::type, and S_BB_DATADESC::type_size.

void* bb_simple_subscribe S_BB_T bb_simple,
const char *  var_name,
const char *  module_name,
const int  module_instance,
E_BB_TYPE_T bb_type,
int *  type_size,
int *  dimension
 

Subscribe to a data in simple BB.

This a normal BB subscribe with name mangling just the same as

See also:
bb_simple_publish.
Parameters:
bb_simple IN, a pointer to a valid BB.
var_name IN, the variable name
module_name IN, the name of the module who has published the data
module_instance IN, module instance (-1 if no instance)
bb_type IN/OUT, en entrée le type de donnée attendu en sortie le type de la donnée trouvée dans le BB.
type_size OUT, taille du type récupéré en octet
dimension IN/OUT, en entrée la taille attendue en sortie la taille effective de la donnée.
Returns:
adresse de la donnée allouée, NULL si allocation impossible.

Definition at line 87 of file bb_simple.c.

References bb_subscribe(), S_BB_DATADESC::dimension, S_BB_DATADESC::name, S_BB_DATADESC_T, S_BB_T, S_BB_DATADESC::type, and S_BB_DATADESC::type_size.

int32_t bb_simple_synchro_config int  synchro_type  ) 
 

Configure synchronization type (thread or process).

Parameters:
synchro_type IN,
  • BB_SIMPLE_SYNCHRO_THREAD for POSIX thread synchro
  • BB_SIMPLE_SYNCHRO_PROCESS for Sys V synchro
Returns:
E_OK on success, E_NOK on failure.

Definition at line 119 of file bb_simple.c.

References bb_logMsg().

int32_t bb_simple_synchro_go S_BB_T bb_simple,
int  msg_type
 

Send a simple synchro message through the BB message queue.

Parameters:
bb_simple INOUT, a pointer to a valid BB.
msg_type IN, le type de message à envoyer pour la synchro
Returns:
E_OK si tout se passe bien

Definition at line 139 of file bb_simple.c.

References bb_simple_thread_synchro_go(), bb_snd_msg(), S_BB_MSG::mtype, S_BB_MSG_T, and S_BB_T.

int32_t bb_simple_synchro_verify S_BB_T bb_simple  ) 
 

Verification de la synchronisation SIMPLE.

Parameters:
bb_simple INOUT, a pointer to a valid BB.
Returns:
E_OK si tous les messages de synchro ont ete consommes, E_NOK sinon.

Definition at line 181 of file bb_simple.c.

References bb_msg_id(), and S_BB_T.

int32_t bb_simple_synchro_wait S_BB_T bb_simple,
int  type_msg
 

Attente d'un message de deblocage de synchronisation SIMPLE.

Parameters:
bb_simple a pointer to a valid BB.
type_msg le type de message à recevoir pour la synchro
Returns:
E_OK si tout se passe bien

Definition at line 160 of file bb_simple.c.

References bb_rcv_msg(), bb_simple_thread_synchro_wait(), S_BB_MSG::mtype, S_BB_MSG_T, and S_BB_T.

int32_t bb_simple_thread_synchro_go int  type_msg  ) 
 

Envoi d'un message de déblocage de synchronisation SIMPLE (version thread).

Parameters:
type_msg le type de message à envoyer pour la synchro
Returns:
E_OK si tout se passe bien

Definition at line 201 of file bb_simple.c.

References bb_logMsg(), BB_SIMPLE_MSGID_SYNCHRO_COPY, and BB_SIMPLE_MSGID_SYNCHRO_COPY_ACK.

Referenced by bb_simple_synchro_go().

int32_t bb_simple_thread_synchro_wait int  type_msg  ) 
 

Attente d'un message de déblocage de synchronisation SIMPLE (version thread).

Parameters:
type_msg le type de message à recevoir pour la synchro
Returns:
E_OK si tout se passe bien

Definition at line 227 of file bb_simple.c.

References bb_logMsg(), BB_SIMPLE_MSGID_SYNCHRO_COPY, and BB_SIMPLE_MSGID_SYNCHRO_COPY_ACK.

Referenced by bb_simple_synchro_wait().

Framework Home Page.


Beware !! TSP wave is coming...