示例#1
0
/*****************************************************************************
 Function Name   : NAS_ETC_SndTcPdcpStartTestLoopMsg
 Description     : TC模块向PDCP模块发送START TEST LOOP消息
 Input           : pstTcNwMsgIE--------译码后的空口消息
 Output          : None
 Return          : VOS_VOID


 History         :
    1.lihong00150010      2009-10-15  Draft Enact

*****************************************************************************/
VOS_VOID  NAS_ETC_SndTcPdcpStartTestLoopMsg
(
    const NAS_ETC_NW_MSG_STRU           *pstTcNwMsgIE
)
{
    LTC_LPDCP_START_TEST_LOOP_STRU       *pstTcPdcpStartTestLoop = VOS_NULL_PTR;

    /* 分配空间并检验分配是否成功 */
    pstTcPdcpStartTestLoop = (VOS_VOID*)NAS_ETC_ALLOC_MSG(sizeof(LTC_LPDCP_START_TEST_LOOP_STRU));

    /* 检测是否分配成功 */
    if (VOS_NULL_PTR == pstTcPdcpStartTestLoop)
    {
        /* 打印异常信息 */
        NAS_ETC_ERR_LOG("NAS_ETC_SndTcPdcpStartTestLoopMsg:ERROR:TC->PDCP,Memory Alloc FAIL!");
        return ;
    }

    /* 清空 */
    NAS_ETC_MEM_SET( NAS_ETC_GET_TC_PDCP_MSG_ENTITY(pstTcPdcpStartTestLoop), 0,
                            NAS_ETC_GET_MSG_LENGTH(pstTcPdcpStartTestLoop));

    /* 填写消息头 */
    NAS_ETC_WRITE_PDCP_MSG_HEAD(pstTcPdcpStartTestLoop,ID_LTC_LPDCP_START_TEST_LOOP);

    /* 填写环回模式 */
    pstTcPdcpStartTestLoop->enLoopBackMode = pstTcNwMsgIE->enLoopBackMode;

    /* 填写环回模式具体内容 */
    if (pstTcPdcpStartTestLoop->enLoopBackMode == LLOOP_BACK_MODE_A)
    {
        NAS_ETC_MEM_CPY( &pstTcPdcpStartTestLoop->u.stLBModeA,
                        &pstTcNwMsgIE->stLBModeA,
                        sizeof(LLOOP_BACK_MODE_A_STRU));

    }
    else
    {
        NAS_ETC_MEM_CPY( &pstTcPdcpStartTestLoop->u.stLBModeB,
                        &pstTcNwMsgIE->stLBModeB,
                        sizeof(LLOOP_BACK_MODE_B_STRU));
    }

    /* 调用消息发送函数 */
    NAS_ETC_SND_MSG(pstTcPdcpStartTestLoop);

    /* 打印发送消息 */
    NAS_ETC_NORM_LOG("NAS_ETC_SndTcPdcpStartTestLoopMsg:NORM:Send ID_LTC_LPDCP_START_TEST_LOOP!");
}
/*lint -e961*/
VOS_VOID NAS_ETC_SndAirMsgReportInd
(
    const VOS_UINT8                    *pucData,
    VOS_UINT32                          ulLength,
    NAS_ETC_AIR_MSG_DIR_ENUM_UINT8       enMsgDir,
    OM_PS_AIR_MSG_ENUM_UINT8            enMsgId
)
{
#ifndef PS_ITT_PC_TEST
    DIAG_AIR_MSG_LOG_STRU       stAirMsg;
    VOS_UINT8                  *pucTmpData = VOS_NULL_PTR;

    /*分配空口消息空间*/
    pucTmpData = (VOS_UINT8*)
                        NAS_ETC_MEM_ALLOC(ulLength);

    if(VOS_NULL_PTR== pucTmpData)
    {
        NAS_ETC_ERR_LOG("NAS_ETC_SndAirMsgReportInd: MEM_ALLOC ERR!");
        return;
    }

    NAS_ETC_MEM_CPY(pucTmpData, pucData, ulLength);

    /*设置空口消息方向*/
    if(NAS_ETC_AIR_MSG_DIR_ENUM_UP == enMsgDir)
    {
        stAirMsg.ulId = DIAG_AIR_MSG_LOG_ID(PS_PID_TC, OS_MSG_UL);
        stAirMsg.ulSideId = DIAG_SIDE_NET;
    }
    else
    {
        stAirMsg.ulId = DIAG_AIR_MSG_LOG_ID(PS_PID_TC, OS_MSG_DL);
        stAirMsg.ulSideId = DIAG_SIDE_UE;
    }
    stAirMsg.ulMessageID = (VOS_UINT32)(enMsgId+ PS_MSG_ID_AIR_BASE);
    stAirMsg.ulDestMod = 0;
    stAirMsg.ulDataSize = ulLength;
    stAirMsg.pData = (void*)pucTmpData;

    /*上报空口消息*/
    if(ERR_MSP_SUCCESS != DIAG_ReportAirMessageLog(&stAirMsg))
    {
        NAS_ETC_WARN_LOG("NAS_ETC_SndAirMsgReportInd: Send Msg Fail!");
    }

    /*释放空口消息空间*/
    NAS_ETC_MEM_FREE(pucTmpData);
#endif

    NAS_ETC_NORM_LOG("TC->OMT: PS_OMT_AIR_MSG_REPORT_IND\r");
}