Beispiel #1
0
VOS_UINT32 TAF_SPM_RegFsm( VOS_VOID  )
{
    /* 预处理注册 */
    TAF_FSM_RegisterFsm((TAF_SPM_GetPreFsmDescAddr()),
                         "TAF_SPM:FSM:PreProcess",
                         TAF_SPM_GetPreProcessStaTblSize(),
                         TAF_SPM_GetPreProcessStaTbl(),
                         VOS_NULL_PTR,
                         VOS_NULL_PTR);

    /* 主处理状态机注册 */
    TAF_FSM_RegisterFsm(TAF_SPM_GetMainFsmDescAddr(),
                         "TAF_SPM:FSM:MainProcess",
                         TAF_SPM_GetMainProcessStaTblSize(),
                         TAF_SPM_GetMainProcessStaTbl(),
                         VOS_NULL_PTR,
                         TAF_SPM_InitFsmCtx_Main);

    /* service ctrl状态机注册 */
    TAF_FSM_RegisterFsm(TAF_SPM_GetServiceCtrlFsmDescAddr(),
                         "TAF_SPM:FSM:ServiceCtrlProcess",
                         TAF_SPM_GetServiceCtrlStaTblSize(),
                         TAF_SPM_GetServiceCtrlProcessStaTbl(),
                         VOS_NULL_PTR,
                         TAF_SPM_InitFsmCtx_ServiceCtrl);


    return VOS_TRUE;
}
VOS_UINT32 TAF_SPM_RcvAppReqMsg_Main(
    VOS_UINT32                          ulEventType,
    struct MsgCB                       *pstMsg
)
{
    VOS_UINT16                          usClientId;
    VOS_UINT8                           ucOpId;
    VOS_UINT8                           ucIdleFsmIndex;

    TAF_SPM_GetClientIdWithAppMsg(pstMsg, &usClientId);
    TAF_SPM_GetOpIdWithAppMsg(pstMsg, &ucOpId);

    /* 判断是否有存在空闲状态机 */
    ucIdleFsmIndex = TAF_SPM_GetIdleEntityFsmIndex();

    if (TAF_SPM_INVALID_CLIENT_ID_ENTITY_FSM_INDEX == ucIdleFsmIndex)
    {
        TAF_WARNING_LOG(WUEPS_PID_TAF, "TAF_SPM_RcvAppReqMsg_Main():WARNING: No Idle Entiy Fsm Exist!");

        /* 临时响应改为正式响应 */
        TAF_SPM_SendServiceRequetFail_Main(ulEventType, pstMsg, MN_ERR_CLASS_SPM_BEYOND_CONCURRENCY_CAPABILITY);

#if (FEATURE_ON == FEATURE_IMS)
        TAF_SPM_SetEconfPreRslt(TAF_CS_CAUSE_UNKNOWN);

        TAF_SPM_ReportEconfCheckRslt();
#endif
    }
    else
    {
        /* 设置当前状态机的索引 */
        TAF_SPM_SetCurrEntityFsmAddr(ucIdleFsmIndex);

        /* 设置当前client ID实体状态机的client ID */
        TAF_SPM_SetCurrEntityFsmClientId(usClientId);

        /* 启动service ctrl状态机,进行fdn&CALL control检查 */
        TAF_SPM_FSM_InitEntityFsm(TAF_SPM_FSM_SERVICE_CTRL,
                                  TAF_SPM_GetServiceCtrlFsmDescAddr(),
                                  TAF_SPM_SERVICE_CTRL_STA_INIT);
    }

    return VOS_TRUE;
}