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

📄 rt1lchr.c

📁 phs 源代码 小灵通协议源代码 phs source code
💻 C
字号:
/************************************************************************/
/** 		Copyright (c) 1998, UTStarcom, Inc. 			*/
/**			 All Rights Reserved. 				*/
/** 									*/
/** Subsystem: 		RT 						*/
/** File: 		rt1lchr.c 					*/
/** Created By: 	tara zhang					*/
/** Created On: 	08/02/2003					*/
/** 									*/
/** Purpose:								*/
/** 	This file handle request message when link channel establish .	*/
/**									*/
/** Necessary Compilation Flags: FLAG_1, , FLAG_N 			*/
/**********************************************************************	*/
/** Modify by: 								*/
/** Modify purpose:							*/
/************************************************************************/
#ifndef PM_ONPC

#define __RTLCHR_C_

#ifdef __cplusplus
extern "C"{
#endif

#include "rt.h"

/********************************************************************************************************/
/*                                                                          				*/
/*		NUMBER		13                                                      		*/
/*		CALL		void rt_lch_req			                			*/
/*		PARAM		tx_cac is lch request message content					*/
/*		DISCRIPTION:	tx_cac[0]: message type							*/
/*				tx_cac[1]:lch type + lch protocol type + externsion lch ptotocol type 	*/
/*				tx_cac[2]:cc prorocol + system type + RT-MM protocol version		*/
/*				tx_cac[3]:notification of usable band + area information 		*/
/*					  notification status number.					*/
/*				tx_cac[4]:option							*/
/*													*/
/*		RETURN:											*/
/********************************************************************************************************/
U1 rt_lch_req(void)
{
	tx_cac[0] = LCHRQ;
	Lchercnt = LCHERMAX - IN_LCHEVT->msg_dat[5];

	if ( Lchercnt < LCHERMAX )
	{
		move_up_b( &tx_cac[1], (U1*)&IN_LCHEVT->msg_dat[1], 4 );
		move_up_b( Rtlchdat, tx_cac, 5 );
#ifdef SIMU_ON_PC
		SendUart2L1(SIMTSKDTW,TXCAC, 0 , tx_cac,sizeof(tx_cac));
		ph_dt_req( L1_SCCH, DMY, OFF,0 );
#else
		ph_dt_req( L1_SCCH, DMY, OFF );
#endif

#ifdef  EXT_IO
        HisOut(0,0xda,0x04,0,0);
#endif

		Lchercnt++;

		//Rt_sts = ST_LCH_REQ;
		Rt_sts = (U1)rt_state_table->state;
	}
	return (0);
}


/********************************************************************************************************/
/*                                                                          				*/
/*		NUMBER		13                                                      		*/
/*		CALL		void rt_recall_lch_req			                		*/
/*		Gloal:	Rtlchdat:lch establish message body						*/
/*				Rtlchdat[0]: message type						*/
/*				Rtlchdat[1]:lch type + lch protocol type + externsion lch ptotocol type */
/*				Rtlchdat[2]:cc prorocol + system type + RT-MM protocol version		*/
/*				Rtlchdat[3]:notification of usable band + area information 		*/
/*					  notification status number.					*/
/*				Rtlchdat[4]:option							*/
/*			TIMER:										*/
/*				TR306ON:When recall-type switch,performance  camp new CS list		*/
/*				TR105ON:When recall-type switch,performance camp new CS list		*/
/*					and Stop conditions:	"Synchronization establishment" reception.*/
/*													*/
/*		DISCRIPTION:	begin to monitor cslist							*/
/*		RETURN:											*/
/********************************************************************************************************/
U1 rt_recall_lch_req(void)
{
	if ( Rt_tim & TR305ON )
		return (0);

	if ( Rt_tim & TR304ON )
	{
		rt_tm_stop( TR304ON );

		SYS_WORK->tsk_id = TASKMNG;
		OUT_PRIEVT->evt_cod = ERT;
		OUT_PRIEVT->pri_cod = PSTCHACA;
		OUT_PRIEVT->add_dat = BIT1;
		m_excreq( (WORD*)&SYS_WORK->tsk_id );
	}
	rt_tm_stop( TR103ON );

	Rtlchdat[0] = LCHRQ;  /* set lch establish message info */
	move_up_b( &Rtlchdat[1], (U1*)&IN_LCHEVT->msg_dat[1], 4 );
	Lchercnt = LCHERMAX - IN_LCHEVT->msg_dat[5];

	move_up_b( (U1 *)&Rt_radbak, (U1 *)&Rt_radinf, sizeof(RT_RADINF) ); /* backup the old radio info */
	set_up_b(Rt_rcsid, 0, 7);
	move_up_b(Rt_enc, enc_set, 2);
	txstp_req(TCH1);  /* tx stop */

	Tchre_id = PS_HNDLCH;   /* switch type is recall handover(switch with ps)*/
	rt_tm_start( TR105ON ); /* start timer:the establish lch process */
	rt_tm_start( TR306ON );  /* start timer: camp cs list */

	Rt_mntcnt = 0;   /* inital cslist count */
	Rt_gain = GAIN_M;
	cch_m_req( CCH_HO, SYS_FREQ, SYS_HO_RSSI, Rt_gain, OFF );
	//Rt_sts = ST_CS_REQ;
	Rt_sts = (U1)rt_state_table->state;

	return (3);
}


U1 rt_cchrq(void)
{
	tx_cac[0] = (U1)PRCCHDT;
	move_up_b( &tx_cac[1], (U1*)&IN_LCHEVT->msg_dat[1], 4 );
#ifdef SIMU_ON_PC
		SendUart2L1(SIMTSKDTW,TXCAC, 0 , tx_cac,sizeof(tx_cac));
		ph_dt_req( L1_SCCH, DMY, OFF,0 );
#else
		ph_dt_req( L1_SCCH, DMY, OFF );
#endif

	return (0);
}

U1 rt_csbacktout(void)
{
   	Rt_algo_tim &= ~SYNBSTON;
	if((Rtlchdat[0] & 0x0f) == 0x02)
	{
		Rtlchdat[0]--;
		Rtlchdat[3] &= ~0x78;
	}
	if ( Sys_ccsinf[19] == 0x04 )
	{
		Rtlchdat[3] |= 0x08;
	}
	move_up_b( (U1 *)&Rt_radbak, (U1 *)&Rt_radinf, sizeof(RT_RADINF) );

	move_up_b(Rt_enc, enc_set, 2);
	txstp_req(TCH1);
	set_up_b(Rt_rcsid, 0, 7);

	Tchre_id = PS_HNDLCH;
	rt_tm_start( TR105ON );
	rt_tm_start( TR306ON );

	Rt_mntcnt = 0;
	Rt_gain = GAIN_M;
	cch_m_req( CCH_HO, SYS_FREQ, SYS_HO_RSSI, Rt_gain, OFF );

	//Rt_sts = ST_CS_REQ;
	Rt_sts = (U1)rt_state_table->state;
	Lchercnt = 0;
	return (3);
}

#ifdef __cplusplus
}
#endif

#undef __RTLCHR_C_


#endif

⌨️ 快捷键说明

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