⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 test_rrc.c

📁 This a framework to test new ideas in transmission technology. Actual development is a LDPC-coder in
💻 C
字号:
/***************************************************************************              rrc.c  -  SRadio testing of RRC                            -------------------    begin                :  2002    authors              :  Linus Gasser    emails               :  linus.gasser@epfl.ch ***************************************************************************//***************************************************************************                                 Changes                                 ------- date - name - description 02-10-16 - ineiti- begin 04/03/03 - ineiti - added a small description  **************************************************************************//*************************************************************************** *                                                                         * *   This program is free software; you can redistribute it and/or modify  * *   it under the terms of the GNU General Public License as published by  * *   the Free Software Foundation; either version 2 of the License, or     * *   (at your option) any later version.                                   * *                                                                         * ***************************************************************************/char desc[] ="Description:\n""Makes a small chain that sends some signal over the first\n""slot of the STFA, so that one can have a look whether the\n""stm-rf cards are working.\n\n";#include "system.h"#include "spc.h"#include "antenna.h"#include "std.h"#include "stfa.h"#define DBG_LVL 4#define ANTENNA 0swr_sdb_id stfa, rrc;pthread_mutex_t mutex_here;struct chain_t *test;int count, size;#define COUNT_MAX 8196SYMBOL_MMX *buf;void *start_it( void *arg ) {  swr_sdb_id rand;  test = swr_chain_create( NEW_SPC_VAR( "random", rand ),                           NEW_SPC( "mapper" ),                           NEW_SPC_VAR( "rrc", rrc ),                           NEW_SPC_VAR( "stfa", stfa ),			   CHAIN_END );  PR( "Setting up STFA\n" );  swr_stfa_notice_sdb( stfa, 0, rand );  size = swr_sdb_get_struct( rrc )->port_in[0].size;  buf = swr_sdb_get_struct( rrc )->port_in[0].data;  swr_ant_set_gains( ANTENNA, 0, 0 );  count = COUNT_MAX - 1;  // And send some slots...  PR( "Send some slots\n" );  swr_stfa_go( stfa );  while ( count < COUNT_MAX ) {    PR( "Going on and on and on\n" );    count ++;    usleep( 500000 );  }  swr_stfa_stop( stfa );  return 0;}swr_spc_id_t cdb_id;struct thread start;/** * This function is called upon "insmod" and is used to register the * different parts of the module to the SPM. */int um_module_init(void) {  PR_CL( desc );  if ( swr_thread_init( &start, start_it, NULL ) ) {    goto rrc_no_thread;  }  return 0;rrc_no_thread:  PR_DBG( 0, "Couldn't init thread\n" );  return -1;}void um_module_exit( void ) {  usleep( 1000000 );  count = COUNT_MAX;  swr_thread_free( &start, NULL );  PR( "deleting cdbs and sdbs\n" );  swr_chain_destroy( test );  PR( "finished\n" );}module_init( um_module_init );module_exit( um_module_exit );

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -