VOS_VOID NAS_UTRANCTRL_RegFsm( VOS_VOID  )
{
    /* 主处理注册 */
    NAS_FSM_RegisterFsm(NAS_UTRANCTRL_GetMainFsmDescAddr(),
                         "NAS_UTRANCTRL:FSM:MainProcess",
                         NAS_UTRANCTRL_GetMainProcessStaTblSize(),
                         NAS_UTRANCTRL_GetMainProcessStaTbl(),
                         VOS_NULL_PTR,
                         NAS_UTRANCTRL_InitFsmCtx_Main);


    /* 开机状态机注册 */
    NAS_FSM_RegisterFsm(NAS_UTRANCTRL_GetSwitchOnFsmDescAddr(),
                         "NAS_UTRANCTRL:FSM:SwitchOnProcess",
                         NAS_UTRANCTRL_GetSwitchOnStaTblSize(),
                         NAS_UTRANCTRL_GetSwitchOnStaTbl(),
                         VOS_NULL_PTR,
                         NAS_UTRANCTRL_InitFsmCtx_SwitchOn);

    /* 关机状态机注册 */
    NAS_FSM_RegisterFsm(NAS_UTRANCTRL_GetPowerOffFsmDescAddr(),
                         "NAS_UTRANCTRL:FSM:PowerOffProcess",
                         NAS_UTRANCTRL_GetPowerOffStaTblSize(),
                         NAS_UTRANCTRL_GetPowerOffStaTbl(),
                         VOS_NULL_PTR,
                         NAS_UTRANCTRL_InitFsmCtx_PowerOff);

    /* 搜网状态机注册 */
    NAS_FSM_RegisterFsm(NAS_UTRANCTRL_GetPlmnSelectionFsmDescAddr(),
                         "NAS_UTRANCTRL:FSM:PlmnSelectionProcess",
                         NAS_UTRANCTRL_GetPlmnSelectionStaTblSize(),
                         NAS_UTRANCTRL_GetPlmnSelectionStaTbl(),
                         VOS_NULL_PTR,
                         NAS_UTRANCTRL_InitFsmCtx_PlmnSelection);

    /* SYSCFG状态机注册 */
    NAS_FSM_RegisterFsm(NAS_UTRANCTRL_GetSysCfgFsmDescAddr(),
                         "NAS_UTRANCTRL:FSM:SYSCFG",
                         NAS_UTRANCTRL_GetSysCfgStaTblSize(),
                         NAS_UTRANCTRL_GetSysCfgStaTbl(),
                         VOS_NULL_PTR,
                         NAS_UTRANCTRL_InitFsmCtx_Syscfg);

    /* mode change状态机注册 */
    NAS_FSM_RegisterFsm(NAS_UTRANCTRL_GetModeChangeFsmDescAddr(),
                         "NAS_UTRANCTRL:FSM:ModeChange",
                         NAS_UTRANCTRL_GetModeChangeStaTblSize(),
                         NAS_UTRANCTRL_GetModeChangeStaTbl(),
                         VOS_NULL_PTR,
                         NAS_UTRANCTRL_InitFsmCtx_ModeChange);


    return;
}
VOS_VOID  NAS_UTRANCTRL_InitCurrFsmCtx(
    NAS_UTRANCTRL_FSM_CTX_STRU         *pstCurrFsmCtx
)
{
    pstCurrFsmCtx->enFsmId                = NAS_UTRANCTRL_FSM_MAIN;
    pstCurrFsmCtx->pstFsmDesc             = NAS_UTRANCTRL_GetMainFsmDescAddr();
    pstCurrFsmCtx->ulState                = NAS_UTRANCTRL_MAIN_STA_INIT;
    pstCurrFsmCtx->stEntryMsg.ulEventType = 0;

    PS_MEM_SET(pstCurrFsmCtx->stEntryMsg.aucEntryMsgBuffer,
               0x00,
               NAS_UTRANCTRL_MAX_MSG_BUFFER_LEN);
}
VOS_VOID NAS_UTRANCTRL_ReloadFsmDesc(
    NAS_UTRANCTRL_FSM_CTX_STRU         *pstFsmCtx,
    VOS_UINT32                          ulPcRecurFsmId
)
{
    switch ( ulPcRecurFsmId )
    {
        case NAS_UTRANCTRL_FSM_MAIN:
            pstFsmCtx->pstFsmDesc       = NAS_UTRANCTRL_GetMainFsmDescAddr();
            break;

        case NAS_UTRANCTRL_FSM_SWITCH_ON:
            pstFsmCtx->pstFsmDesc       = NAS_UTRANCTRL_GetSwitchOnFsmDescAddr();
            break;

        case NAS_UTRANCTRL_FSM_POWER_OFF:
            pstFsmCtx->pstFsmDesc       = NAS_UTRANCTRL_GetPowerOffFsmDescAddr();
            break;

        case NAS_UTRANCTRL_FSM_PLMN_SELECTION:
            pstFsmCtx->pstFsmDesc       = NAS_UTRANCTRL_GetPlmnSelectionFsmDescAddr();
            break;

        case NAS_UTRANCTRL_FSM_SYSCFG:
            pstFsmCtx->pstFsmDesc       = NAS_UTRANCTRL_GetSysCfgFsmDescAddr();
            break;

        case NAS_UTRANCTRL_FSM_MODE_CHANGE:
            pstFsmCtx->pstFsmDesc       = NAS_UTRANCTRL_GetModeChangeFsmDescAddr();
            break;

        default:
            break;
    }

}
VOS_VOID  NAS_UTRANCTRL_SwitchCurrFsmCtx(
    NAS_UTRANCTRL_FSM_ID_ENUM_UINT32    enNewFsmId
)
{
    NAS_UTRANCTRL_FSM_CTX_STRU         *pstCurFsmCtx;
    NAS_UTRANCTRL_CTX_STRU             *pstCtx;

    pstCtx          = NAS_UTRANCTRL_GetUtranCtrlCtx();
    pstCurFsmCtx    = &(pstCtx->stCurFsm);

    if (VOS_NULL_PTR == pstCurFsmCtx->pstFsmDesc)
    {
        NAS_ERROR_LOG(WUEPS_PID_MMC, "NAS_UTRANCTRL_SwitchCurrFsmCtx:Invalid pstFsmDesc");
    }

    switch (enNewFsmId)
    {
        case NAS_UTRANCTRL_FSM_MAIN:
            pstCurFsmCtx->enFsmId                = enNewFsmId;
            pstCurFsmCtx->pstFsmDesc             = NAS_UTRANCTRL_GetMainFsmDescAddr();
            pstCurFsmCtx->ulState                = NAS_UTRANCTRL_MAIN_STA_INIT;
            break;

        case NAS_UTRANCTRL_FSM_SWITCH_ON:
            pstCurFsmCtx->enFsmId                = enNewFsmId;
            pstCurFsmCtx->pstFsmDesc             = NAS_UTRANCTRL_GetSwitchOnFsmDescAddr();
            pstCurFsmCtx->ulState                = NAS_UTRANCTRL_SWITCH_ON_STA_INIT;
            break;

        case NAS_UTRANCTRL_FSM_POWER_OFF:
            pstCurFsmCtx->enFsmId                = enNewFsmId;
            pstCurFsmCtx->pstFsmDesc             = NAS_UTRANCTRL_GetPowerOffFsmDescAddr();
            pstCurFsmCtx->ulState                = NAS_UTRANCTRL_POWER_OFF_STA_INIT;
            break;

        case NAS_UTRANCTRL_FSM_PLMN_SELECTION:
            pstCurFsmCtx->enFsmId                = enNewFsmId;
            pstCurFsmCtx->pstFsmDesc             = NAS_UTRANCTRL_GetPlmnSelectionFsmDescAddr();
            pstCurFsmCtx->ulState                = NAS_UTRANCTRL_PLMN_SELECTION_STA_INIT;
            break;

        case NAS_UTRANCTRL_FSM_SYSCFG:
            pstCurFsmCtx->enFsmId                = enNewFsmId;
            pstCurFsmCtx->pstFsmDesc             = NAS_UTRANCTRL_GetSysCfgFsmDescAddr();
            pstCurFsmCtx->ulState                = NAS_UTRANCTRL_SYSCFG_STA_INIT;
            break;

        case NAS_UTRANCTRL_FSM_MODE_CHANGE:
            pstCurFsmCtx->enFsmId                = enNewFsmId;
            pstCurFsmCtx->pstFsmDesc             = NAS_UTRANCTRL_GetModeChangeFsmDescAddr();
            pstCurFsmCtx->ulState                = NAS_UTRANCTRL_MODE_CHANGE_STA_INIT;
            break;

        default:
            NAS_ERROR_LOG(WUEPS_PID_MMC, "NAS_UTRANCTRL_SwitchCurrFsmCtx:Invalid Fsm Id");

            return;
    }

    /* 初始化UTRANCTRL状态机上下文 */
    pstCurFsmCtx->pstFsmDesc->pfInitHandle();

    /* 可维可测状态机信息打印 */
    NAS_UTRANCTRL_SndOmUtranCtrlFsmInfo();

    return;
}