📄 outputriopmsg.cxx
字号:
/************************************************************************
* ModuleName : OutputRIOPMsg.c *
* Copyright : 2001 by CDMA. All rights reserved. *
* Author : ZhouChunxiao *
* Date : 2001.9.26 *
* Description : *
* Version : 1.0 *
* Note: *
* Identifier abbreviation: *
* Update: *
* Date Name Description *
* *
************************************************************************/
#include "CE_CESRIOP.h"
//#include "OutputRIOPMsg.h"
#include "zxc10bss.h" // Oss Definition
#ifdef IP_PLAT
#include "pub_oss.h"
#include "pub_oss_cdma.h"
#include "pub_brs.h"
#endif
#ifdef HIRS_PLAT
#include "oss.h"
#include "ossrsp.h"
#endif
#include "csmtypes.h"
#ifdef HIRS_PLAT
bool bStopAllReport = true;
WORD16 ProcessName[MAX_CHM_OBSERVE_PROC_NUM] =
{
P_CE_Control,
P_CE_Sync,
P_CE_Paging,
P_CE_Access,
P_CE_FwdTraffic,
P_CE_RevTraffic,
P_CE_CSM,
P_CE_OCNS,
P_CE_CMNAPP,
P_CE_Reserved
};
/*----------------------------------------------*/
/* local function declare */
/*----------------------------------------------*/
bool JudgeInputParam( WORD wProcName,WORD wErrId,
WORD wSubErrId, BYTE byPriority,
CHAR *RunInfo , BYTE RunInfoLen );
/************************************************************************
Function Name: void OutputRIOPMsg( BYTE byProcName,
WORD wErrId,
WORD wSubErrId,
BYTE byPriority,
BYTE *RunInfo,...)
Description: process sends running information to RIOP
Input: WORD byProcName: process name,which is a macro name defined in processdef.h
DWORD wErrId : error number.if the low 12 bits are all zero,
then it represents that it is normal message
WORD wSubErrId : if sub-error number exit,it represents sub-error
number, otherwise it is zero
BYTE byPriority: priority is divided to--RUNINFO_PRI_LOW,
RUNINFO_PRI_HIGHER,
RUNINFO_PRI_HIGHEST
BYTE *RunInfo : description of running information
Return value :
author/data: ZhouChunxiao
Note:
Update:
Date Name Description
************************************************************************/
void OutputRIOPMsg( WORD wProcName,
BYTE byInstNo,
WORD wErrId,
WORD wSubErrId,
BYTE byPriority,
CHAR *RunInfo,
... )
{
//BYTE RunInfoLen;
bool bResult;
WORD Signal;
T_SIGNAL InnerSignal;
va_list argList;
uint8 RiopMsg[256 * 2];
uint16 RiopMsgLen;
VPID tSourceVPID;
VPID tDestVPID;
T_VLogicalAddr tSelfLogicAddr;//CHM的逻辑地址
T_VNetAddr tSelfNetAddr; //CHM的网络地址
WORD32 dwPNO;
va_start(argList, RunInfo);
RiopMsgLen = OSS_vsnprintf((char*)RiopMsg,256*2*sizeof(uint8), RunInfo, argList);
va_end(argList);
if(RiopMsgLen > 256)
{
return;
}
bResult = JudgeInputParam(wProcName, wErrId, wSubErrId, byPriority, (char*)RiopMsg, (BYTE)RiopMsgLen);
if( ( bResult == true ) && ( bStopAllReport == false ) )
{
Signal = E_C_C_Signal;
InnerSignal.wProcName = wProcName;
InnerSignal.byInstNo = byInstNo;
InnerSignal.wErrId = wErrId;
InnerSignal.wSubErrId = wSubErrId;
InnerSignal.byPriority = byPriority;
InnerSignal.RunInfoLen = RiopMsgLen;
memcpy(InnerSignal.RunInfoPtr, (char*)RiopMsg, RiopMsgLen);
V_GetVLogicAddress(&tSelfLogicAddr);
V_GetVNetAddress(&tSelfNetAddr);
dwPNO = V_PNO_Construct(P_CE_CESRIOP,1);
tDestVPID = V_VPID_Construct(tSelfNetAddr, tSelfLogicAddr, COMM_RELIABLE, dwPNO);
tSourceVPID = V_VPID_Null();
//OutputFromTask ( Signal, (BYTE *)&InnerSignal, sizeof(T_SIGNAL), PNO_Construct(P_CE_CESRIOP, 1), PID_Null() );
V_OutputFromTask(Signal, (BYTE *)&InnerSignal, sizeof(T_SIGNAL), tSourceVPID,tDestVPID);
}
}
/************************************************************************
Function Name: void JudegInputParam()
Description: judge if input parameters are legal
Input:
Return value : false, if input parameters are legal;
otherwise,return true
author/data: ZhouChunxiao
Note:
Update:
Date Name Description
************************************************************************/
bool JudgeInputParam(WORD wProcName,WORD wErrId,
WORD wSubErrId, BYTE byPriority,
CHAR *RunInfo , BYTE RunInfoLen )
{
BYTE Index;
//BYTE Count;
for ( Index = 0 ; Index < MAX_CHM_OBSERVE_PROC_NUM ; Index++ )
{
if ( wProcName == ProcessName[ Index ] )
{
break;
}
}
if ( Index > MAX_CHM_OBSERVE_PROC_NUM-1 )
{
return FALSE;
}
if ( ( byPriority != RUNINFO_PRI_LOW ) && ( byPriority != RUNINFO_PRI_HIGHER ) &&
( byPriority != RUNINFO_PRI_HIGHEST ) )
{
return FALSE;
}
if( RunInfo == NULL )
{
return FALSE;
}
if( RunInfoLen == 0 )
{
return FALSE;
}
return TRUE;
}
#endif
#ifdef IP_PLAT
void OutputRIOPMsg( WORD wProcName,
BYTE byInstNo,
DWORD wErrId,
WORD wSubErrId,
BYTE byPriority,
CHAR *RunInfo,
... )
{
/*lint -save -e40 -e10 -e920 -e1055*/
va_list argList;
uint8 RiopMsg[255];
uint16 RiopMsgLen;
va_start(argList, RunInfo);
RiopMsgLen = OSS_vsnprintf((char*)RiopMsg,255*sizeof(uint8), RunInfo, argList);
va_end(argList);
/*lint -restore*/
if(RiopMsgLen > 255)
{
return;
}
V_OutputRunInfo(wProcName,wErrId,byPriority,(char*)RiopMsg);
}
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -