#ifndef _STATS_H #define _STATS_H int stat_signal,stat_len,stat_reset,stat_period,stat_pattern,stat_ber,stat_expect,stat_numerrors,stat_recvbits,stat_printbits,stat_printpos,stat_fixoffset; int in_len,datatype,ber_check; #define SIGNAL_VIEW_LEN 512 int input_i[SIGNAL_VIEW_LEN]; int pattern,print_period,reset,fixed_offset; float ber; int numerrors,numbits,print_bits,print_position,expected_pkts; /** undef to disable reading file at init */ #define PAT_FILENAME "data/rfc793.txt" #define PAT_ZEROS 0 #define PAT_ONES 1 #define PAT_FIXED 2 #define PAT_RANDOM 3 #define PAT_FILE 4 struct utils_param params[] = { {"datatype",STAT_TYPE_INT,1,&datatype}, {"ber_check",STAT_TYPE_INT,1,&ber_check}, /** datatype must be 0 (bitstream) */ {"print_period",STAT_TYPE_INT,1,&print_period}, /** Bit-pattern options: * 0 zeros * 1 ones * 2 fixed sequence * 3 random * 4 file (defined at PAT_FILENAME) */ {"bit_pattern",STAT_TYPE_INT,1,&pattern}, /** should be same as binsource */ {"print_bits",STAT_TYPE_INT,1,&print_bits}, {"print_position",STAT_TYPE_INT,1,&print_position}, {"fixed_offset",STAT_TYPE_INT,1,&fixed_offset}, {NULL, 0, 0, 0}}; struct utils_stat stats[] = { {"recv_len", STAT_TYPE_INT, 1, &stat_len, (void*)&in_len, WRITE}, {"fixed_offset", STAT_TYPE_INT, 1, &stat_fixoffset, (void*)&fixed_offset, READ}, {"print_bits", STAT_TYPE_INT, 1, &stat_printbits, (void*)&print_bits, READ}, {"print_position", STAT_TYPE_INT, 1, &stat_printpos, (void*)&print_position, READ}, {"numbits", STAT_TYPE_INT, 1, &stat_recvbits, (void*)&numbits, WRITE}, {"numerrors", STAT_TYPE_INT, 1, &stat_numerrors, (void*)&numerrors, WRITE}, {"BER", STAT_TYPE_FLOAT, 1, &stat_ber, (void*)&ber, WRITE}, {"pattern", STAT_TYPE_INT, 1, &stat_pattern, (void*)&pattern, READ}, {"print_period", STAT_TYPE_INT, 1, &stat_period, (void*)&print_period, READ}, {"reset_ber", STAT_TYPE_INT, 1, &stat_reset, (void*)&reset, READ}, {"Signal", STAT_TYPE_INT, SIGNAL_VIEW_LEN, &stat_signal, (void*)input_i, WRITE}, {NULL, 0, 0, 0, 0, 0}}; #endif /* _STATS_H */