PoCCallManagement.c
资源名称:mmi.rar [点击查看]
上传用户:lqx1163
上传日期:2014-08-13
资源大小:9183k
文件大小:222k
源码类别:
MTK
开发平台:
C/C++
- /*****************************************************************************
- * Copyright Statement:
- * --------------------
- * This software is protected by Copyright and the information contained
- * herein is confidential. The software may not be copied and the information
- * contained herein may not be used or disclosed except with the written
- * permission of MediaTek Inc. (C) 2005
- *
- * BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
- * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
- * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
- * AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
- * NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
- * SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
- * SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
- * THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
- * NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
- * SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
- *
- * BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
- * LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
- * AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
- * OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
- * MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
- *
- * THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
- * WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
- * LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
- * RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
- * THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
- *
- *****************************************************************************/
- /*****************************************************************************
- *
- * Filename:
- * ---------
- * PoCCallManagement.c
- *
- * Project:
- * --------
- * MAUI
- *
- * Description:
- * ------------
- * This file implements poc management functions
- *
- * Author:
- * -------
- * -------
- *
- ==============================================================
- * HISTORY
- * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
- *------------------------------------------------------------------------------
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- *------------------------------------------------------------------------------
- * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
- *=============================================================
- *******************************************************************************/
- #include "MMI_features.h"
- /* micha_PoC */
- #ifdef __MMI_POC__
- #ifndef __MTK_TARGET__
- #include <Windows.h>
- #endif
- #include "stdC.h"
- #include "L4Dr1.h"
- #include "mdi_datatype.h"
- #include "DebugInitDef.h"
- #include "mmi_trc.h" /* debug info */
- #include "GlobalMenuItems.h"
- #include "CustMenuRes.h"
- #include "CustDataRes.h"
- #include "ProtocolEvents.h"
- #include "CommonScreens.h"
- #include "EventsGprot.h"
- #include "SettingProfile.h"
- #include "wgui_categories_popup.h"
- #include "wgui_categories_inputs.h"
- #include "wgui_status_icons.h" /* for STATUS_ICON */
- #include "mdi_include.h"
- #include "mdi_audio.h"
- #include "CallmanagementIdDef.h"
- #include "custom_data_account.h"
- #include "DataAccountGProt.h"
- #include "KeyBrd.h"
- #include "gpioInc.h"
- #include "AudioInc.h"
- #include "TimerEvents.h"
- #include "ProfileGprots.h"
- #include "sip_msg_api.h"
- #include "sip_ua_api.h"
- #include "app2soc_struct.h"
- #include "soc_api.h"
- #include "app2sip_struct.h"
- #include "app2xdm_struct.h"
- #include "mmi2poc_struct.h"
- #include "custom_poc_config.h"
- #include "PoCGprot.h"
- #include "PoCProt.h"
- #include "wap_ps_struct.h"
- #include "CallManagementGprot.h"
- #define WT_SERVER "http://xdm-devel.wt.fi"
- // #define WT_SERVER "http://xdm.wt.fi"
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_highlight_cm_add_user
- * DESCRIPTION
- * Highlight handler of PoC menu
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_highlight_cm_add_user(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetLeftSoftkeyFunction(mmi_poc_entry_cm_add_user, KEY_EVENT_UP);
- SetKeyHandler(mmi_poc_entry_cm_add_user, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- SetKeyHandler(mmi_poc_disconnect_end, KEY_END, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_highlight_cm_subscribe
- * DESCRIPTION
- * Highlight handler of PoC menu
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_highlight_cm_subscribe(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetLeftSoftkeyFunction(mmi_poc_talk_status_subscribe, KEY_EVENT_UP);
- SetKeyHandler(0, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- SetKeyHandler(mmi_poc_disconnect_end, KEY_END, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_highlight_cm_unsubscribe
- * DESCRIPTION
- * Highlight handler of PoC menu
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_highlight_cm_unsubscribe(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetLeftSoftkeyFunction(mmi_poc_talk_status_unsubscribe, KEY_EVENT_UP);
- SetKeyHandler(0, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- SetKeyHandler(mmi_poc_disconnect_end, KEY_END, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_highlight_cm_talk_group
- * DESCRIPTION
- * Highlight handler of PoC menu
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_highlight_cm_talk_group(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetLeftSoftkeyFunction(mmi_poc_entry_talk_groups, KEY_EVENT_UP);
- SetKeyHandler(0, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- SetKeyHandler(mmi_poc_disconnect_end, KEY_END, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_entry_status
- * DESCRIPTION
- * Entry function when user select Status in PoC Menu
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_entry_status(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_TRACE((MMI_TRACE_G7_MISC, MMI_POC_ENTRY_STATUS));
- if (g_poc_cntx_p->call_status != POC_CALL_NONE)
- {
- MMI_TRACE((MMI_TRACE_G7_MISC, MMI_POC_CALL_STATE, (S32) g_poc_cntx_p->call_status));
- DisplayPopup(
- (U8*) GetString(STR_ID_POC_ERR_TERMINATE_CALL_FIRST),
- IMG_GLOBAL_WARNING,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) WARNING_TONE);
- return;
- }
- ClearInputEventHandler(MMI_DEVICE_ALL);
- switch (g_poc_cntx_p->curr_reg_state)
- {
- case POC_REG_NONE:
- g_poc_cntx_p->curr_reg_state = POC_REG_REGING;
- mmi_poc_entry_registering();
- mmi_poc_wps_query_req();
- break;
- case POC_REG_REGED:
- g_poc_cntx_p->curr_reg_state = POC_REG_DEREGING;
- mmi_poc_entry_registering();
- if (g_poc_cntx_p->curr_use_pres_mode == MMI_TRUE)
- {
- mmi_poc_dereg_pres_unsubscribe_req();
- }
- else
- {
- mmi_poc_deregister_req();
- }
- break;
- case POC_REG_REGING:
- case POC_REG_DEREGING:
- DisplayPopup(
- (U8*) GetString(STR_ID_POC_PROCESSING),
- IMG_GLOBAL_WARNING,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) WARNING_TONE);
- break;
- default:
- break;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_poweron_reg
- * DESCRIPTION
- * Power on registration
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_poweron_reg(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mmi_poc_init_prof_setting_check(NULL);
- if ((g_poc_cntx_p->power_on_reg_sent == POC_BOOTREG_NONE) && (g_poc_cntx_p->curr_boot_start_mode == MMI_TRUE) &&
- (g_poc_cntx_p->curr_reg_state == POC_REG_NONE))
- {
- g_poc_cntx_p->power_on_reg_sent = POC_BOOTREG_SENT;
- g_poc_cntx_p->curr_reg_state = POC_REG_REGING;
- mmi_poc_wps_query_req();
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_poweroff_dereg
- * DESCRIPTION
- * Power off deregistration
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_poweroff_dereg(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (g_poc_cntx_p->curr_reg_state == POC_REG_REGED)
- {
- g_poc_cntx_p->curr_reg_state = POC_REG_DEREGING;
- mmi_poc_register_req();
- ClearProtocolEventHandler(PRT_POC_REGISTER_RSP);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_wps_query_req
- * DESCRIPTION
- * send request to query wps state
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_wps_query_req(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- MYQUEUE Message;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- memset(&g_poc_cntx_p->progressing, 0, sizeof(g_poc_cntx_p->progressing));
- memset(g_poc_cntx_p->contact_list, 0, sizeof(g_poc_cntx_p->contact_list));
- memset(g_poc_cntx_p->talk_group_list, 0, sizeof(g_poc_cntx_p->talk_group_list));
- g_poc_cntx_p->contact_local_updated = MMI_FALSE;
- g_poc_cntx_p->talk_group_local_updated = MMI_FALSE;
- SetProtocolEventHandler(mmi_poc_wps_query_rsp, MSG_ID_WPS_STATUS_QUERY_RSP);
- SetProtocolEventHandler(mmi_poc_wps_ready_ind, MSG_ID_WPS_READY_IND);
- Message.oslSrcId = MOD_MMI;
- Message.oslDestId = MOD_WPS;
- Message.oslMsgId = MSG_ID_WPS_STATUS_QUERY_REQ;
- Message.oslDataPtr = NULL;
- Message.oslPeerBuffPtr = NULL;
- OslMsgSendExtQueue(&Message);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_wps_query_rsp
- * DESCRIPTION
- * Response for wps query
- * PARAMETERS
- * info [IN] Local parameters from protocol
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_wps_query_rsp(void *info)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- wps_status_query_rsp_struct *msgRsp;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- msgRsp = (wps_status_query_rsp_struct*) info;
- ClearProtocolEventHandler(MSG_ID_WPS_STATUS_QUERY_RSP);
- if (msgRsp->status == KAL_TRUE)
- {
- ClearProtocolEventHandler(MSG_ID_WPS_READY_IND);
- if (g_poc_cntx_p->curr_use_xdm_mode == MMI_TRUE)
- {
- mmi_poc_group_init_req();
- }
- else
- {
- mmi_poc_register_req();
- }
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_wps_ready_ind
- * DESCRIPTION
- * wps ready indication
- * PARAMETERS
- * info [IN] Local parameters from protocol
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_wps_ready_ind(void *info)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ClearProtocolEventHandler(MSG_ID_WPS_STATUS_QUERY_RSP);
- ClearProtocolEventHandler(MSG_ID_WPS_READY_IND);
- if (g_poc_cntx_p->curr_use_xdm_mode == MMI_TRUE)
- {
- mmi_poc_group_init_req();
- }
- else
- {
- mmi_poc_register_req();
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_group_init_req
- * DESCRIPTION
- * PoC group init request
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_group_init_req(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- MYQUEUE Message;
- poc_group_init_req_struct *myMsgPtr;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- myMsgPtr = (poc_group_init_req_struct*) OslConstructDataPtr(sizeof(poc_group_init_req_struct));
- memset(
- (U8*) myMsgPtr + sizeof(mmi_poc_dummy_req_struct),
- 0,
- sizeof(poc_group_init_req_struct) - sizeof(mmi_poc_dummy_req_struct));
- myMsgPtr->net_id = g_poc_cntx_p->profile_list[g_poc_cntx_p->profile_active].data_account;
- memcpy(
- myMsgPtr->root_uri,
- g_poc_cntx_p->profile_list[g_poc_cntx_p->profile_active].xdm_addr,
- XDM_ROOT_URI_LEN * sizeof(U8));
- memcpy(myMsgPtr->xui, g_poc_cntx_p->profile_list[g_poc_cntx_p->profile_active].uri, XDM_XUI_LEN * sizeof(U8));
- memcpy(
- myMsgPtr->password,
- g_poc_cntx_p->profile_list[g_poc_cntx_p->profile_active].password,
- XDM_PASSWD_LEN * sizeof(U8));
- myMsgPtr->use_proxy = g_poc_cntx_p->profile_list[g_poc_cntx_p->profile_active].use_proxy;
- memcpy(
- myMsgPtr->prx_ip,
- g_poc_cntx_p->profile_list[g_poc_cntx_p->profile_active].proxy_ip,
- XDM_MAX_IP_LEN * sizeof(U8));
- myMsgPtr->prx_port = g_poc_cntx_p->profile_list[g_poc_cntx_p->profile_active].proxy_port;
- memcpy(
- myMsgPtr->proxy_username,
- g_poc_cntx_p->profile_list[g_poc_cntx_p->profile_active].proxy_username,
- XDM_MAX_PROXY_USERNAME_LEN * sizeof(U8));
- memcpy(
- myMsgPtr->proxy_pass,
- g_poc_cntx_p->profile_list[g_poc_cntx_p->profile_active].proxy_password,
- XDM_MAX_PROXY_PASS_LEN * sizeof(U8));
- SetProtocolEventHandler(mmi_poc_group_init_rsp, MSG_ID_POC_GROUP_INIT_RSP);
- Message.oslSrcId = MOD_MMI;
- Message.oslDestId = MOD_POC;
- Message.oslMsgId = MSG_ID_POC_GROUP_INIT_REQ;
- Message.oslDataPtr = (oslParaType*) myMsgPtr;
- Message.oslPeerBuffPtr = NULL;
- OslMsgSendExtQueue(&Message);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_group_init_rsp
- * DESCRIPTION
- * PoC group init response
- * PARAMETERS
- * info [IN] Local parameters from protocol
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_group_init_rsp(void *info)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- poc_group_init_rsp_struct *msgRsp;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- msgRsp = (poc_group_init_rsp_struct*) info;
- ClearProtocolEventHandler(MSG_ID_POC_GROUP_INIT_RSP);
- if (msgRsp->result == POC_OK)
- {
- g_poc_cntx_p->curr_group_id = 0;
- g_poc_cntx_p->curr_entry_id = 0;
- memset(
- g_poc_cntx_p->contact_list,
- 0,
- sizeof(mmi_poc_contact_struct) * MAX_POC_GROUP_FILE_NUM * MAX_POC_GROUPS_PER_FILE_NUM);
- mmi_poc_get_group_list_req();
- }
- else
- {
- if (g_poc_cntx_p->power_on_reg_sent == POC_BOOTREG_SENT)
- {
- g_poc_cntx_p->power_on_reg_sent = POC_BOOTREG_NONE;
- }
- else
- {
- g_poc_cntx_p->power_on_reg_sent = POC_BOOTREG_FINISH;
- }
- if (((GetActiveScreenId() == SCR_ID_POC_REG) || (GetActiveScreenId() == SCR_ID_POC_MAIN)))
- {
- mmi_poc_show_error_cause(POC_XDM_ERROR, 0);
- }
- DeleteScreenIfPresent(SCR_ID_POC_REG);
- g_poc_cntx_p->curr_reg_state = POC_REG_NONE;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_get_group_list_req
- * DESCRIPTION
- * Get contact list request
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_get_group_list_req(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- MYQUEUE Message;
- poc_get_group_list_req_struct *myMsgPtr;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- myMsgPtr = (poc_get_group_list_req_struct*) OslConstructDataPtr(sizeof(poc_get_group_list_req_struct));
- memset(
- (U8*) myMsgPtr + sizeof(mmi_poc_dummy_req_struct),
- 0,
- sizeof(poc_get_group_list_req_struct) - sizeof(mmi_poc_dummy_req_struct));
- myMsgPtr->request_id = POC_REQUEST_ID;
- myMsgPtr->start_group = g_poc_cntx_p->curr_group_id;
- myMsgPtr->start_entry = g_poc_cntx_p->curr_entry_id;
- if (g_poc_cntx_p->curr_use_pres_mode == MMI_TRUE)
- {
- myMsgPtr->xdm_item = POC_XDM_GL_PRESENT | POC_XDM_AL_PRESENT | POC_XDM_AR_PRESENT | POC_XDM_RLS_PRESENT;
- }
- else
- {
- myMsgPtr->xdm_item = POC_XDM_GL_PRESENT | POC_XDM_AL_PRESENT;
- }
- g_poc_cntx_p->contact_local_updated = MMI_FALSE;
- SetProtocolEventHandler(mmi_poc_get_group_list_rsp, MSG_ID_POC_GET_GROUP_LIST_RSP);
- Message.oslSrcId = MOD_MMI;
- Message.oslDestId = MOD_POC;
- Message.oslMsgId = MSG_ID_POC_GET_GROUP_LIST_REQ;
- Message.oslDataPtr = (oslParaType*) myMsgPtr;
- Message.oslPeerBuffPtr = NULL;
- OslMsgSendExtQueue(&Message);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_get_group_list_rsp
- * DESCRIPTION
- * Get contact list response
- * PARAMETERS
- * info [IN] Local parameters from protocol
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_get_group_list_rsp(void *info)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 i, temp_idx;
- poc_get_group_list_rsp_struct *msgRsp;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- msgRsp = (poc_get_group_list_rsp_struct*) info;
- ClearProtocolEventHandler(MSG_ID_POC_GET_GROUP_LIST_RSP);
- if (msgRsp->result == POC_OK)
- {
- if (g_poc_cntx_p->curr_entry_id == 0)
- {
- g_poc_cntx_p->contact_list[g_poc_cntx_p->curr_group_id].valid = MMI_TRUE;
- memcpy(
- g_poc_cntx_p->contact_list[g_poc_cntx_p->curr_group_id].list_name,
- msgRsp->list_name,
- POC_MAX_DISP_LEN * sizeof(U8));
- }
- for (i = 0; i < msgRsp->no_entries; i++)
- {
- if (g_poc_cntx_p->contact_list[g_poc_cntx_p->curr_group_id].no_entries < POC_GROUP_LOCAL_MAX_ENTRIES_NUM)
- {
- temp_idx = g_poc_cntx_p->contact_list[g_poc_cntx_p->curr_group_id].no_entries;
- g_poc_cntx_p->contact_list[g_poc_cntx_p->curr_group_id].entries[temp_idx].allow_invite =
- msgRsp->entries[i].allow_invite;
- g_poc_cntx_p->contact_list[g_poc_cntx_p->curr_group_id].entries[temp_idx].sub_pres =
- msgRsp->entries[i].sub_pres;
- memcpy(
- &g_poc_cntx_p->contact_list[g_poc_cntx_p->curr_group_id].entries[temp_idx].auth_rule,
- &(msgRsp->entries[i].auth_rule),
- sizeof(poc_pres_authrule_struct));
- switch (g_poc_cntx_p->contact_list[g_poc_cntx_p->curr_group_id].entries[temp_idx].auth_rule.
- sub_handling)
- {
- case POC_PRES_ACTION_BLOCK:
- case POC_PRES_ACTION_POLITE_BLOCK:
- case POC_PRES_ACTION_ALLOW:
- g_poc_cntx_p->contact_list[g_poc_cntx_p->curr_group_id].entries[temp_idx].auth_rule.
- sub_handling++;
- break;
- default:
- g_poc_cntx_p->contact_list[g_poc_cntx_p->curr_group_id].entries[temp_idx].auth_rule.
- sub_handling = POC_MMI_SUB_EMPTY;
- break;
- }
- memcpy(
- g_poc_cntx_p->contact_list[g_poc_cntx_p->curr_group_id].entries[temp_idx].uri,
- msgRsp->entries[i].uri,
- sizeof(U8) * POC_MAX_URI_LEN);
- memcpy(
- g_poc_cntx_p->contact_list[g_poc_cntx_p->curr_group_id].entries[temp_idx].display_name,
- msgRsp->entries[i].disp_name,
- sizeof(U8) * POC_MAX_DISP_LEN);
- g_poc_cntx_p->contact_list[g_poc_cntx_p->curr_group_id].no_entries++;
- }
- }
- g_poc_cntx_p->curr_entry_id = g_poc_cntx_p->contact_list[g_poc_cntx_p->curr_group_id].no_entries;
- if (msgRsp->more_data == KAL_TRUE)
- {
- mmi_poc_get_group_list_req();
- }
- else if ((msgRsp->more_list == KAL_TRUE)
- && (g_poc_cntx_p->curr_group_id < MAX_POC_GROUP_FILE_NUM * MAX_POC_GROUPS_PER_FILE_NUM))
- {
- g_poc_cntx_p->curr_group_id++;
- g_poc_cntx_p->curr_entry_id = 0;
- mmi_poc_get_group_list_req();
- }
- else
- {
- g_poc_cntx_p->curr_group_id = 0;
- g_poc_cntx_p->curr_entry_id = 0;
- memset(
- g_poc_cntx_p->talk_group_list,
- 0,
- sizeof(poc_talk_group_struct) * MAX_POC_TALK_GROUP_FILE_NUM * MAX_POC_TALK_GROUPS_PER_FILE_NUM);
- mmi_poc_get_talk_group_list_req();
- }
- }
- else if ((msgRsp->result == POC_XDM_ERROR) && (msgRsp->cause == POC_GRP_CAUSE_EMPTY_DIR))
- {
- mmi_poc_get_talk_group_list_req();
- }
- else
- {
- if (g_poc_cntx_p->power_on_reg_sent == POC_BOOTREG_SENT)
- {
- g_poc_cntx_p->power_on_reg_sent = POC_BOOTREG_NONE;
- }
- else
- {
- g_poc_cntx_p->power_on_reg_sent = POC_BOOTREG_FINISH;
- }
- if (((GetActiveScreenId() == SCR_ID_POC_REG) || (GetActiveScreenId() == SCR_ID_POC_MAIN)))
- {
- mmi_poc_show_error_cause(POC_XDM_ERROR, 0);
- }
- DeleteScreenIfPresent(SCR_ID_POC_REG);
- g_poc_cntx_p->curr_reg_state = POC_REG_NONE;
- mmi_poc_group_deinit_req();
- ClearProtocolEventHandler(MSG_ID_POC_GROUP_DEINIT_RSP);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_get_talk_group_list_req
- * DESCRIPTION
- * Get talk group list request
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_get_talk_group_list_req(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- MYQUEUE Message;
- poc_get_talk_group_list_req_struct *myMsgPtr;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- myMsgPtr = (poc_get_talk_group_list_req_struct*) OslConstructDataPtr(sizeof(poc_get_talk_group_list_req_struct));
- memset(
- (U8*) myMsgPtr + sizeof(mmi_poc_dummy_req_struct),
- 0,
- sizeof(poc_get_talk_group_list_req_struct) - sizeof(mmi_poc_dummy_req_struct));
- myMsgPtr->request_id = POC_REQUEST_ID;
- myMsgPtr->start_group = g_poc_cntx_p->curr_group_id;
- myMsgPtr->start_entry = g_poc_cntx_p->curr_entry_id;
- SetProtocolEventHandler(mmi_poc_get_talk_group_list_rsp, MSG_ID_POC_GET_TALK_GROUP_LIST_RSP);
- Message.oslSrcId = MOD_MMI;
- Message.oslDestId = MOD_POC;
- Message.oslMsgId = MSG_ID_POC_GET_TALK_GROUP_LIST_REQ;
- Message.oslDataPtr = (oslParaType*) myMsgPtr;
- Message.oslPeerBuffPtr = NULL;
- OslMsgSendExtQueue(&Message);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_get_talk_group_list_rsp
- * DESCRIPTION
- * Get talk group list response
- * PARAMETERS
- * info [IN] Local parameters from protocol
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_get_talk_group_list_rsp(void *info)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 i, temp_idx;
- poc_get_talk_group_list_rsp_struct *msgRsp;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- msgRsp = (poc_get_talk_group_list_rsp_struct*) info;
- ClearProtocolEventHandler(MSG_ID_POC_GET_TALK_GROUP_LIST_RSP);
- if (msgRsp->result == POC_OK)
- {
- if (g_poc_cntx_p->curr_entry_id == 0)
- {
- g_poc_cntx_p->talk_group_list[g_poc_cntx_p->curr_group_id].valid = MMI_TRUE;
- memcpy(
- g_poc_cntx_p->talk_group_list[g_poc_cntx_p->curr_group_id].list_uri,
- msgRsp->list_uri,
- POC_MAX_URI_LEN * sizeof(U8));
- g_poc_cntx_p->talk_group_list[g_poc_cntx_p->curr_group_id].display_name_lang = msgRsp->display_name_lang;
- memcpy(
- g_poc_cntx_p->talk_group_list[g_poc_cntx_p->curr_group_id].display_name,
- msgRsp->display_name,
- POC_MAX_DISP_LEN * sizeof(U8));
- g_poc_cntx_p->talk_group_list[g_poc_cntx_p->curr_group_id].max_participant_count =
- msgRsp->max_participant_count;
- g_poc_cntx_p->talk_group_list[g_poc_cntx_p->curr_group_id].invite_member = msgRsp->invite_member;
- memcpy(
- &g_poc_cntx_p->talk_group_list[g_poc_cntx_p->curr_group_id].default_rule,
- &msgRsp->default_rule,
- sizeof(poc_group_param_struct));
- }
- for (i = 0; i < msgRsp->no_entries; i++)
- {
- if (g_poc_cntx_p->talk_group_list[g_poc_cntx_p->curr_group_id].no_entries <
- POC_TALK_GROUP_LOCAL_MAX_ENTRIES_NUM)
- {
- temp_idx = g_poc_cntx_p->talk_group_list[g_poc_cntx_p->curr_group_id].no_entries;
- memcpy(
- &(g_poc_cntx_p->talk_group_list[g_poc_cntx_p->curr_group_id].entries[temp_idx]),
- &(msgRsp->entries[i]),
- sizeof(poc_talk_group_entry_struct));
- g_poc_cntx_p->talk_group_list[g_poc_cntx_p->curr_group_id].no_entries++;
- }
- }
- g_poc_cntx_p->curr_entry_id = g_poc_cntx_p->talk_group_list[g_poc_cntx_p->curr_group_id].no_entries;
- if (msgRsp->more_data == KAL_TRUE)
- {
- mmi_poc_get_talk_group_list_req();
- }
- else if ((msgRsp->more_group == KAL_TRUE)
- && (g_poc_cntx_p->curr_group_id < MAX_POC_TALK_GROUP_FILE_NUM * MAX_POC_TALK_GROUPS_PER_FILE_NUM))
- {
- g_poc_cntx_p->curr_group_id++;
- g_poc_cntx_p->curr_entry_id = 0;
- mmi_poc_get_talk_group_list_req();
- }
- else
- {
- mmi_poc_register_req();
- }
- }
- else if (msgRsp->result == POC_XDM_ERROR && msgRsp->cause == POC_GRP_CAUSE_EMPTY_DIR)
- {
- mmi_poc_register_req();
- }
- else
- {
- if (g_poc_cntx_p->power_on_reg_sent == POC_BOOTREG_SENT)
- {
- g_poc_cntx_p->power_on_reg_sent = POC_BOOTREG_NONE;
- }
- else
- {
- g_poc_cntx_p->power_on_reg_sent = POC_BOOTREG_FINISH;
- }
- if (((GetActiveScreenId() == SCR_ID_POC_REG) || (GetActiveScreenId() == SCR_ID_POC_MAIN)))
- {
- mmi_poc_show_error_cause(POC_XDM_ERROR, 0);
- }
- DeleteScreenIfPresent(SCR_ID_POC_REG);
- g_poc_cntx_p->curr_reg_state = POC_REG_NONE;
- mmi_poc_group_deinit_req();
- ClearProtocolEventHandler(MSG_ID_POC_GROUP_DEINIT_RSP);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_register_req
- * DESCRIPTION
- * PoC register request
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_register_req(void)
- {
- #ifdef __POC_MMI_TEST_XDM_ONLY__
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (GetActiveScreenId() == SCR_ID_POC_REG)
- {
- DisplayPopup(
- (U8*) GetString(STR_GLOBAL_DONE),
- IMG_GLOBAL_ACTIVATED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) SUCCESS_TONE);
- }
- else if (GetActiveScreenId() == SCR_ID_POC_MAIN)
- {
- DisplayPopup(
- (U8*) GetString(STR_ID_POC_REGISTERED),
- IMG_GLOBAL_ACTIVATED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) SUCCESS_TONE);
- }
- DeleteScreenIfPresent(SCR_ID_POC_REG);
- g_poc_cntx_p->power_on_reg_sent = POC_BOOTREG_FINISH;
- g_poc_cntx_p->curr_reg_state = POC_REG_REGED;
- ShowStatusIcon(STATUS_ICON_POC);
- UpdateStatusIcons();
- #else /* __POC_MMI_TEST_XDM_ONLY__ */
- MYQUEUE Message;
- poc_register_req_struct *myMsgPtr;
- myMsgPtr = (poc_register_req_struct*) OslConstructDataPtr(sizeof(poc_register_req_struct));
- memset(
- (U8*) myMsgPtr + sizeof(mmi_poc_dummy_req_struct),
- 0,
- sizeof(poc_register_req_struct) - sizeof(mmi_poc_dummy_req_struct));
- ASSERT(g_poc_cntx_p->curr_reg_state == POC_REG_REGING || g_poc_cntx_p->curr_reg_state == POC_REG_DEREGING);
- myMsgPtr->action = POC_REGISTER_ACTION;
- UnicodeToAnsii(
- (S8*) myMsgPtr->contact.disp_name,
- (S8*) g_poc_cntx_p->profile_list[g_poc_cntx_p->profile_active].disp_name);
- memcpy(
- myMsgPtr->contact.uri,
- g_poc_cntx_p->profile_list[g_poc_cntx_p->profile_active].uri,
- POC_MAX_URI_LEN * sizeof(U8));
- myMsgPtr->contact.disp_charset = 0;
- myMsgPtr->data_account = g_poc_cntx_p->profile_list[g_poc_cntx_p->profile_active].data_account;
- memcpy(
- myMsgPtr->proxy_addr,
- g_poc_cntx_p->profile_list[g_poc_cntx_p->profile_active].poc_addr,
- POC_PROXY_ADDR_LEN * sizeof(U8));
- myMsgPtr->proxy_port = g_poc_cntx_p->profile_list[g_poc_cntx_p->profile_active].poc_port;
- memcpy(
- myMsgPtr->password,
- g_poc_cntx_p->profile_list[g_poc_cntx_p->profile_active].password,
- POC_MAX_PASSWORD_LEN * sizeof(U8));
- Message.oslSrcId = MOD_MMI;
- Message.oslDestId = MOD_POC;
- Message.oslMsgId = PRT_POC_REGISTER_REQ;
- Message.oslDataPtr = (oslParaType*) myMsgPtr;
- Message.oslPeerBuffPtr = NULL;
- OslMsgSendExtQueue(&Message);
- SetProtocolEventHandler(mmi_poc_register_rsp, PRT_POC_REGISTER_RSP);
- #endif /* __POC_MMI_TEST_XDM_ONLY__ */
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_register_rsp
- * DESCRIPTION
- * PoC register response
- * PARAMETERS
- * info [IN] Local parameters from protocol
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_register_rsp(void *info)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- poc_register_rsp_struct *msgRsp;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- msgRsp = (poc_register_rsp_struct*) info;
- ASSERT(g_poc_cntx_p->curr_reg_state == POC_REG_REGING || g_poc_cntx_p->curr_reg_state == POC_REG_DEREGING);
- ClearProtocolEventHandler(PRT_POC_REGISTER_RSP);
- if (msgRsp->result == POC_OK)
- {
- mmi_poc_reg_send_setting_req();
- }
- else
- {
- g_poc_cntx_p->curr_reg_state = POC_REG_NONE;
- if (g_poc_cntx_p->curr_use_xdm_mode == MMI_TRUE)
- {
- mmi_poc_group_deinit_req();
- ClearProtocolEventHandler(MSG_ID_POC_GROUP_DEINIT_RSP);
- }
- if (g_poc_cntx_p->power_on_reg_sent == POC_BOOTREG_SENT)
- {
- g_poc_cntx_p->power_on_reg_sent = POC_BOOTREG_NONE;
- }
- else
- {
- g_poc_cntx_p->power_on_reg_sent = POC_BOOTREG_FINISH;
- }
- if (((GetActiveScreenId() == SCR_ID_POC_REG) || (GetActiveScreenId() == SCR_ID_POC_MAIN)))
- {
- mmi_poc_show_error_cause(msgRsp->result, msgRsp->cause);
- }
- DeleteScreenIfPresent(SCR_ID_POC_REG);
- g_poc_cntx_p->curr_reg_state = POC_REG_NONE;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_register_ind
- * DESCRIPTION
- * PoC periodically registration info update indication
- * PARAMETERS
- * info [IN] Local parameters from protocol
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_register_ind(void *info)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- poc_register_ind_struct *msgRsp;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- msgRsp = (poc_register_ind_struct*) info;
- if (msgRsp->result != POC_OK)
- {
- ClearProtocolEventHandler(PRT_POC_REGISTER_RSP);
- ClearProtocolEventHandler(MSG_ID_POC_SETTING_RSP);
- ClearProtocolEventHandler(MSG_ID_POC_PRESENCE_SUBSCRIBE_RSP);
- ClearProtocolEventHandler(MSG_ID_POC_PRESENCE_PUBLISH_RSP);
- if ((GetActiveScreenId() >= SCR_ID_POC_MAIN) && (GetActiveScreenId() < SCR_ID_POC_TOTAL))
- {
- TurnOnBacklight(1);
- DisplayPopup(
- (U8*) GetString(STR_ID_POC_ERR_NOT_REGISTERED),
- IMG_GLOBAL_ERROR,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) ERROR_TONE);
- }
- DeleteScreenIfPresent(SCR_ID_POC_CM);
- mmi_poc_remove_cm_screens();
- if (IsScreenPresent(SCR_ID_POC_MAIN))
- {
- DeleteUptoScrID(SCR_ID_POC_MAIN);
- }
- /* Reset reg status */
- g_poc_cntx_p->curr_reg_state = POC_REG_NONE;
- HideStatusIcon(STATUS_ICON_POC);
- UpdateStatusIcons();
- if (g_poc_cntx_p->curr_use_xdm_mode == MMI_TRUE)
- {
- mmi_poc_group_deinit_req();
- ClearProtocolEventHandler(MSG_ID_POC_GROUP_DEINIT_RSP);
- }
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_entry_registering
- * DESCRIPTION
- * poc registering screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_entry_registering(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *guiBuffer;
- U16 caption;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_TRACE((MMI_TRACE_G7_MISC, MMI_POC_ENTRY_REGISTERING));
- EntryNewScreen(SCR_ID_POC_REG, NULL, mmi_poc_entry_registering, NULL);
- DeleteScreenIfPresent(SCR_ID_POC_REG);
- guiBuffer = GetCurrGuiBuffer(SCR_ID_POC_REG);
- if (g_poc_cntx_p->curr_reg_state == POC_REG_REGING)
- {
- caption = STR_ID_POC_REGISTERING;
- }
- else
- {
- caption = STR_ID_POC_DEREGISTERING;
- }
- ShowCategory66Screen(
- STR_ID_POC_MAIN,
- GetRootTitleIcon(MENU_ID_POC_MAIN),
- 0,
- 0,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- (U8*) GetString(caption),
- IMG_GLOBAL_PROGRESS,
- NULL);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_reg_send_setting_req
- * DESCRIPTION
- * Send poc setting when registration
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_reg_send_setting_req(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- MYQUEUE Message;
- poc_setting_req_struct *myMsgPtr;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- myMsgPtr = (poc_setting_req_struct*) OslConstructDataPtr(sizeof(poc_setting_req_struct));
- memset(
- (U8*) myMsgPtr + sizeof(mmi_poc_dummy_req_struct),
- 0,
- sizeof(poc_setting_req_struct) - sizeof(mmi_poc_dummy_req_struct));
- g_poc_cntx_p->reg_error = MMI_FALSE;
- myMsgPtr->data.auto_answer = g_poc_cntx_p->curr_ans_mode;
- myMsgPtr->data.isb = g_poc_cntx_p->curr_call_bar_mode;
- myMsgPtr->data.ipab = g_poc_cntx_p->curr_alert_bar_mode;
- myMsgPtr->data.enable_mao = g_poc_cntx_p->curr_mao_mode;
- myMsgPtr->data.enable_privacy = g_poc_cntx_p->curr_privacy_mode;
- memcpy(&myMsgPtr->data.privacy_addr, &g_poc_cntx_p->privacy_addr, sizeof(poc_addr_struct));
- Message.oslSrcId = MOD_MMI;
- Message.oslDestId = MOD_POC;
- Message.oslMsgId = PRT_POC_SETTING_REQ;
- Message.oslDataPtr = (oslParaType*) myMsgPtr;
- Message.oslPeerBuffPtr = NULL;
- OslMsgSendExtQueue(&Message);
- SetProtocolEventHandler(mmi_poc_reg_send_setting_rsp, PRT_POC_SETTING_RSP);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_reg_send_setting_rsp
- * DESCRIPTION
- * Response for send PoC settings
- * PARAMETERS
- * info [IN] Local parameters from protocol
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_reg_send_setting_rsp(void *info)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- poc_setting_rsp_struct *msgRsp;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- msgRsp = (poc_setting_rsp_struct*) info;
- ClearProtocolEventHandler(PRT_POC_SETTING_RSP);
- if (msgRsp->result != POC_OK)
- {
- g_poc_cntx_p->reg_error = MMI_TRUE;
- }
- if (g_poc_cntx_p->curr_use_pres_mode == MMI_TRUE)
- {
- if (g_poc_cntx_p->curr_use_xdm_mode == MMI_TRUE)
- {
- mmi_poc_reg_pres_subscribe_req();
- }
- else
- {
- mmi_poc_reg_pres_publish_req();
- }
- }
- else
- {
- if (g_poc_cntx_p->reg_error == MMI_TRUE)
- {
- if (GetActiveScreenId() == SCR_ID_POC_REG)
- {
- DisplayPopup(
- (U8*) GetString(STR_ID_POC_ERR_REG_PARTIAL_SUCCESS),
- IMG_GLOBAL_ACTIVATED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) SUCCESS_TONE);
- }
- else if (GetActiveScreenId() == SCR_ID_POC_MAIN)
- {
- DisplayPopup(
- (U8*) GetString(STR_ID_POC_ERR_REG_PARTIAL_SUCCESS),
- IMG_GLOBAL_ACTIVATED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) SUCCESS_TONE);
- }
- }
- else
- {
- if (GetActiveScreenId() == SCR_ID_POC_REG)
- {
- DisplayPopup(
- (U8*) GetString(STR_GLOBAL_DONE),
- IMG_GLOBAL_ACTIVATED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) SUCCESS_TONE);
- }
- else if (GetActiveScreenId() == SCR_ID_POC_MAIN)
- {
- DisplayPopup(
- (U8*) GetString(STR_ID_POC_REGISTERED),
- IMG_GLOBAL_ACTIVATED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) SUCCESS_TONE);
- }
- }
- DeleteScreenIfPresent(SCR_ID_POC_REG);
- g_poc_cntx_p->power_on_reg_sent = POC_BOOTREG_FINISH;
- g_poc_cntx_p->curr_reg_state = POC_REG_REGED;
- ShowStatusIcon(STATUS_ICON_POC);
- UpdateStatusIcons();
- }
- }
- #ifndef __POC_NON_RLS__
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_reg_pres_subscribe_req
- * DESCRIPTION
- * presence subscribe request
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_reg_pres_subscribe_req(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- MYQUEUE Message;
- poc_presence_subscribe_req_struct *myMsgPtr;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- myMsgPtr = (poc_presence_subscribe_req_struct*) OslConstructDataPtr(sizeof(poc_presence_subscribe_req_struct));
- memset(
- (U8*) myMsgPtr + sizeof(mmi_poc_dummy_req_struct),
- 0,
- sizeof(poc_presence_subscribe_req_struct) - sizeof(mmi_poc_dummy_req_struct));
- myMsgPtr->action = POC_SUBSCRIBE_ACTION;
- myMsgPtr->use_presence_list = MMI_TRUE;
- memcpy(myMsgPtr->uri, POC_MMI_MTK_RLS_URI, POC_MAX_URI_LEN * sizeof(U8));
- strncat(
- (S8*) myMsgPtr->uri,
- (S8*) g_poc_cntx_p->profile_list[g_poc_cntx_p->profile_active].uri,
- POC_MAX_URI_LEN - sizeof(POC_MMI_MTK_RLS_URI) - 1);
- Message.oslSrcId = MOD_MMI;
- Message.oslDestId = MOD_POC;
- Message.oslMsgId = MSG_ID_POC_PRESENCE_SUBSCRIBE_REQ;
- Message.oslDataPtr = (oslParaType*) myMsgPtr;
- Message.oslPeerBuffPtr = NULL;
- OslMsgSendExtQueue(&Message);
- SetProtocolEventHandler(mmi_poc_reg_pres_subscribe_rsp, MSG_ID_POC_PRESENCE_SUBSCRIBE_RSP);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_reg_pres_subscribe_rsp
- * DESCRIPTION
- * presense subscribe response
- * PARAMETERS
- * info [IN] Local parameters from protocol
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_reg_pres_subscribe_rsp(void *info)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- poc_presence_subscribe_rsp_struct *msgRsp;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- msgRsp = (poc_presence_subscribe_rsp_struct*) info;
- ClearProtocolEventHandler(MSG_ID_POC_PRESENCE_SUBSCRIBE_RSP);
- if (msgRsp->result != POC_OK)
- {
- g_poc_cntx_p->reg_error = MMI_TRUE;
- }
- mmi_poc_reg_pres_publish_req();
- }
- #else /* __POC_NON_RLS__ */
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_reg_pres_subscribe_req
- * DESCRIPTION
- * presence subscribe request
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_reg_pres_subscribe_req(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- MYQUEUE Message;
- poc_presence_subscribe_req_struct *myMsgPtr;
- static U8 curr_group = 0, curr_entry = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- for (; (g_poc_cntx_p->contact_list[curr_group].valid == MMI_TRUE) &&
- (curr_group < MAX_POC_GROUP_FILE_NUM * MAX_POC_GROUPS_PER_FILE_NUM); curr_group++)
- {
- for (; curr_entry < g_poc_cntx_p->contact_list[curr_group].no_entries; curr_entry++)
- {
- if (g_poc_cntx_p->contact_list[curr_group].entries[curr_entry].sub_pres == MMI_TRUE)
- {
- myMsgPtr =
- (poc_presence_subscribe_req_struct*)
- OslConstructDataPtr(sizeof(poc_presence_subscribe_req_struct));
- memset(
- (U8*) myMsgPtr + sizeof(mmi_poc_dummy_req_struct),
- 0,
- sizeof(poc_presence_subscribe_req_struct) - sizeof(mmi_poc_dummy_req_struct));
- myMsgPtr->action = POC_SUBSCRIBE_ACTION;
- myMsgPtr->use_presence_list = MMI_FALSE;
- memcpy(
- myMsgPtr->uri,
- g_poc_cntx_p->contact_list[curr_group].entries[curr_entry].uri,
- POC_MAX_URI_LEN * sizeof(U8));
- Message.oslSrcId = MOD_MMI;
- Message.oslDestId = MOD_POC;
- Message.oslMsgId = MSG_ID_POC_PRESENCE_SUBSCRIBE_REQ;
- Message.oslDataPtr = (oslParaType*) myMsgPtr;
- Message.oslPeerBuffPtr = NULL;
- OslMsgSendExtQueue(&Message);
- SetProtocolEventHandler(mmi_poc_reg_pres_subscribe_rsp, MSG_ID_POC_PRESENCE_SUBSCRIBE_RSP);
- curr_entry++;
- return;
- }
- }
- curr_entry = 0;
- }
- curr_group = 0;
- curr_entry = 0;
- mmi_poc_reg_pres_publish_req();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_reg_pres_subscribe_rsp
- * DESCRIPTION
- * presence subscribe response
- * PARAMETERS
- * info [?]
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_reg_pres_subscribe_rsp(void *info)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- poc_presence_subscribe_rsp_struct *msgRsp;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- msgRsp = (poc_presence_subscribe_rsp_struct*) info;
- ClearProtocolEventHandler(MSG_ID_POC_PRESENCE_SUBSCRIBE_RSP);
- if (msgRsp->result != POC_OK)
- {
- g_poc_cntx_p->reg_error = MMI_TRUE;
- }
- mmi_poc_reg_pres_subscribe_req();
- }
- #endif /* __POC_NON_RLS__ */
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_reg_pres_publish_req
- * DESCRIPTION
- * presence publish request
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_reg_pres_publish_req(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- MYQUEUE Message;
- poc_presence_publish_req_struct *myMsgPtr;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- myMsgPtr = (poc_presence_publish_req_struct*) OslConstructDataPtr(sizeof(poc_presence_publish_req_struct));
- memset(
- (U8*) myMsgPtr + sizeof(mmi_poc_dummy_req_struct),
- 0,
- sizeof(poc_presence_publish_req_struct) - sizeof(mmi_poc_dummy_req_struct));
- myMsgPtr->remove = MMI_FALSE;
- memcpy(
- myMsgPtr->pinfo.entity,
- g_poc_cntx_p->profile_list[g_poc_cntx_p->profile_active].uri,
- POC_MAX_URI_LEN * sizeof(U8));
- myMsgPtr->pinfo.is_active = MMI_TRUE;
- myMsgPtr->pinfo.person.activity_present = g_poc_cntx_p->person_pres.activity_present;
- myMsgPtr->pinfo.person.activity = g_poc_cntx_p->person_pres.activity;
- myMsgPtr->pinfo.person.mood_present = g_poc_cntx_p->person_pres.mood_present;
- myMsgPtr->pinfo.person.mood = g_poc_cntx_p->person_pres.mood;
- myMsgPtr->pinfo.num_service = 0;
- Message.oslSrcId = MOD_MMI;
- Message.oslDestId = MOD_POC;
- Message.oslMsgId = MSG_ID_POC_PRESENCE_PUBLISH_REQ;
- Message.oslDataPtr = (oslParaType*) myMsgPtr;
- Message.oslPeerBuffPtr = NULL;
- OslMsgSendExtQueue(&Message);
- SetProtocolEventHandler(mmi_poc_reg_pres_publish_rsp, MSG_ID_POC_PRESENCE_PUBLISH_RSP);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_reg_pres_publish_rsp
- * DESCRIPTION
- * presence publish response
- * PARAMETERS
- * info [IN] Local parameters from protocol
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_reg_pres_publish_rsp(void *info)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- poc_presence_publish_rsp_struct *msgRsp;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- msgRsp = (poc_presence_publish_rsp_struct*) info;
- ClearProtocolEventHandler(MSG_ID_POC_PRESENCE_PUBLISH_RSP);
- g_poc_cntx_p->power_on_reg_sent = POC_BOOTREG_FINISH;
- g_poc_cntx_p->curr_reg_state = POC_REG_REGED;
- ShowStatusIcon(STATUS_ICON_POC);
- UpdateStatusIcons();
- mdi_audio_set_background_handler(MDI_BACKGROUND_APP_POC, mmi_poc_mdi_background_handler);
- if (msgRsp->result != POC_OK)
- {
- g_poc_cntx_p->reg_error = MMI_TRUE;
- }
- if (g_poc_cntx_p->reg_error == MMI_TRUE)
- {
- if (GetActiveScreenId() == SCR_ID_POC_REG)
- {
- DisplayPopup(
- (U8*) GetString(STR_ID_POC_ERR_REG_PARTIAL_SUCCESS),
- IMG_GLOBAL_ACTIVATED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) SUCCESS_TONE);
- }
- else if (GetActiveScreenId() == SCR_ID_POC_MAIN)
- {
- DisplayPopup(
- (U8*) GetString(STR_ID_POC_ERR_REG_PARTIAL_SUCCESS),
- IMG_GLOBAL_ACTIVATED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) SUCCESS_TONE);
- }
- }
- else
- {
- if (GetActiveScreenId() == SCR_ID_POC_REG)
- {
- DisplayPopup(
- (U8*) GetString(STR_GLOBAL_DONE),
- IMG_GLOBAL_ACTIVATED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) SUCCESS_TONE);
- }
- else if (GetActiveScreenId() == SCR_ID_POC_MAIN)
- {
- DisplayPopup(
- (U8*) GetString(STR_ID_POC_REGISTERED),
- IMG_GLOBAL_ACTIVATED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) SUCCESS_TONE);
- }
- }
- DeleteScreenIfPresent(SCR_ID_POC_REG);
- }
- #ifndef __POC_NON_RLS__
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_dereg_pres_unsubscribe_req
- * DESCRIPTION
- * presence unsubscribe request for deregistration
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_dereg_pres_unsubscribe_req(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- MYQUEUE Message;
- poc_presence_subscribe_req_struct *myMsgPtr;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- myMsgPtr = (poc_presence_subscribe_req_struct*) OslConstructDataPtr(sizeof(poc_presence_subscribe_req_struct));
- memset(
- (U8*) myMsgPtr + sizeof(mmi_poc_dummy_req_struct),
- 0,
- sizeof(poc_presence_subscribe_req_struct) - sizeof(mmi_poc_dummy_req_struct));
- g_poc_cntx_p->reg_error = MMI_FALSE;
- myMsgPtr->action = POC_UNSUBSCRIBE_ACTION;
- myMsgPtr->use_presence_list = MMI_TRUE;
- memcpy(myMsgPtr->uri, POC_MMI_MTK_RLS_URI, POC_MAX_URI_LEN * sizeof(U8));
- strncat(
- (S8*) myMsgPtr->uri,
- (S8*) g_poc_cntx_p->profile_list[g_poc_cntx_p->profile_active].uri,
- POC_MAX_URI_LEN - sizeof(POC_MMI_MTK_RLS_URI) - 1);
- Message.oslSrcId = MOD_MMI;
- Message.oslDestId = MOD_POC;
- Message.oslMsgId = MSG_ID_POC_PRESENCE_SUBSCRIBE_REQ;
- Message.oslDataPtr = (oslParaType*) myMsgPtr;
- Message.oslPeerBuffPtr = NULL;
- OslMsgSendExtQueue(&Message);
- SetProtocolEventHandler(mmi_poc_dereg_pres_unsubscribe_rsp, MSG_ID_POC_PRESENCE_SUBSCRIBE_RSP);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_dereg_pres_unsubscribe_rsp
- * DESCRIPTION
- * response for presence unsubscribe when deregistering
- * PARAMETERS
- * info [IN] Local parameters from protocol
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_dereg_pres_unsubscribe_rsp(void *info)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- poc_presence_subscribe_rsp_struct *msgRsp;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- msgRsp = (poc_presence_subscribe_rsp_struct*) info;
- ClearProtocolEventHandler(MSG_ID_POC_PRESENCE_SUBSCRIBE_RSP);
- #if (0)
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- #endif /* (0) */
- mmi_poc_dereg_pres_unpublish_req();
- }
- #else /* __POC_NON_RLS__ */
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_dereg_pres_unsubscribe_req
- * DESCRIPTION
- * Presence unscribe when deregistration
- * PARAMETERS
- * void
- * info(?) [IN] Local parameters from protocol
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_dereg_pres_unsubscribe_req(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- MYQUEUE Message;
- poc_presence_subscribe_req_struct *myMsgPtr;
- static U8 curr_group = 0, curr_entry = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- for (; (g_poc_cntx_p->contact_list[curr_group].valid == MMI_TRUE) &&
- (curr_group < MAX_POC_GROUP_FILE_NUM * MAX_POC_GROUPS_PER_FILE_NUM); curr_group++)
- {
- for (; curr_entry < g_poc_cntx_p->contact_list[curr_group].no_entries; curr_entry++)
- {
- if (g_poc_cntx_p->contact_list[curr_group].entries[curr_entry].sub_pres == MMI_TRUE)
- {
- myMsgPtr =
- (poc_presence_subscribe_req_struct*)
- OslConstructDataPtr(sizeof(poc_presence_subscribe_req_struct));
- memset(
- (U8*) myMsgPtr + sizeof(mmi_poc_dummy_req_struct),
- 0,
- sizeof(poc_presence_subscribe_req_struct) - sizeof(mmi_poc_dummy_req_struct));
- myMsgPtr->action = POC_UNSUBSCRIBE_ACTION;
- myMsgPtr->use_presence_list = MMI_FALSE;
- memcpy(
- myMsgPtr->uri,
- g_poc_cntx_p->contact_list[curr_group].entries[curr_entry].uri,
- POC_MAX_URI_LEN * sizeof(U8));
- Message.oslSrcId = MOD_MMI;
- Message.oslDestId = MOD_POC;
- Message.oslMsgId = MSG_ID_POC_PRESENCE_SUBSCRIBE_REQ;
- Message.oslDataPtr = (oslParaType*) myMsgPtr;
- Message.oslPeerBuffPtr = NULL;
- OslMsgSendExtQueue(&Message);
- SetProtocolEventHandler(mmi_poc_dereg_pres_unsubscribe_rsp, MSG_ID_POC_PRESENCE_SUBSCRIBE_RSP);
- curr_entry++;
- return;
- }
- }
- curr_entry = 0;
- }
- curr_group = 0;
- curr_entry = 0;
- mmi_poc_dereg_pres_unpublish_req();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_dereg_pres_unsubscribe_rsp
- * DESCRIPTION
- * Presence unsubscribe response when deregistering
- * PARAMETERS
- * info [IN] Local parameters from protocol
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_dereg_pres_unsubscribe_rsp(void *info)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- poc_presence_subscribe_rsp_struct *msgRsp;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- msgRsp = (poc_presence_subscribe_rsp_struct*) info;
- ClearProtocolEventHandler(MSG_ID_POC_PRESENCE_SUBSCRIBE_RSP);
- #if (0)
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- #endif /* (0) */
- mmi_poc_dereg_pres_unsubscribe_req();
- }
- #endif /* __POC_NON_RLS__ */
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_dereg_pres_unpublish_req
- * DESCRIPTION
- * presence unpublish request for deregistering
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_dereg_pres_unpublish_req(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- MYQUEUE Message;
- poc_presence_publish_req_struct *myMsgPtr;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- myMsgPtr = (poc_presence_publish_req_struct*) OslConstructDataPtr(sizeof(poc_presence_publish_req_struct));
- memset(
- (U8*) myMsgPtr + sizeof(mmi_poc_dummy_req_struct),
- 0,
- sizeof(poc_presence_publish_req_struct) - sizeof(mmi_poc_dummy_req_struct));
- myMsgPtr->remove = MMI_TRUE;
- memcpy(
- myMsgPtr->pinfo.entity,
- g_poc_cntx_p->profile_list[g_poc_cntx_p->profile_active].uri,
- POC_MAX_URI_LEN * sizeof(U8));
- Message.oslSrcId = MOD_MMI;
- Message.oslDestId = MOD_POC;
- Message.oslMsgId = MSG_ID_POC_PRESENCE_PUBLISH_REQ;
- Message.oslDataPtr = (oslParaType*) myMsgPtr;
- Message.oslPeerBuffPtr = NULL;
- OslMsgSendExtQueue(&Message);
- SetProtocolEventHandler(mmi_poc_dereg_pres_unpublish_rsp, MSG_ID_POC_PRESENCE_PUBLISH_RSP);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_dereg_pres_unpublish_rsp
- * DESCRIPTION
- * presence unpublish response when deregistering
- * PARAMETERS
- * info [IN] Local parameters from protocol
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_dereg_pres_unpublish_rsp(void *info)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- poc_presence_publish_rsp_struct *msgRsp;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- msgRsp = (poc_presence_publish_rsp_struct*) info;
- ClearProtocolEventHandler(MSG_ID_POC_PRESENCE_PUBLISH_RSP);
- mmi_poc_deregister_req();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_deregister_req
- * DESCRIPTION
- * poc deregister request
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_deregister_req(void)
- {
- #ifdef __POC_MMI_TEST_XDM_ONLY__
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_poc_cntx_p->curr_reg_state = POC_REG_NONE;
- HideStatusIcon(STATUS_ICON_POC);
- UpdateStatusIcons();
- if (g_poc_cntx_p->curr_use_xdm_mode == MMI_TRUE)
- {
- mmi_poc_group_deinit_req();
- }
- else
- {
- if (GetActiveScreenId() == SCR_ID_POC_REG)
- {
- DisplayPopup(
- (U8*) GetString(STR_GLOBAL_DONE),
- IMG_GLOBAL_ACTIVATED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) SUCCESS_TONE);
- }
- else if (GetActiveScreenId() == SCR_ID_POC_MAIN)
- {
- DisplayPopup(
- (U8*) GetString(STR_ID_POC_DEREGISTERED),
- IMG_GLOBAL_ACTIVATED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) SUCCESS_TONE);
- }
- DeleteScreenIfPresent(SCR_ID_POC_REG);
- }
- #else /* __POC_MMI_TEST_XDM_ONLY__ */
- MYQUEUE Message;
- poc_register_req_struct *myMsgPtr;
- myMsgPtr = (poc_register_req_struct*) OslConstructDataPtr(sizeof(poc_register_req_struct));
- memset(
- (U8*) myMsgPtr + sizeof(mmi_poc_dummy_req_struct),
- 0,
- sizeof(poc_register_req_struct) - sizeof(mmi_poc_dummy_req_struct));
- myMsgPtr->action = POC_DEREGISTER_ACTION;
- memset(&myMsgPtr->contact, 0, sizeof(poc_addr_struct));
- myMsgPtr->data_account = 0;
- memset(myMsgPtr->proxy_addr, 0, POC_PROXY_ADDR_LEN * sizeof(U8));
- myMsgPtr->proxy_port = 0;
- memset(myMsgPtr->password, 0, POC_MAX_PASSWORD_LEN * sizeof(U8));
- Message.oslSrcId = MOD_MMI;
- Message.oslDestId = MOD_POC;
- Message.oslMsgId = PRT_POC_REGISTER_REQ;
- Message.oslDataPtr = (oslParaType*) myMsgPtr;
- Message.oslPeerBuffPtr = NULL;
- OslMsgSendExtQueue(&Message);
- SetProtocolEventHandler(mmi_poc_deregister_rsp, PRT_POC_REGISTER_RSP);
- #endif /* __POC_MMI_TEST_XDM_ONLY__ */
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_deregister_rsp
- * DESCRIPTION
- * poc deregister response
- * PARAMETERS
- * info [IN] Local parameters from protocol
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_deregister_rsp(void *info)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- poc_register_rsp_struct *msgRsp;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- msgRsp = (poc_register_rsp_struct*) info;
- ClearProtocolEventHandler(PRT_POC_REGISTER_RSP);
- if (msgRsp->result != POC_OK)
- {
- g_poc_cntx_p->reg_error = MMI_TRUE;
- }
- g_poc_cntx_p->curr_reg_state = POC_REG_NONE;
- HideStatusIcon(STATUS_ICON_POC);
- UpdateStatusIcons();
- if (g_poc_cntx_p->curr_use_xdm_mode == MMI_TRUE)
- {
- mmi_poc_group_deinit_req();
- }
- else
- {
- if (GetActiveScreenId() == SCR_ID_POC_REG)
- {
- DisplayPopup(
- (U8*) GetString(STR_GLOBAL_DONE),
- IMG_GLOBAL_ACTIVATED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) SUCCESS_TONE);
- }
- else if (GetActiveScreenId() == SCR_ID_POC_MAIN)
- {
- DisplayPopup(
- (U8*) GetString(STR_ID_POC_DEREGISTERED),
- IMG_GLOBAL_ACTIVATED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) SUCCESS_TONE);
- }
- DeleteScreenIfPresent(SCR_ID_POC_REG);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_group_deinit_req
- * DESCRIPTION
- * poc group de-init request
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_group_deinit_req(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- MYQUEUE Message;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetProtocolEventHandler(mmi_poc_group_deinit_rsp, MSG_ID_POC_GROUP_DEINIT_RSP);
- Message.oslSrcId = MOD_MMI;
- Message.oslDestId = MOD_POC;
- Message.oslMsgId = MSG_ID_POC_GROUP_DEINIT_REQ;
- Message.oslDataPtr = NULL;
- Message.oslPeerBuffPtr = NULL;
- OslMsgSendExtQueue(&Message);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_group_deinit_rsp
- * DESCRIPTION
- * poc group deinit response
- * PARAMETERS
- * info [IN] Local parameters from protocol
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_group_deinit_rsp(void *info)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- poc_group_deinit_rsp_struct *msgRsp;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- msgRsp = (poc_group_deinit_rsp_struct*) info;
- ClearProtocolEventHandler(MSG_ID_POC_GROUP_DEINIT_RSP);
- memset(&g_poc_cntx_p->progressing, 0, sizeof(g_poc_cntx_p->progressing));
- if (msgRsp->result != POC_OK)
- {
- g_poc_cntx_p->reg_error = MMI_TRUE;
- }
- if (g_poc_cntx_p->reg_error != MMI_TRUE)
- {
- if (GetActiveScreenId() == SCR_ID_POC_REG)
- {
- DisplayPopup(
- (U8*) GetString(STR_GLOBAL_DONE),
- IMG_GLOBAL_ACTIVATED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) SUCCESS_TONE);
- }
- else if (GetActiveScreenId() == SCR_ID_POC_MAIN)
- {
- DisplayPopup(
- (U8*) GetString(STR_ID_POC_DEREGISTERED),
- IMG_GLOBAL_ACTIVATED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) SUCCESS_TONE);
- }
- DeleteScreenIfPresent(SCR_ID_POC_REG);
- }
- else
- {
- if (((GetActiveScreenId() == SCR_ID_POC_REG) || (GetActiveScreenId() == SCR_ID_POC_MAIN)))
- {
- DisplayPopup(
- (U8*) GetString(STR_GLOBAL_NOT_DONE),
- IMG_GLOBAL_UNFINISHED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) ERROR_TONE);
- }
- DeleteScreenIfPresent(SCR_ID_POC_REG);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_contact_1_to_1_invite
- * DESCRIPTION
- * 1 to 1 invitation through contact
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_contact_1_to_1_invite(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- poc_addr_struct callee[POC_MAX_ADDR_NUM];
- mmi_poc_contact_list_disp *cont;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (g_poc_cntx_p->call_status != POC_CALL_NONE)
- {
- MMI_TRACE((MMI_TRACE_G7_MISC, MMI_POC_CALL_STATE, (S32) g_poc_cntx_p->call_status));
- DisplayPopup(
- (U8*) GetString(STR_ID_POC_ERR_TERMINATE_CALL_FIRST),
- IMG_GLOBAL_WARNING,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) WARNING_TONE);
- return;
- }
- g_poc_cntx_p->ptt_button_status = POC_PTT_DOWN;
- cont = &g_poc_cntx_p->contact_list_disp[g_poc_cntx_p->contact_selected];
- memset(g_poc_cntx_p->cm_talk_list, 0, sizeof(g_poc_cntx_p->cm_talk_list));
- g_poc_cntx_p->cm_talk_list_num = 0;
- strncpy(
- (S8*) g_poc_cntx_p->calling_disp.name,
- (S8*) g_poc_cntx_p->contact_list[cont->group_id].entries[cont->entry_id].display_name,
- POC_MAX_DISP_LEN - 1);
- strncpy(
- (S8*) g_poc_cntx_p->calling_disp.uri,
- (S8*) g_poc_cntx_p->contact_list[cont->group_id].entries[cont->entry_id].uri,
- POC_MAX_URI_LEN - 1);
- memset(callee, 0, sizeof(callee));
- memcpy(
- callee[0].disp_name,
- g_poc_cntx_p->contact_list[cont->group_id].entries[cont->entry_id].display_name,
- sizeof(callee[0].disp_name));
- memcpy(
- callee[0].uri,
- g_poc_cntx_p->contact_list[cont->group_id].entries[cont->entry_id].uri,
- sizeof(callee[0].uri));
- memset(g_poc_cntx_p->cm_talk_group_name, 0, sizeof(g_poc_cntx_p->cm_talk_group_name));
- mmi_poc_entry_inviting();
- mmi_poc_talk_invite_req(POC_1_TO_1_TALK, 1, callee, 0, 0, 0);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_talk_group_invite
- * DESCRIPTION
- * poc talk group invite
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_talk_group_invite(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- poc_addr_struct callee[POC_MAX_ADDR_NUM];
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (g_poc_cntx_p->call_status != POC_CALL_NONE)
- {
- MMI_TRACE((MMI_TRACE_G7_MISC, MMI_POC_CALL_STATE, (S32) g_poc_cntx_p->call_status));
- DisplayPopup(
- (U8*) GetString(STR_ID_POC_ERR_TERMINATE_CALL_FIRST),
- IMG_GLOBAL_WARNING,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) WARNING_TONE);
- return;
- }
- g_poc_cntx_p->ptt_button_status = POC_PTT_DOWN;
- memset(g_poc_cntx_p->cm_talk_list, 0, sizeof(g_poc_cntx_p->cm_talk_list));
- g_poc_cntx_p->cm_talk_list_num = 0;
- strncpy(
- (S8*) g_poc_cntx_p->calling_disp.name,
- (S8*) g_poc_cntx_p->talk_group_list[g_poc_cntx_p->talk_group_selected].display_name,
- POC_MAX_DISP_LEN - 1);
- strncpy(
- (S8*) g_poc_cntx_p->calling_disp.uri,
- (S8*) g_poc_cntx_p->talk_group_list[g_poc_cntx_p->talk_group_selected].list_uri,
- POC_MAX_URI_LEN - 1);
- memset(callee, 0, sizeof(callee));
- memcpy(
- callee[0].disp_name,
- g_poc_cntx_p->talk_group_list[g_poc_cntx_p->talk_group_selected].display_name,
- sizeof(callee[0].disp_name));
- memcpy(
- callee[0].uri,
- g_poc_cntx_p->talk_group_list[g_poc_cntx_p->talk_group_selected].list_uri,
- sizeof(callee[0].uri));
- memset(g_poc_cntx_p->cm_talk_group_name, 0, sizeof(g_poc_cntx_p->cm_talk_group_name));
- if (strlen((S8*) g_poc_cntx_p->talk_group_list[g_poc_cntx_p->talk_group_selected].display_name))
- {
- strncpy(
- (S8*) g_poc_cntx_p->cm_talk_group_name,
- (S8*) g_poc_cntx_p->talk_group_list[g_poc_cntx_p->talk_group_selected].display_name,
- POC_MAX_DISP_LEN - 1);
- }
- else
- {
- strncpy(
- (S8*) g_poc_cntx_p->cm_talk_group_name,
- (S8*) g_poc_cntx_p->talk_group_list[g_poc_cntx_p->talk_group_selected].list_uri,
- POC_MAX_DISP_LEN - 1);
- }
- mmi_poc_entry_inviting();
- if (g_poc_cntx_p->talk_group_list[g_poc_cntx_p->talk_group_selected].invite_member == MMI_TRUE)
- {
- mmi_poc_talk_invite_req(POC_PRE_ARRANGED_GROUP_TALK, 1, callee, 0, 0, 0);
- }
- else
- {
- mmi_poc_talk_invite_req(POC_CHAT_GROUP_TALK, 1, callee, 0, 0, 0);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_talk_invite_req
- * DESCRIPTION
- * poc talk group invite request
- * PARAMETERS
- * talk_type [IN] Talk type
- * no_callee [IN] Number of callees
- * callee [IN] Callee address structure
- * talk_id [IN] Talk id
- * refer [IN] Refer flag
- * rejoin [IN] Rejoin flag
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_talk_invite_req(U8 talk_type, U8 no_callee, poc_addr_struct *callee, U32 talk_id, U8 refer, U8 rejoin)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- MYQUEUE Message;
- poc_talk_invite_req_struct *myMsgPtr;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- myMsgPtr = (poc_talk_invite_req_struct*) OslConstructDataPtr(sizeof(poc_talk_invite_req_struct));
- memset(
- (U8*) myMsgPtr + sizeof(mmi_poc_dummy_req_struct),
- 0,
- sizeof(poc_talk_invite_req_struct) - sizeof(mmi_poc_dummy_req_struct));
- myMsgPtr->request_id = POC_REQUEST_ID;
- myMsgPtr->talk_type = talk_type;
- myMsgPtr->num_addr = no_callee;
- memcpy(myMsgPtr->callee, callee, sizeof(myMsgPtr->callee));
- myMsgPtr->talk_id = talk_id;
- myMsgPtr->refer = refer;
- myMsgPtr->mao = g_poc_cntx_p->curr_mao_mode;
- myMsgPtr->rejoin = rejoin;
- if (refer == 0)
- {
- g_poc_cntx_p->talk_pres_ind_recved = POC_TALK_STATUS_NOT_READY;
- }
- Message.oslSrcId = MOD_MMI;
- Message.oslDestId = MOD_POC;
- Message.oslMsgId = PRT_POC_TALK_INVITE_REQ;
- Message.oslDataPtr = (oslParaType*) myMsgPtr;
- Message.oslPeerBuffPtr = NULL;
- OslMsgSendExtQueue(&Message);
- g_poc_cntx_p->floor_idle_recved = MMI_FALSE;
- g_poc_cntx_p->call_status = POC_CALL_ACTIVE;
- MMI_TRACE((MMI_TRACE_G7_MISC, MMI_POC_CALL_STATE, (S32) g_poc_cntx_p->call_status));
- SetProtocolEventHandler(mmi_poc_invite_rsp, PRT_POC_TALK_INVITE_RSP);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_invite_rsp
- * DESCRIPTION
- * poc invite response
- * PARAMETERS
- * info [IN] Local parameters from protocol
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_invite_rsp(void *info)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- poc_talk_invite_rsp_struct *msgRsp;
- U8 list_name[POC_MAX_DISP_LEN];
- U8 uri[POC_MAX_URI_LEN];
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- msgRsp = (poc_talk_invite_rsp_struct*) info;
- MMI_TRACE((MMI_TRACE_G7_MISC, MMI_POC_INVITE_RSP, (S32) g_poc_cntx_p->ptt_button_status));
- ClearProtocolEventHandler(PRT_POC_TALK_INVITE_RSP);
- if (msgRsp->result == POC_OK)
- {
- g_poc_cntx_p->active_talk_id = msgRsp->talk_id;
- g_poc_cntx_p->call_status = POC_CALL_ACTIVE;
- if (IsScreenPresent(SCR_ID_POC_CM))
- {
- HistoryReplace(SCR_ID_POC_CM, SCR_ID_POC_CM, mmi_poc_entry_connected_idle);
- }
- else if (GetActiveScreenId() == SCR_ID_POC_CM)
- {
- mmi_poc_entry_connected_idle();
- }
- }
- else
- {
- g_poc_cntx_p->call_status = POC_CALL_NONE;
- if (g_poc_cntx_p->mo_inviting == MMI_TRUE)
- {
- mmi_poc_show_error_cause(msgRsp->result, msgRsp->cause);
- DeleteScreenIfPresent(SCR_ID_POC_CM);
- mmi_poc_remove_cm_screens();
- }
- }
- MMI_TRACE((MMI_TRACE_G7_MISC, MMI_POC_CALL_STATE, (S32) g_poc_cntx_p->call_status));
- if (strlen((S8*) g_poc_cntx_p->cm_talk_group_name))
- {
- strncpy((S8*) list_name, (S8*) g_poc_cntx_p->cm_talk_group_name, POC_MAX_DISP_LEN - 1);
- }
- else if (strlen((S8*) g_poc_cntx_p->calling_disp.name))
- {
- strncpy((S8*) list_name, (S8*) g_poc_cntx_p->calling_disp.name, POC_MAX_DISP_LEN - 1);
- }
- else
- {
- strncpy((S8*) list_name, (S8*) g_poc_cntx_p->calling_disp.uri, POC_MAX_DISP_LEN - 1);
- }
- strncpy((S8*) uri, (S8*) msgRsp->session_id, POC_MAX_URI_LEN - 1);
- if (strlen((S8*) uri))
- {
- mmi_poc_history_add(POC_OUTGOING_CALL, MMI_TRUE, list_name, uri, NULL);
- }
- else
- {
- mmi_poc_history_add(POC_OUTGOING_CALL, MMI_FALSE, list_name, g_poc_cntx_p->calling_disp.uri, NULL);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_entry_inviting
- * DESCRIPTION
- * poc inviting screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_entry_inviting(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *guiBuffer;
- U8 temp_disp[POC_MAX_DISP_LEN * 2];
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_TRACE((MMI_TRACE_G7_MISC, MMI_POC_ENTRY_INVITING));
- EntryNewScreen(SCR_ID_POC_CM, mmi_poc_exit_release_ptt, mmi_poc_entry_inviting, NULL);
- DeleteUptoScrID(SCR_ID_POC_MAIN);
- DeleteScreenIfPresent(SCR_ID_POC_CM);
- mmi_poc_remove_cm_screens();
- SetDelScrnIDCallbackHandler(SCR_ID_POC_CM, (HistoryDelCBPtr) mmi_poc_cm_history_del_handler);
- guiBuffer = GetCurrGuiBuffer(SCR_ID_POC_CM);
- g_poc_cntx_p->mo_inviting = MMI_TRUE;
- memset(g_poc_cntx_p->cm_disp, 0, sizeof(g_poc_cntx_p->cm_disp));
- UCS2Strcpy((S8*) g_poc_cntx_p->cm_disp, (S8*) GetString(STR_ID_POC_CM_INVITING));
- if (strlen((S8*) g_poc_cntx_p->calling_disp.name))
- {
- mmi_poc_util_copy_with_dot((S8*) g_poc_cntx_p->calling_disp.name, (S8*) temp_disp, POC_MAX_DISP_LEN - 1);
- }
- else
- {
- mmi_poc_util_copy_with_dot((S8*) g_poc_cntx_p->calling_disp.uri, (S8*) temp_disp, POC_MAX_DISP_LEN - 1);
- }
- UCS2Strcat((S8*) g_poc_cntx_p->cm_disp, (S8*) temp_disp);
- ShowCategory66Screen(
- STR_ID_POC_MAIN,
- GetRootTitleIcon(MENU_ID_POC_MAIN),
- 0,
- 0,
- STR_GLOBAL_ABORT,
- IMG_GLOBAL_BACK,
- (U8*) g_poc_cntx_p->cm_disp,
- IMG_ID_POC_CM_INVITING,
- NULL);
- SetRightSoftkeyFunction(mmi_poc_disconnect_back, KEY_EVENT_UP);
- SetKeyHandler(mmi_poc_disconnect_end, KEY_END, KEY_EVENT_DOWN);
- SetKeyHandler(mmi_poc_ptt_release, KEY_SEND, KEY_EVENT_UP);
- SetKeyHandler(mmi_poc_ptt_press, KEY_SEND, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_exit_release_ptt
- * DESCRIPTION
- * release ptt key when exiting screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_exit_release_ptt(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_TRACE((MMI_TRACE_G7_MISC, MMI_POC_EXIT_RELEASE_PTT));
- g_poc_cntx_p->mo_inviting = MMI_FALSE;
- if (GetActiveScreenId() != SCR_ID_POC_CM)
- {
- mmi_poc_ptt_release();
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_ptt_press
- * DESCRIPTION
- * ptt key press handler
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_ptt_press(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_TRACE((MMI_TRACE_G7_MISC, MMI_POC_PTT_PRESS));
- g_poc_cntx_p->ptt_button_status = POC_PTT_DOWN;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_ptt_release
- * DESCRIPTION
- * ptt key release handler
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_ptt_release(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_TRACE((MMI_TRACE_G7_MISC, MMI_POC_PTT_RELEASE));
- g_poc_cntx_p->ptt_button_status = POC_PTT_UP;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_progress_ind
- * DESCRIPTION
- * process indication handler
- * PARAMETERS
- * info [IN] Local parameters from protocol
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_progress_ind(void *info)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- poc_talk_progress_ind_struct *msgRsp;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- msgRsp = (poc_talk_progress_ind_struct*) info;
- if (msgRsp->status_code == 180)
- { /* 180 = ringing */
- if (IsScreenPresent(SCR_ID_POC_CM))
- {
- HistoryReplace(SCR_ID_POC_CM, SCR_ID_POC_CM, mmi_poc_entry_mo_ringing);
- }
- else
- {
- mmi_poc_entry_mo_ringing();
- }
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_entry_mo_ringing
- * DESCRIPTION
- * mo ringing screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_entry_mo_ringing(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *guiBuffer;
- U8 temp_disp[POC_MAX_DISP_LEN * 2];
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_TRACE((MMI_TRACE_G7_MISC, MMI_POC_ENTRY_MO_RINGING));
- AudioPlayReq(POC_MO_RING_TONE, DEVICE_AUDIO_PLAY_INFINITE);
- EntryNewScreen(SCR_ID_POC_CM, mmi_poc_exit_mo_ringing, mmi_poc_entry_mo_ringing, NULL);
- DeleteScreenIfPresent(SCR_ID_POC_CM);
- mmi_poc_remove_cm_screens();
- SetDelScrnIDCallbackHandler(SCR_ID_POC_CM, (HistoryDelCBPtr) mmi_poc_cm_history_del_handler);
- g_poc_cntx_p->mo_inviting = MMI_TRUE;
- guiBuffer = GetCurrGuiBuffer(SCR_ID_POC_CM);
- memset(g_poc_cntx_p->cm_disp, 0, sizeof(g_poc_cntx_p->cm_disp));
- UCS2Strcpy((S8*) g_poc_cntx_p->cm_disp, (S8*) GetString(STR_ID_POC_CM_MO_RINGING));
- if (strlen((S8*) g_poc_cntx_p->calling_disp.name))
- {
- mmi_poc_util_copy_with_dot((S8*) g_poc_cntx_p->calling_disp.name, (S8*) temp_disp, POC_MAX_DISP_LEN - 1);
- }
- else
- {
- mmi_poc_util_copy_with_dot((S8*) g_poc_cntx_p->calling_disp.uri, (S8*) temp_disp, POC_MAX_DISP_LEN - 1);
- }
- UCS2Strcat((S8*) g_poc_cntx_p->cm_disp, (S8*) temp_disp);
- ShowCategory66Screen(
- STR_ID_POC_MAIN,
- GetRootTitleIcon(MENU_ID_POC_MAIN),
- 0,
- 0,
- STR_GLOBAL_ABORT,
- IMG_GLOBAL_BACK,
- (U8*) g_poc_cntx_p->cm_disp,
- IMG_ID_POC_CM_MO_RINGING,
- NULL);
- SetRightSoftkeyFunction(mmi_poc_disconnect_back, KEY_EVENT_UP);
- SetKeyHandler(mmi_poc_disconnect_end, KEY_END, KEY_EVENT_DOWN);
- SetKeyHandler(mmi_poc_ptt_release, KEY_SEND, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_exit_mo_ringing
- * DESCRIPTION
- * exit function for mo ringing
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_exit_mo_ringing(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_TRACE((MMI_TRACE_G7_MISC, MMI_POC_EXIT_MO_RINGING));
- g_poc_cntx_p->mo_inviting = MMI_FALSE;
- AudioStopReq(POC_MO_RING_TONE);
- mmi_poc_exit_release_ptt();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_disconnect_back
- * DESCRIPTION
- * disconnect go back
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_disconnect_back(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_TRACE((MMI_TRACE_G7_MISC, MMI_POC_DISCONNECT_BACK));
- g_poc_cntx_p->abort_type = POC_ABORT_BACK;
- mmi_poc_entry_media_processing();
- switch (g_poc_cntx_p->audio_status)
- {
- case POC_AUDIO_NONE:
- mmi_poc_talk_disconnect_req();
- break;
- case POC_AUDIO_ENCODING:
- mmi_poc_audio_encode_stop(mmi_poc_talk_disconnect_req);
- break;
- case POC_AUDIO_DECODING:
- mmi_poc_audio_decode_stop(mmi_poc_talk_disconnect_req);
- break;
- default:
- break;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_disconnect_end
- * DESCRIPTION
- * disconnect and go back to idle screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_disconnect_end(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_TRACE((MMI_TRACE_G7_MISC, MMI_POC_DISCONNECT_END));
- g_poc_cntx_p->abort_type = POC_ABORT_END;
- mmi_poc_entry_media_processing();
- switch (g_poc_cntx_p->audio_status)
- {
- case POC_AUDIO_NONE:
- mmi_poc_talk_disconnect_req();
- break;
- case POC_AUDIO_ENCODING:
- mmi_poc_audio_encode_stop(mmi_poc_talk_disconnect_req);
- break;
- case POC_AUDIO_DECODING:
- mmi_poc_audio_decode_stop(mmi_poc_talk_disconnect_req);
- break;
- default:
- break;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_talk_disconnect_req
- * DESCRIPTION
- * talk disconnect request
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_talk_disconnect_req(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- MYQUEUE Message;
- poc_talk_disconnect_req_struct *myMsgPtr;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_poc_cntx_p->call_status = POC_CALL_PROGRESSING;
- myMsgPtr = (poc_talk_disconnect_req_struct*) OslConstructDataPtr(sizeof(poc_talk_disconnect_req_struct));
- memset(
- (U8*) myMsgPtr + sizeof(mmi_poc_dummy_req_struct),
- 0,
- sizeof(poc_talk_disconnect_req_struct) - sizeof(mmi_poc_dummy_req_struct));
- myMsgPtr->request_id = POC_REQUEST_ID;
- myMsgPtr->talk_id = g_poc_cntx_p->active_talk_id;
- Message.oslSrcId = MOD_MMI;
- Message.oslDestId = MOD_POC;
- Message.oslMsgId = PRT_POC_TALK_DISCONNECT_REQ;
- Message.oslDataPtr = (oslParaType*) myMsgPtr;
- Message.oslPeerBuffPtr = NULL;
- OslMsgSendExtQueue(&Message);
- SetProtocolEventHandler(mmi_poc_talk_disconnect_rsp, PRT_POC_TALK_DISCONNECT_RSP);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_talk_disconnect_rsp
- * DESCRIPTION
- * poc talk disconnect response
- * PARAMETERS
- * info [IN] Local parameters from protocol
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_talk_disconnect_rsp(void *info)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- poc_talk_disconnect_rsp_struct *msgRsp;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- msgRsp = (poc_talk_disconnect_rsp_struct*) info;
- g_poc_cntx_p->call_status = POC_CALL_NONE;
- MMI_TRACE((MMI_TRACE_G7_MISC, MMI_POC_CALL_STATE, (S32) g_poc_cntx_p->call_status));
- ClearProtocolEventHandler(PRT_POC_TALK_DISCONNECT_RSP);
- DeleteScreenIfPresent(SCR_ID_POC_CM);
- mmi_poc_remove_cm_screens();
- if (GetActiveScreenId() == SCR_ID_POC_CM)
- {
- if (g_poc_cntx_p->abort_type == POC_ABORT_BACK)
- {
- mmi_poc_reset_all_audio();
- }
- else if (g_poc_cntx_p->abort_type == POC_ABORT_END)
- {
- DisplayIdleScreen();
- }
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_connect_ind
- * DESCRIPTION
- * connect indication handler
- * PARAMETERS
- * info [IN] Local parameters from protocol
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_connect_ind(void *info)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 list_name[POC_MAX_DISP_LEN];
- U8 uri[POC_MAX_URI_LEN];
- poc_talk_connect_ind_struct *msgRsp;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (isInCall() && (g_poc_cntx_p->call_status != POC_CALL_PROGRESSING))
- {
- switch (g_poc_cntx_p->audio_status)
- {
- case POC_AUDIO_NONE:
- mmi_poc_talk_disconnect_req();
- break;
- case POC_AUDIO_ENCODING:
- mmi_poc_audio_encode_stop(mmi_poc_talk_disconnect_req);
- break;
- case POC_AUDIO_DECODING:
- mmi_poc_audio_decode_stop(mmi_poc_talk_disconnect_req);
- break;
- default:
- break;
- }
- return;
- }
- msgRsp = (poc_talk_connect_ind_struct*) info;
- g_poc_cntx_p->active_talk_id = msgRsp->talk_id;
- memset(g_poc_cntx_p->cm_talk_group_name, 0, sizeof(g_poc_cntx_p->cm_talk_group_name));
- memset(g_poc_cntx_p->cm_talk_list, 0, sizeof(g_poc_cntx_p->cm_talk_list));
- g_poc_cntx_p->cm_talk_list_num = 0;
- switch (msgRsp->talk_type)
- {
- case POC_1_TO_1_TALK:
- case POC_UNKNOWN_TALK_TYPE:
- case POC_AD_HOC_GROUP_TALK:
- break;
- case POC_CHAT_GROUP_TALK:
- case POC_PRE_ARRANGED_GROUP_TALK:
- if (strlen((S8*) msgRsp->group_addr.disp_name))
- {
- strncpy(
- (S8*) g_poc_cntx_p->cm_talk_group_name,
- (S8*) msgRsp->group_addr.disp_name,
- POC_MAX_DISP_LEN - 1);
- }
- else
- {
- strncpy((S8*) g_poc_cntx_p->cm_talk_group_name, (S8*) msgRsp->group_addr.uri, POC_MAX_DISP_LEN - 1);
- }
- break;
- default:
- ASSERT(0);
- break;
- }
- if (msgRsp->caller_privacy == MMI_TRUE)
- {
- g_poc_cntx_p->calling_disp.name[0] = 0xFF;
- g_poc_cntx_p->calling_disp.name[1] = 0;
- }
- else
- {
- strncpy((S8*) g_poc_cntx_p->calling_disp.name, (S8*) msgRsp->caller.disp_name, POC_MAX_DISP_LEN - 1);
- strncpy((S8*) g_poc_cntx_p->calling_disp.uri, (S8*) msgRsp->caller.uri, POC_MAX_URI_LEN - 1);
- }
- g_poc_cntx_p->call_status = POC_CALL_ACTIVE;
- MMI_TRACE((MMI_TRACE_G7_MISC, MMI_POC_CALL_STATE, (S32) g_poc_cntx_p->call_status));
- if (strlen((S8*) g_poc_cntx_p->cm_talk_group_name))
- {
- strncpy((S8*) list_name, (S8*) g_poc_cntx_p->cm_talk_group_name, POC_MAX_DISP_LEN - 1);
- }
- else if (strlen((S8*) msgRsp->caller.disp_name))
- {
- strncpy((S8*) list_name, (S8*) msgRsp->caller.disp_name, POC_MAX_DISP_LEN - 1);
- }
- else
- {
- strncpy((S8*) list_name, (S8*) msgRsp->caller.uri, POC_MAX_DISP_LEN - 1);
- }
- strncpy((S8*) uri, (S8*) msgRsp->session_id, POC_MAX_URI_LEN - 1);
- mmi_poc_history_add(POC_INCOMING_CALL, MMI_TRUE, list_name, uri, NULL);
- g_poc_cntx_p->floor_idle_recved = MMI_TRUE;
- if (IsScreenPresent(SCR_ID_POC_CM))
- {
- HistoryReplace(SCR_ID_POC_CM, SCR_ID_POC_CM, mmi_poc_entry_connected_idle);
- }
- else
- {
- mmi_poc_entry_connected_idle();
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_ring_ind
- * DESCRIPTION
- * ringing indication handler
- * PARAMETERS
- * info [IN] Local parameters from protocol
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_ring_ind(void *info)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- poc_talk_ring_ind_struct *msgRsp;
- U8 list_name[POC_MAX_DISP_LEN];
- U8 uri[POC_MAX_URI_LEN];
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (isInCall() && (g_poc_cntx_p->call_status != POC_CALL_PROGRESSING))
- {
- mmi_poc_talk_answer_req(MMI_FALSE);
- ClearProtocolEventHandler(PRT_POC_TALK_ANSWER_RSP);
- return;
- }
- msgRsp = (poc_talk_ring_ind_struct*) info;
- if (g_poc_cntx_p->curr_reg_state == POC_REG_DEREGING)
- {
- mmi_poc_talk_answer_req(MMI_FALSE);
- ClearProtocolEventHandler(PRT_POC_TALK_ANSWER_RSP);
- return;
- }
- g_poc_cntx_p->active_talk_id = msgRsp->talk_id;
- memset(g_poc_cntx_p->cm_talk_group_name, 0, sizeof(g_poc_cntx_p->cm_talk_group_name));
- memset(g_poc_cntx_p->cm_talk_list, 0, sizeof(g_poc_cntx_p->cm_talk_list));
- g_poc_cntx_p->cm_talk_list_num = 0;
- switch (msgRsp->talk_type)
- {
- case POC_1_TO_1_TALK:
- case POC_UNKNOWN_TALK_TYPE:
- case POC_AD_HOC_GROUP_TALK:
- break;
- case POC_CHAT_GROUP_TALK:
- case POC_PRE_ARRANGED_GROUP_TALK:
- if (strlen((S8*) msgRsp->group_addr.disp_name))
- {
- strncpy(
- (S8*) g_poc_cntx_p->cm_talk_group_name,
- (S8*) msgRsp->group_addr.disp_name,
- POC_MAX_DISP_LEN - 1);
- }
- else
- {
- strncpy((S8*) g_poc_cntx_p->cm_talk_group_name, (S8*) msgRsp->group_addr.uri, POC_MAX_DISP_LEN - 1);
- }
- break;
- default:
- ASSERT(0);
- break;
- }
- g_poc_cntx_p->call_status = POC_CALL_ACTIVE;
- MMI_TRACE((MMI_TRACE_G7_MISC, MMI_POC_CALL_STATE, (S32) g_poc_cntx_p->call_status));
- if (msgRsp->caller_privacy == MMI_TRUE)
- {
- g_poc_cntx_p->calling_disp.name[0] = 0xFF;
- g_poc_cntx_p->calling_disp.name[1] = 0;
- }
- else
- {
- strncpy((S8*) g_poc_cntx_p->calling_disp.name, (S8*) msgRsp->caller.disp_name, POC_MAX_DISP_LEN - 1);
- strncpy((S8*) g_poc_cntx_p->calling_disp.uri, (S8*) msgRsp->caller.uri, POC_MAX_URI_LEN - 1);
- }
- if (strlen((S8*) g_poc_cntx_p->cm_talk_group_name))
- {
- strncpy((S8*) list_name, (S8*) g_poc_cntx_p->cm_talk_group_name, POC_MAX_DISP_LEN - 1);