📄 networkfunctions.c
字号:
#endif
#if ( (defined __MMI_EONS_SUPPORT__) && (defined MMI_ON_HARDWARE_P) )
/* diamond, 2005/09/26 support PNN and OPL */
if (is_sim_replaced())
{
mmi_eons_get_opn_file_info_req();
}
else
{
mmi_eons_read_opn_from_nvram();
}
#endif /* ( (defined __MMI_EONS_SUPPORT__) && (defined MMI_ON_HARDWARE_P) ) */
if (g_pwr_context.CurrentServiceType == FULL_SERVICE) /* Robin 1128 */
{
ChangeRoamingState();
}
}
else
{
g_pwr_context.testRoaming = 1;
}
if (g_idle_context.IsOnIdleScreen)
{
EntryIdleScreen();
}
}
/*****************************************************************************
* FUNCTION
* NetWorkCipherIndication
* DESCRIPTION
* Callback function for ciphering indeication
* PARAMETERS
* info [?]
* void*(?)
* RETURNS
* void
*****************************************************************************/
#ifdef _NETWORK_CIPHER_SUPPORT_
void NetWorkCipherIndication(void *info)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
mmi_smu_cipher_ind_struct *local_data = (mmi_smu_cipher_ind_struct*) info;
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
PRINT_INFORMATION(("\n NetWorkCipherIndication\n"));
if (local_data->cipher_ind == 1 && local_data->is_gsm_conn_exist && isInCall())
{
if (local_data->gsm_cipher_cond == GMMREG_CIPHER_OFF)
{
ShowStatusIcon(STATUS_ICON_NETWORK_CIPHER_GSM); /* warning for insecure network */
}
else if (local_data->gsm_cipher_cond == GMMREG_CIPHER_ON ||
local_data->gsm_cipher_cond == GMMREG_CIPHER_INVALID)
{
HideStatusIcon(STATUS_ICON_NETWORK_CIPHER_GSM); /* warning for insecure network */
}
else if (local_data->gprs_cipher_cond == GMMREG_CIPHER_OFF)
{
ShowStatusIcon(STATUS_ICON_NETWORK_CIPHER_GPRS); /* warning for insecure network */
}
else if (local_data->gprs_cipher_cond == GMMREG_CIPHER_ON ||
local_data->gsm_cipher_cond == GMMREG_CIPHER_INVALID)
{
HideStatusIcon(STATUS_ICON_NETWORK_CIPHER_GPRS); /* warning for insecure network */
}
}
else /* cipher not supported */
{
HideStatusIcon(STATUS_ICON_NETWORK_CIPHER_GSM);
HideStatusIcon(STATUS_ICON_NETWORK_CIPHER_GPRS);
}
UpdateStatusIcons();
}
#endif /* _NETWORK_CIPHER_SUPPORT_ */
/**************************************************************************
API of Manual Mode Network Selection
**************************************************************************/
/*****************************************************************************
* FUNCTION
* PLMNSelectionModeIndication
* DESCRIPTION
* Callback function for PLMN selection mode indication
* PARAMETERS
* info [?]
* void*(?)
* RETURNS
* void
*****************************************************************************/
#ifdef __MANUAL_MODE_NW_SEL__
void PLMNSelectionModeIndication(void *info)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
mmi_nw_sel_mode_ind_struct *local_data = (mmi_nw_sel_mode_ind_struct*) info;
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
PRINT_INFORMATION(("\n NetworkSelectionModeIndication\n"));
/* g_pwr_context.PLMNSelectionMode = local_data->network_mode; */
if (local_data->network_mode == MANUAL_MODE)
{
g_pwr_context.PowerOnNWStatus |= MMI_NW_STATUS_PLMNSEL_MODE; /* 0x08: PLMN selection mode */
}
else
{
g_pwr_context.PowerOnNWStatus &= ~MMI_NW_STATUS_PLMNSEL_MODE; /* 0x08: PLMN selection mode */
}
IdleRefreshServiceIndicationArea();
if (g_idle_context.IsOnIdleScreen)
{
IdleSetLRKey();
}
}
/*****************************************************************************
* FUNCTION
* PLMNGetSelectionModeRsp
* DESCRIPTION
* Response for PLMN selection mode
* PARAMETERS
* info [?]
* void*(?)
* RETURNS
* void
*****************************************************************************/
void PLMNGetSelectionModeRsp(void *info)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
mmi_nw_get_plmn_select_mode_rsp_struct *local_data = (mmi_nw_get_plmn_select_mode_rsp_struct*) info;
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
PRINT_INFORMATION(("\n PLMNGetSelectionModeRsp\n"));
/* g_pwr_context.PLMNSelectionMode = local_data->mode; */
if (local_data->mode == MANUAL_MODE)
{
g_pwr_context.PowerOnNWStatus |= MMI_NW_STATUS_PLMNSEL_MODE; /* 0x08: PLMN selection mode */
}
else
{
g_pwr_context.PowerOnNWStatus &= ~MMI_NW_STATUS_PLMNSEL_MODE; /* 0x08: PLMN selection mode */
}
ClearProtocolEventHandler(MSG_ID_MMI_NW_GET_PLMN_SELECT_MODE_RSP);
return;
}
/*****************************************************************************
* FUNCTION
* PLMNGetSelectionModeReq
* DESCRIPTION
* Request for PLMN selection mode
* PARAMETERS
* void
* RETURNS
* void
*****************************************************************************/
void PLMNGetSelectionModeReq(void)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
MYQUEUE msgStruct;
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
SetProtocolEventHandler(PLMNGetSelectionModeRsp, MSG_ID_MMI_NW_GET_PLMN_SELECT_MODE_RSP);
/* format the message to get band selection */
msgStruct.oslSrcId = MOD_MMI;
msgStruct.oslDestId = MOD_L4C;
msgStruct.oslMsgId = (unsigned int)MSG_ID_MMI_NW_GET_PLMN_SELECT_MODE_REQ;
msgStruct.oslSapId = (unsigned int)0;
msgStruct.oslDataPtr = NULL;
msgStruct.oslPeerBuffPtr = NULL;
/* send req to l4 to get band selection */
OslMsgSendExtQueue(&msgStruct);
return;
}
#endif /* __MANUAL_MODE_NW_SEL__ */
/**************************************************************************
GPRS API
**************************************************************************/
#ifdef WAP_SUPPORT
/*****************************************************************************
* FUNCTION
* mmi_netset_update_gprs_state_to_wap
* DESCRIPTION
* Send GPRS state to WAP
* PARAMETERS
* state [IN]
* RETURNS
* void
*****************************************************************************/
static void mmi_netset_update_gprs_state_to_wap(U8 state)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
MYQUEUE msgStruct;
wap_bearer_status_ind_struct *local_data;
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
if (wap_browser_is_open())
{
msgStruct.oslSrcId = MOD_MMI;
msgStruct.oslDestId = MOD_WAP;
msgStruct.oslMsgId = MSG_ID_WAP_BEARER_STATUS_IND;
local_data = (wap_bearer_status_ind_struct*) OslConstructDataPtr(sizeof(wap_bearer_status_ind_struct));
local_data->bearer_type = WAP_BEARER_STATUS_GPRS;
local_data->status = state;
msgStruct.oslDataPtr = (oslParaType*) local_data;
msgStruct.oslPeerBuffPtr = NULL;
OslMsgSendExtQueue(&msgStruct);
}
}
#endif /* WAP_SUPPORT */
/*****************************************************************************
* FUNCTION
* GPRSStatusUpdateIndication
* DESCRIPTION
* Callback function for GPRS status update indication
* PARAMETERS
* info [?]
* void*(?)
* RETURNS
* void
*****************************************************************************/
void GPRSStatusUpdateIndication(void *info)
{
#ifdef __MMI_GPRS_FEATURES__
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
mmi_ps_gprs_status_update_ind_struct *local_data = (mmi_ps_gprs_status_update_ind_struct*) info;
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
PRINT_INFORMATION(("\n GPRSStatusUpdateIndication\n"));
UpdateGPRSStatusIcon(local_data->status);
if (gGPRSStatusModified)
{
UpdateStatusIcons();
gGPRSStatusModified = 0;
}
#endif /* __MMI_GPRS_FEATURES__ */
}
/*****************************************************************************
* FUNCTION
* GPRSStatusGetGPRSModeRsp
* DESCRIPTION
* Response for GPRS mode
* PARAMETERS
* info [?]
* void*(?)
* RETURNS
* void
*****************************************************************************/
void GPRSStatusGetGPRSModeRsp(void *info)
{
#ifdef __MMI_GPRS_FEATURES__
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
mmi_nw_get_gprs_connect_type_rsp_struct *localPtr;
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
localPtr = (mmi_nw_get_gprs_connect_type_rsp_struct*) info;
if (localPtr->result == MMI_TRUE)
{
if (localPtr->type == L4C_WHEN_NEEDED)
{
GPRSStatusDetachGPRSReq();
}
}
#endif /* __MMI_GPRS_FEATURES__ */
}
/*****************************************************************************
* FUNCTION
* GPRSStatusGetGPRSModeReq
* DESCRIPTION
* Request for GPRS mode
* PARAMETERS
* void
* void*(?)
* RETURNS
* void
*****************************************************************************/
void GPRSStatusGetGPRSModeReq(void)
{
#ifdef __MMI_GPRS_FEATURES__
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
MYQUEUE msgStruct;
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
SetProtocolEventHandler(GPRSStatusGetGPRSModeRsp, MSG_ID_MMI_NW_GET_GPRS_CONNECT_TYPE_RSP);
/* format the message to get band selection */
msgStruct.oslSrcId = MOD_MMI;
msgStruct.oslDestId = MOD_L4C;
msgStruct.oslMsgId = (unsigned int)MSG_ID_MMI_NW_GET_GPRS_CONNECT_TYPE_REQ;
msgStruct.oslSapId = (unsigned int)0;
msgStruct.oslDataPtr = NULL;
msgStruct.oslPeerBuffPtr = NULL;
/* send req to l4 to get band selection */
OslMsgSendExtQueue(&msgStruct);
return;
#endif /* __MMI_GPRS_FEATURES__ */
}
/*****************************************************************************
* FUNCTION
* GPRSStatusDetachGPRSRsp
* DESCRIPTION
* Response for GPRS detachment
* PARAMETERS
* info [?]
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -