/*****************************************************************************
 Function Name  : IMSA_SndMmaMsgStopCnf()
 Description    : 给MMA发送开机回复消息
 Input          : VOS_VOID
 Output         : VOS_VOID
 Return Value   : VOS_VOID

 History        :
      1.sunbing 49683      2013-06-21  Draft Enact
*****************************************************************************/
VOS_VOID IMSA_SndMmaMsgStopCnf(VOS_VOID  )
{
    IMSA_MMA_STOP_CNF_STRU           *pstImsaMmaStopCnf;

    IMSA_INFO_LOG("IMSA_SndMmaMsgStopCnf:enter!");

    /*分配空间并检验分配是否成功*/
    pstImsaMmaStopCnf = (VOS_VOID*)IMSA_ALLOC_MSG(sizeof(IMSA_MMA_STOP_CNF_STRU));

    /*检测是否分配成功*/
    if (VOS_NULL_PTR == pstImsaMmaStopCnf)
    {
        /*打印异常信息*/
        IMSA_ERR_LOG("IMSA_SndMmaMsgStopCnf:ERROR:Alloc Msg fail!");
        return ;
    }

    /*清空*/
    IMSA_MEM_SET( IMSA_GET_MSG_ENTITY(pstImsaMmaStopCnf), 0, IMSA_GET_MSG_LENGTH(pstImsaMmaStopCnf));

    /*填写消息头*/
    IMSA_WRITE_MMA_MSG_HEAD(pstImsaMmaStopCnf, ID_IMSA_MMA_STOP_CNF);

    /*调用消息发送函数 */
    IMSA_SND_MSG(pstImsaMmaStopCnf);
}
 VOS_VOID IMSA_SndMmaMsgImsVoiceCapNotify(MMA_IMSA_IMS_VOICE_CAP_ENUM_UINT8 enImsVoiceCap)
 {
     IMSA_MMA_IMS_VOICE_CAP_NOTIFY_STRU     *pstImsaMmaImsVoiceCap;

     /*分配空间并检验分配是否成功*/
     pstImsaMmaImsVoiceCap = (VOS_VOID*)IMSA_ALLOC_MSG(sizeof(IMSA_MMA_IMS_VOICE_CAP_NOTIFY_STRU));

     /*检测是否分配成功*/
     if (VOS_NULL_PTR == pstImsaMmaImsVoiceCap)
     {
         /*打印异常信息*/
         IMSA_ERR_LOG("IMSA_SndMmaMsgDeregCnf:ERROR:Alloc Msg fail!");
         return ;
     }

     /*清空*/
     IMSA_MEM_SET( IMSA_GET_MSG_ENTITY(pstImsaMmaImsVoiceCap), 0, IMSA_GET_MSG_LENGTH(pstImsaMmaImsVoiceCap));

     /*填写消息头*/
     IMSA_WRITE_MMA_MSG_HEAD(pstImsaMmaImsVoiceCap, ID_IMSA_MMA_IMS_VOICE_CAP_NOTIFY);


     pstImsaMmaImsVoiceCap->enImsVoiceCap = enImsVoiceCap;

     /*调用消息发送函数 */
     IMSA_SND_MSG(pstImsaMmaImsVoiceCap);
 }
VOS_VOID IMSA_SndMsgRnicPdnDeactInd(VOS_UINT8 ucPdpId)
{
    IMSA_RNIC_PDN_DEACT_IND_STRU          *pstRnicPdnDeactInd;
    /*VOS_UINT8                              aucTemp[IMSA_IPV6_ADDR_PREFIX_LEN]   = {0};*/

    /*分配消息空间*/
    pstRnicPdnDeactInd = (VOS_VOID*)IMSA_ALLOC_MSG(sizeof(IMSA_RNIC_PDN_DEACT_IND_STRU));

    /*检测是否分配成功*/
    if (VOS_NULL_PTR == pstRnicPdnDeactInd)
    {
        /*打印异常信息*/
        IMSA_ERR_LOG("IMSA_SndMsgRnicPdnActInd:ERROR:Alloc Msg fail!");
        return ;
    }

    IMSA_MEM_SET( IMSA_GET_MSG_ENTITY(pstRnicPdnDeactInd), 0, IMSA_GET_MSG_LENGTH(pstRnicPdnDeactInd));

    IMSA_WRITE_RNIC_MSG_HEAD(pstRnicPdnDeactInd,ID_IMSA_RNIC_PDN_DEACT_IND);

    /*填写消息内容*/
    pstRnicPdnDeactInd->ucRabId = ucPdpId;
    pstRnicPdnDeactInd->enModemId = MODEM_ID_0;

    /*调用消息发送函数 */
    IMSA_SND_MSG(pstRnicPdnDeactInd);

    return;
}
示例#4
0
/*****************************************************************************
 Function Name  : IMSA_GetIntraMsgBuffAddr
 Discription    : 获取发送内部消息的地址
                  发送内部消息的过程为:
                    1.申请内部消息地址,
                    2.填充内部消息内容
                    3.发送内部消息
 Input          : 消息长度:该长度含义同DOPRA申请消息时的长度,即不包括
                    消息头 VOS_MSG_HEADER的长度
 Output         : None
 Return         : 消息地址
 History:
       1.sunbing 49683      2013-06-25  Draft Enact
*****************************************************************************/
VOS_VOID *IMSA_GetIntraMsgBuffAddr( VOS_UINT32 ulBuffSize )
{
    IMSA_INTRA_MSG_QUEUE_STRU          *pstIntraMsgQueue;
    VOS_UINT8                          *pucMsgBuff;
    IMSA_INTRA_MSG                     *pstIntraMsgHead;

    if ( (0 == ulBuffSize) || (IMSA_INTRA_MSG_MAX_SIZE < ulBuffSize ) )
    {
        /* 打印错误信息 */
        /*lint -e961*/
        IMSA_ERR_LOG1("IMSA_GetIntraMsgBuffAddr: Size error, ", ulBuffSize);
        /*lint +e961*/

        return VOS_NULL_PTR;
    }

    /* 获取队列地址 */
    pstIntraMsgQueue = IMSA_GetIntraMsgQueueAddress();

    /* 验证是否队列满,留出一个消息不使用,避免正在处理的消息空间被分配出去 */
    if ( ((pstIntraMsgQueue->usTail + 1 + 1) % IMSA_INTRA_MSG_MAX_NUM) != pstIntraMsgQueue->usHeader )
    {
        pucMsgBuff = pstIntraMsgQueue->aucMsgBuff[pstIntraMsgQueue->usTail];

        /* 将申请的缓冲区清0 */
        IMSA_MEM_SET(pucMsgBuff, 0, IMSA_INTRA_MSG_MAX_SIZE);

        /*lint -e826*/
        pstIntraMsgHead                = (IMSA_INTRA_MSG *)pucMsgBuff;
        /*lint -e826*/

        /* 填写内部消息消息头中的长度域,需要减去OSA消息头长度 */
        pstIntraMsgHead->ulLength      = ulBuffSize - 20;

        return (VOS_VOID *)pucMsgBuff;
    }
    else
    {
        /* 打印错误信息 */
        IMSA_ERR_LOG("IMSA_GetIntraMsgBuffAddr: Queue full!");

        return VOS_NULL_PTR;
    }

}
/*****************************************************************************
 Function Name  : IMSA_SMS_SndMsgDataInd()
 Description    : 发送Data ind消息
 Input          : ucData MSG内容,ulDataLen MSG长度
 Output         : VOS_VOID
 Return Value   : VOS_VOID

 History        :
      1.sunbing 49683      2013-08-10  Draft Enact
*****************************************************************************/
VOS_VOID IMSA_SMS_SndMsgDataInd(const VOS_UINT8* ucData, VOS_UINT32 ulDataLen)
{
    IMSA_MSG_DATA_IND_STRU      *pstDataInd;
    VOS_UINT32                   ulMsgDataLen;

    if(ulDataLen < 4)
    {
        ulMsgDataLen = sizeof(IMSA_MSG_DATA_IND_STRU);
    }
    else
    {
        /*lint -e961*/
        ulMsgDataLen = sizeof(IMSA_MSG_DATA_IND_STRU)+ ulDataLen -4;
        /*lint +e961*/
    }

    /*分配消息空间*/
    pstDataInd = (VOS_VOID*)IMSA_ALLOC_MSG(ulMsgDataLen);

    /*检测是否分配成功*/
    if (VOS_NULL_PTR == pstDataInd)
    {
        /*打印异常信息*/
        IMSA_ERR_LOG("IMSA_SMS_SndMsgDataInd:ERROR:Alloc Msg fail!");
        return ;
    }

    IMSA_MEM_SET(IMSA_GET_MSG_ENTITY_BY_NAME(pstDataInd),0,\
                 IMSA_GET_MSG_LENGTH(pstDataInd));
    /*lint -e960*/
    IMSA_WRITE_MSG_MSG_HEAD(pstDataInd,ID_IMSA_MSG_DATA_IND);
    /*lint +e960*/
    /*短信接受域为PS域*/
    pstDataInd->ucRcvDomain = 0;

    /*填写SMS内容*/
    pstDataInd->ulDataLen  = ulDataLen;
    IMSA_MEM_CPY(pstDataInd->aucData,ucData,ulDataLen);

    /*调用消息发送函数 */
    IMSA_SND_MSG(pstDataInd);

}
/*****************************************************************************
 Function Name  : IMSA_SMS_SndMsgReportInd()
 Description    : 发送report消息
 Input          : ucData MSG内容,ulDataLen MSG长度
 Output         : VOS_VOID
 Return Value   : VOS_VOID

 History        :
      1.sunbing 49683      2013-08-10  Draft Enact
*****************************************************************************/
VOS_VOID IMSA_SMS_SndMsgReportInd(VOS_UINT32 ulErrCode,
                                              const VOS_UINT8* pucData,
                                              VOS_UINT32 ulDataLen)
{
    IMSA_MSG_REPORT_IND_STRU    *pstReportInd;

    /*超长短信*/
    if(ulDataLen > SMR_SMT_RP_USER_DATA_LENGTH)
    {
        /*打印异常信息*/
        IMSA_ERR_LOG("IMSA_SMS_SndMsgReportInd:Length is too long!");
        return ;
    }

    /*分配消息空间*/
    pstReportInd = (VOS_VOID*)IMSA_ALLOC_MSG(sizeof(IMSA_MSG_REPORT_IND_STRU));

    /*检测是否分配成功*/
    if (VOS_NULL_PTR == pstReportInd)
    {
        /*打印异常信息*/
        IMSA_ERR_LOG("IMSA_SMS_SndMsgReportInd:ERROR:Alloc Msg fail!");
        return ;
    }

    IMSA_MEM_SET(IMSA_GET_MSG_ENTITY_BY_NAME(pstReportInd),0,\
                 IMSA_GET_MSG_LENGTH(pstReportInd));
    /*lint -e960*/
    IMSA_WRITE_MSG_MSG_HEAD(pstReportInd,ID_IMSA_MSG_REPORT_IND);
    /*lint +e960*/
    /*填写SMS内容*/
    pstReportInd->enErrorCode           = ulErrCode;

    if(VOS_NULL_PTR != pucData)
    {
        pstReportInd->stRpduData.ulDataLen  = ulDataLen;
        IMSA_MEM_CPY(pstReportInd->stRpduData.aucData,pucData,ulDataLen);
    }

    /*调用消息发送函数 */
    IMSA_SND_MSG(pstReportInd);

}
VOS_VOID IMSA_SndMsgRnicPdnActInd(const IMSA_PDP_CNTXT_INFO_STRU     *pstPdpInfo)
{

    IMSA_RNIC_PDN_ACT_IND_STRU          *pstRnicPdnActInd;
    VOS_UINT8                           aucTemp[IMSA_IPV6_ADDR_PREFIX_LEN]   = {0};

    IMSA_NORM_LOG("IMSA_SndMsgRnicPdnActInd enter!");

    /*分配消息空间*/
    pstRnicPdnActInd = (VOS_VOID*)IMSA_ALLOC_MSG(sizeof(IMSA_RNIC_PDN_ACT_IND_STRU));

    /*检测是否分配成功*/
    if (VOS_NULL_PTR == pstRnicPdnActInd)
    {
        /*打印异常信息*/
        IMSA_ERR_LOG("IMSA_SndMsgRnicPdnActInd:ERROR:Alloc Msg fail!");
        return ;
    }

    IMSA_MEM_SET( IMSA_GET_MSG_ENTITY(pstRnicPdnActInd), 0, IMSA_GET_MSG_LENGTH(pstRnicPdnActInd));

    IMSA_WRITE_RNIC_MSG_HEAD(pstRnicPdnActInd,ID_IMSA_RNIC_PDN_ACT_IND);

    /*填写消息内容*/
    pstRnicPdnActInd->stPdnInfo.ucRabId = pstPdpInfo->ucPdpId;
    pstRnicPdnActInd->stPdnInfo.enModemId = MODEM_ID_0;

    if ((IMSA_IP_TYPE_IPV4 == pstPdpInfo->stPdpAddr.enIpType)
        || (IMSA_IP_TYPE_IPV4V6 == pstPdpInfo->stPdpAddr.enIpType))
    {
        /* 配置IPV4地址 */
        pstRnicPdnActInd->stPdnInfo.bitOpIpv4PdnInfo    = IMSA_OP_TRUE;
        IMSA_MEM_CPY(   pstRnicPdnActInd->stPdnInfo.stIpv4PdnInfo.aucIpV4Addr,
                        pstPdpInfo->stPdpAddr.aucIpV4Addr,
                        IMSA_IPV4_ADDR_LEN);

        /* 配置IPV4 DNS地址 */
        pstRnicPdnActInd->stPdnInfo.stIpv4PdnInfo.bitOpDnsPrim = pstPdpInfo->stPdpIpv4Dns.bitOpPriDns;
        IMSA_MEM_CPY(   pstRnicPdnActInd->stPdnInfo.stIpv4PdnInfo.aucDnsPrimAddr,
                        pstPdpInfo->stPdpIpv4Dns.aucPriDns,
                        IMSA_IPV4_ADDR_LEN);

        pstRnicPdnActInd->stPdnInfo.stIpv4PdnInfo.bitOpDnsSec = pstPdpInfo->stPdpIpv4Dns.bitOpSecDns;
        IMSA_MEM_CPY(   pstRnicPdnActInd->stPdnInfo.stIpv4PdnInfo.aucDnsSecAddr,
                        pstPdpInfo->stPdpIpv4Dns.aucSecDns,
                        IMSA_IPV4_ADDR_LEN);
    }

    if ((IMSA_IP_TYPE_IPV6 == pstPdpInfo->stPdpAddr.enIpType)
        || (IMSA_IP_TYPE_IPV4V6 == pstPdpInfo->stPdpAddr.enIpType))
    {
        if (0 != IMSA_MEM_CMP(aucTemp, pstPdpInfo->stPdpAddr.aucIpV6Addr, IMSA_IPV6_ADDR_PREFIX_LEN))
        {
            /* 配置IPV6地址 */
            pstRnicPdnActInd->stPdnInfo.bitOpIpv6PdnInfo    = IMSA_OP_TRUE;
            pstRnicPdnActInd->stPdnInfo.stIpv6PdnInfo.ulBitPrefixLen = IMSA_IPV6_ADDR_PREFIX_BIT_LEN;
            IMSA_MEM_CPY(   pstRnicPdnActInd->stPdnInfo.stIpv6PdnInfo.aucIpV6Addr,
                            pstPdpInfo->stPdpAddr.aucIpV6Addr,
                            IMSA_IPV6_ADDR_LEN);

            /* 配置IPV6 DNS地址 */
            pstRnicPdnActInd->stPdnInfo.stIpv6PdnInfo.bitOpDnsPrim = pstPdpInfo->stPdpIpv6Dns.bitOpPriDns;
            IMSA_MEM_CPY(   pstRnicPdnActInd->stPdnInfo.stIpv6PdnInfo.aucDnsPrimAddr,
                            pstPdpInfo->stPdpIpv6Dns.aucPriDns,
                            IMSA_IPV6_ADDR_LEN);

            pstRnicPdnActInd->stPdnInfo.stIpv6PdnInfo.bitOpDnsSec = pstPdpInfo->stPdpIpv6Dns.bitOpSecDns;
            IMSA_MEM_CPY(   pstRnicPdnActInd->stPdnInfo.stIpv6PdnInfo.aucDnsSecAddr,
                            pstPdpInfo->stPdpIpv6Dns.aucSecDns,
                            IMSA_IPV6_ADDR_LEN);
        }
    }

    /*调用消息发送函数 */
    IMSA_SND_MSG(pstRnicPdnActInd);
    return;
}