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

📄 bs_main.c

📁 wimax bs模拟器
💻 C
字号:
/******************************************************************************* 
**  Copyright (c) 2007,Utstarcom Inc.
**  All rights reserved.
**
**  Group          : WBG ROM
**  Creater        : RCT                                               
**  Data           : 2007-01-15                                         
**  Description    : the initialization of BS.                                                      
**  Version        : 0.1                                                      
**-----------------------------------------------------------------------------
** <complement:Update history>
********************************************************************************/

#include "xCommon.h"
#include "global.h"
#include "bs_common.h"
#include "bs_log.h"
#include "bs_udplink.h"
#include "bs_cp.h"

extern DWORD gSourceIp;
extern void dhcp_client_task_start();

/**********************************************************
Function name: bs_config
Description: read parameters from a configuration file
Calls:       
Global Variables Accessed: 
Global Variables Updated: 
Input parameter: 
Output parameter: 
Return value:
OK or ERROR
***********************************************************/
STATUS bs_configure()
{
	#if 0
	FILE * p_file;
	char * pAdd = NULL;

	p_file = fopen("bssim_sonfig.txt", "r");
	if (p_file == NULL)
	{
		TRACE3("Open file 'bssim_config.txt' error.\n");
		return ERROR;
	}

	fgets(pAdd, MAX_LINE, p_file);
	gSourceIp = inet_addr(pAdd);

	fgets(pAdd, MAX_LINE, p_file);
	gDestinationIp= inet_addr(pAdd);
	
	fclose(p_file);
	#endif
	return OK;
}

/**********************************************************
Function name: bs_init
Description: the initialization procedure
Calls:       
Global Variables Accessed: 
Global Variables Updated: 
Input parameter: 
Output parameter: 
Return value:
OK or ERROR
***********************************************************/
STATUS bs_init()
{

	/*initialize the xCommon library*/
	init_xcommon (1, 0, 1, gSourceIp,514) ;

	
	/*initialize the log function first*/
	bs_log_init(1);

	/*configure BS*/
	if(ERROR == bs_configure())
	{
		bs_log_err("configure error ");
		return ERROR;
	}
	bs_log_debug("bs configure success");

	/*initialize the BS CP*/
	if(ERROR == bs_cp_init())
	{
		bs_log_err("Failed to initialize the BS CP  ");
		return ERROR;
	}
	bs_log_debug("the BSCP is initialized successful");

	/*initialize the BS UDP*/
	if(ERROR == bs_udp_init())
	{
		bs_log_err("Failed to initialize the BS UDP  ");
		return ERROR;
	}
	bs_log_debug("the BSUDP is initialized successful");

	/*initialize the BS DHCP*/
	dhcp_client_task_start();
	bs_log_debug("the BS DHCP is initialized successful");

	return OK;
}


/**********************************************************
Function name: bs_show_sys
Description: the show function for GW;
Calls:       
Global Variables Accessed: 
Global Variables Updated: 
Input parameter: 
Output parameter: 
Return value:
OK or ERROR
***********************************************************/

int bs_show_sys()
{
	extern MSG_Q_ID g_msgq_bscp;
	extern int gi_tid_bs;

	printf("Message queue id %ld\n", (unsigned long)g_msgq_bscp);

#if defined(VXWORKS)
	msgQShow(g_msgq_bscp,1);
#endif

	printf("Task id %d\n", gi_tid_bs);
	return OK;
}

/**********************************************************
Function name: bs_help
Description: the help function of GW
Calls:       
Global Variables Accessed: 
Global Variables Updated: 
Input parameter: 
Output parameter: 
Return value:
OK or ERROR
***********************************************************/

int bs_help()
{
	printf("BS_CallInit(int msNum)\n");
	printf("BS_UeDreg(unsigned shor ueId)\n");
	printf("BS_ShowMs()\n");

	return OK;
}



⌨️ 快捷键说明

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