#include // FBM date unsigned long long * begin_date; // Date de depart de recedption de la premiere trame unsigned long long * tick_bb_date; // Date du tick precedent auquel a été déclenché TSP unsigned long long * duration; // Duree en micro seconde unsigned long long * current_date; // Date courante de la reception de la trame courante unsigned long long * prec_date; // Date de reception de la trame precedente unsigned long long * interval_max_rx; // Intervalle maximuim entre deux receptions de trame -> indication de jitter unsigned long long * jitter_max_rx; // Evaluation du jitter (n'est valable qu'a periode constante) unsigned long long * jitter_max_tx; // Evaluation du jitter (n'est valable qu'a periode constante) en emission unsigned long long * interval_max_tx; // Intervalle maximuim entre deux emissions unsigned long long * lost_frame; // Nb de trame perdus en reception unsigned long long * timming_error; // Horloge reprogrammé -> perte de l'information -> on trace unsigned long long * udp_rate; // Estimation du débit utile en reception (Debit UDP) par cycle bbb unsigned long long * eth_rate; // Estimation du débit Ethernet par cycle bbb unsigned long long * nb_frame_receive; // Estimation du nombre de trame recu par cycle bbb unsigned long long * jitter_moyen; // Estimation du jitter par cycle bbb // FBM ajout du support du Black board static char *bb_crude_name_private = "CRUDE_BB"; /**< blackboard name */ static S_BB_T *bb_crude = NULL; /**< balck board structure handle for CRUDE */ int32_t n_data = 20; /**< number data need to be shared */ int32_t data_size = 30000; /**< Blackboard size */ void E_BB_UINT64_publication(unsigned long long ** pdata, int array_size, char * name_data) { S_BB_DATADESC_T s_data_desc; // description void *retval; // pointeur sur la données alloué // publication test de données s_data_desc.type = E_BB_UINT64; s_data_desc.type_size = sizeof(unsigned long long); s_data_desc.dimension = array_size; // strncpy(s_data_desc.name, name_data, VARNAME_MAX_SIZE); retval = bb_publish(bb_crude, &s_data_desc); *pdata = (unsigned long long *)retval; **pdata = 0; } void data_publication(void) { E_BB_UINT64_publication(& begin_date , 1, "begin_date"); E_BB_UINT64_publication(& tick_bb_date , 1, "tick_bb_date"); E_BB_UINT64_publication(& duration , 1, "duration"); E_BB_UINT64_publication(& current_date , 1, "current_date"); E_BB_UINT64_publication(& prec_date , 1, "prec_date"); E_BB_UINT64_publication(& interval_max_rx , 1, "interval_max_rx"); E_BB_UINT64_publication(& jitter_max_rx , 1, "jitter_max_rx"); E_BB_UINT64_publication(& jitter_max_tx , 1, "jitter_max_tx"); E_BB_UINT64_publication(& interval_max_tx , 1, "interval_max_tx"); E_BB_UINT64_publication(& lost_frame , 1, "lost_frame"); E_BB_UINT64_publication(& timming_error , 1, "timming_error"); E_BB_UINT64_publication(& udp_rate , 1, "udp_rate"); E_BB_UINT64_publication(& eth_rate , 1, "eth_rate"); E_BB_UINT64_publication(& nb_frame_receive , 1, "nb_frame_receive"); E_BB_UINT64_publication(& jitter_moyen , 1, "jitter_moyen"); } #define CRUDE_MESG_SYNC 1 void mesg_sync_bb(void) { // la synchro int32_t retcode; S_BB_MSG_T s_bb_msg; if (bb_crude != NULL) { s_bb_msg.mtype = CRUDE_MESG_SYNC; retcode = bb_snd_msg(bb_crude, &s_bb_msg); } } void close_bb(void) { // detach to the bb int32_t retcode; retcode = bb_detach(&bb_crude); } int init_bb(void) { int32_t retcode; retcode = bb_create(&bb_crude, bb_crude_name_private, n_data, data_size); if (retcode < 0) { /* * Pas besoin de s'attacher si on est * dans le process qui a cree le BB */ if (NULL == bb_crude) { printf("Attach on BB \n"); retcode = bb_attach(&bb_crude, bb_crude_name_private); if (retcode < 0) { return -1; } } else { retcode = 0; } } data_publication(); return retcode; } // Fin FBM