Example #1
0
/*****************************************************************************
 * FUNCTION
 *  mmi_jmms_uc_cancel_mms_sending_for_usb
 * DESCRIPTION
 *  Function is used to cancel mms sending
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void mmi_jmms_uc_cancel_mms_sending_for_usb(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    JC_UINT32 msg_id = 0;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    PRINT_INFORMATION_2(MMI_TRACE_INFO, "%s", "mmi_jmms_uc_cancel_mms_sending_for_usb");
    msg_id = mmi_jmms_uc_get_msg_id_from_msg_handle(g_jmms_context->msg_handle);

    /* it means mms encapsulation or sending has sarted */
    if (msg_id > 0)
    {
        mmi_jmms_uc_error_struct error_data = {0, };

        PRINT_INFORMATION_2(MMI_TRACE_INFO, "%s", "Stop MMS Sending");
        if (g_jmms_context->reference_id)
        {
            mmi_jmms_communication_state_node_struct *comm_node_p = NULL;

            PRINT_INFORMATION_2(MMI_TRACE_INFO, "%s%d", "Stoping MMS Sending: ", g_jmms_context->reference_id);

            comm_node_p = mmi_jmms_get_comm_state(g_jmms_context, g_jmms_context->reference_id);

            if (comm_node_p && comm_node_p->callback)
            {
                error_data.error_code = -1;
                error_data.communication_handle_p = comm_node_p;
                comm_node_p->callback(MMS_SENDING_ERROR_CALLBACK, (void*)&error_data);
                /* this is done to stop MMS_COMMUNICATION_STOP_CALLBACK from being executed */
                comm_node_p->callback = NULL;
                mmi_jmms_free_message_header();
                mmi_jmms_free_comm_node(g_jmms_context, g_jmms_context->reference_id);
            }

            jdi_CommunicationStopReq(g_jmms_context->comm_handle, g_jmms_context->reference_id);
            jdi_CommunicationFreeReference(g_jmms_context->comm_handle, g_jmms_context->reference_id);
        }
        else if (g_jmms_context->msg_handle)
        {
            msg_id = mmi_jmms_uc_get_msg_id_from_msg_handle(g_jmms_context->msg_handle);
            if (msg_id > 0)
            {
                PRINT_INFORMATION_2(MMI_TRACE_INFO, "%s", "Stoping MMS Encapsulation: ");
                StopTimer(JMMS_ASYNC_SEND_TIMER);
                if (g_jmms_context->ext_cb)
                {
                    error_data.error_code = -1;
                    error_data.communication_handle_p = NULL;
                    g_jmms_context->ext_cb(MMS_SENDING_ERROR_CALLBACK, (void*)&error_data);
                }
            }
        }
    }
}
Example #2
0
/*****************************************************************************
 * FUNCTION
 *  mmi_jmms_uc_cancel_mms_sending
 * DESCRIPTION
 *  Function to cancel MMS sending
 * PARAMETERS
 *  msg_id      [IN]        
 * RETURNS
 *  void
 *****************************************************************************/
void mmi_jmms_uc_cancel_mms_sending(JC_UINT32 msg_id)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    mmi_jmms_communication_state_node_struct *communication_handle_p = NULL;
    mmi_jmms_communication_stop_struct sending_stop_data = {0, };

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    PRINT_INFORMATION_2(MMI_TRACE_INFO, "mmi_jmms_uc_cancel_mms_sending: %x", msg_id);

    ASSERT(msg_id);
    if (0xFFFFFF == msg_id)
    {
        mmi_jmms_cancel_all_mms_sending();
    }
    else
    {
        communication_handle_p = mmi_jmms_uc_get_communication_handle(msg_id);
        mmi_jmms_cancel_mms_sending(NULL, communication_handle_p);
        if (!communication_handle_p)
        {
            sending_stop_data.communication_handle_p = NULL;
            sending_stop_data.retCode = MMI_TRUE;
            sending_stop_data.msg_id = msg_id;
            mmi_jmms_uc_response_callback(MMS_COMMUNICATION_STOP_CALLBACK, (void*)&sending_stop_data);
        }
    }
}
Example #3
0
/*****************************************************************************
 * FUNCTION
 *  mmi_jmms_uc_handle_start_rsp
 * DESCRIPTION
 *  Function to handle sending start response
 * PARAMETERS
 *  send_start_rsp_p        [IN]        
 * RETURNS
 *  void
 *****************************************************************************/
void mmi_jmms_uc_handle_start_rsp(mmi_jmms_uc_start_comm_struct *send_start_rsp_p)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    MSG_HANDLE msg_handle = NULL;
    mmi_jmms_sending_list_struct *send_node_list_p = NULL;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    PRINT_INFORMATION_2(MMI_TRACE_INFO, "mmi_jmms_uc_handle_start_rsp: %d",
                         send_start_rsp_p->communication_handle_p->reference_id);

    /* add communication handle information in send node list */
    send_node_list_p = g_jmms_context->send_node_list;
    msg_handle = send_start_rsp_p->msg_handle;
    while (send_node_list_p)
    {
        if (send_node_list_p->msg_handle == msg_handle)
        {
            send_node_list_p->communication_handle_p = send_start_rsp_p->communication_handle_p;
            break;
        }
        send_node_list_p = send_node_list_p->next;
    }
}
Example #4
0
/*****************************************************************************
 * FUNCTION
 *  mmi_jmms_uc_handle_stop_ind
 * DESCRIPTION
 *  Function to handle stop communication indication.
 * PARAMETERS
 *  sending_stop_data_p     [IN]        
 * RETURNS
 *  void
 *****************************************************************************/
void mmi_jmms_uc_handle_stop_ind(mmi_jmms_communication_stop_struct *sending_stop_data_p)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    JC_UINT32 msg_id = 0;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    PRINT_INFORMATION_2(MMI_TRACE_INFO, "mmi_jmms_uc_handle_stop_ind");

#ifdef __MMI_JMMS_SEND_RETRIES__
    mmi_jmms_set_progress_screen_title(0);
#endif 

#ifdef __MMI_JMMS_RESPONSE_TIMEOUT__
    mmi_jmms_stop_timeout_timer();
#endif 
    if (sending_stop_data_p->communication_handle_p)
    {
        PRINT_INFORMATION_2(MMI_TRACE_INFO, "mmi_jmms_uc_handle_stop_ind: %d",
                             sending_stop_data_p->communication_handle_p->reference_id);
        msg_id = mmi_jmms_uc_get_msgid(sending_stop_data_p->communication_handle_p);
        ASSERT(msg_id > 0);
    }

    else
    {
        msg_id = sending_stop_data_p->msg_id;
        ASSERT(msg_id > 0);
    }

    /* remove node from send list */
    mmi_jmms_uc_remove_send_node(msg_id);
    /* send stop response to UC */
    if (g_jmms_context->uc_cancel_req_id && g_jmms_context->msg_id)
    {
        mmi_jmms_uc_send_stop_ind(E_TRUE, msg_id);
        /* call UC API to indicate sending has completed */
        mmi_jmms_uc_sending_complete_rsp_for_cancel_send(msg_id, E_TRUE, NULL); /* True for cancel success */
    }
    else if (g_jmms_context->msg_id)
    {
        mmi_jmms_uc_sending_complete(msg_id, MMA_RESULT_FAIL_USER_CANCEL, NULL);
    }
}
Example #5
0
/*****************************************************************************
 * FUNCTION
 *  mmi_jmms_uc_response_callback
 * DESCRIPTION
 *  Callback to handle response from protocol layer
 * PARAMETERS
 *  cb_type     [IN]        
 *  data_p      [IN]        
 * RETURNS
 *  void
 *****************************************************************************/
void mmi_jmms_uc_response_callback(mmi_jmms_communication_callback_enumm cb_type, void *data_p)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    PRINT_INFORMATION_2(MMI_TRACE_INFO, "mmi_jmms_uc_response_callback: %d", cb_type);
    /* data cant be NULL. */
    ASSERT(data_p);

    switch (cb_type)
    {
        case MMS_SENDING_START_CALLBACK:
        {
            mmi_jmms_uc_start_comm_struct *comm_start_data_p = (mmi_jmms_uc_start_comm_struct*) data_p;

            PRINT_INFORMATION_2(MMI_TRACE_INFO, "MMS_SENDING_START_CALLBACK");
            mmi_jmms_uc_handle_start_rsp(comm_start_data_p);
        }
            break;
        case MMS_COMMUNICATION_PROGRESS_CALLBACK:
        {
            mmi_jmms_comm_progress_struct *progress_ind_data_p = (mmi_jmms_comm_progress_struct*) data_p;

            PRINT_INFORMATION_2(MMI_TRACE_INFO, "MMS_SEND_PROGRESS_IND_CALLBACK");
            mmi_jmms_uc_handle_progress_ind(progress_ind_data_p);
        }
            break;
        case MMS_SENDING_COMPELETE_CALLBACK:
        {
            mmi_jmms_uc_sending_complete_struct *sending_complete_data_p =
                (mmi_jmms_uc_sending_complete_struct*) data_p;
            PRINT_INFORMATION_2(MMI_TRACE_INFO, "MMS_SENDING_COMPELETE_CALLBACK");
            mmi_jmms_uc_handle_sending_complete_rsp(sending_complete_data_p);
        }
            break;
        case MMS_SENDING_ERROR_CALLBACK:
        {
            mmi_jmms_uc_error_struct *error_data_p = (mmi_jmms_uc_error_struct*) data_p;

            PRINT_INFORMATION_2(MMI_TRACE_INFO, "MMS_SENDING_ERROR_CALLBACK");
            mmi_jmms_uc_handle_error_ind(error_data_p);
        }
            break;
        case MMS_COMMUNICATION_STOP_CALLBACK:
        {
            mmi_jmms_communication_stop_struct *sending_stop_data_p = (mmi_jmms_communication_stop_struct*) data_p;

            PRINT_INFORMATION_2(MMI_TRACE_INFO, "MMS_SENDING_STOP_CALLBACK");
            mmi_jmms_uc_handle_stop_ind(sending_stop_data_p);
        }
            break;
        default:
            PRINT_INFORMATION_2(MMI_TRACE_INFO, "default");
            break;
    }
}
Example #6
0
/**************************************************************

	FUNCTION NAME		: OslReadCircularQ

  	PURPOSE				: Reads from Circ Queue

	INPUT PARAMETERS	: nil

	OUTPUT PARAMETERS	: nil

	RETURNS				: nil

 
**************************************************************/
U8 OslReadCircularQ(void *msgPtr)
{
	PRINT_INFORMATION_2((MMI_TRACE_G1_FRM, "OslReadCircularQ: <#[%d], read:[%d], write:[%d]>", circq_messages, circq_read, circq_write));
	if(circq_messages==0)
		return 0;
	memcpy(msgPtr, circq_array + (circq_read * CIRCQ_NODE_SIZE), CIRCQ_NODE_SIZE);
	if(++circq_read == CIRCQ_NO_OF_NODES) circq_read=0;
	--circq_messages;
	return 1;
}
Example #7
0
/*****************************************************************************
 * FUNCTION
 *  mmi_syncml_progress_info_ind
 * DESCRIPTION
 *  Protocol event handler
 * PARAMETERS
 *  info        [IN]            message content
 * RETURNS
 *  void
 *****************************************************************************/
void mmi_syncml_progress_info_ind(void *info)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    mmi_syncml_progress_info_ind_struct *dataPtr = (mmi_syncml_progress_info_ind_struct*) info;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    PRINT_INFORMATION_2(MMI_TRACE_G7_MISC, "[SyncML] progression info = %d...", dataPtr->progress_info);

    /*  get numberofchanges and sending progress info*/
    switch (dataPtr->progress_info)
    {
        case PROGRESS_TASK_LOCAL_NOC:
            g_syncml_context.calendar_send_noc = dataPtr->numberofchange;
            return;
            
        case PROGRESS_CONTACT_LOCAL_NOC:
            g_syncml_context.contact_send_noc = dataPtr->numberofchange;
            return;
                     
        case PROGRESS_TASK_REMOTE_NOC:
            g_syncml_context.calendar_recv_noc = dataPtr->numberofchange;
            return;
                     
        case PROGRESS_CONTACT_REMOTE_NOC:
            g_syncml_context.contact_recv_noc = dataPtr->numberofchange;
            return;
            
        default:
            break;
            
    }

    
    mmi_syncml_update_progress_string(dataPtr->progress_info);

    /* sync report */
    if (g_syncml_context.sync_report_status)
    {
        if (dataPtr->progress_info == PROGRESS_CONTACT_DATASTORE_FAILED)
        {
            mmi_syncml_set_database_sync_fail(SYNCML_DB_PHONEBOOK);
        }

        if (dataPtr->progress_info == PROGRESS_TASK_DATASTORE_FAILED)
        {
            mmi_syncml_set_database_sync_fail(SYNCML_DB_TODOLIST);
        }
    }
}
Example #8
0
/*****************************************************************************
 * FUNCTION
 *  mmi_jmms_uc_send_mms
 * DESCRIPTION
 *  Function send MMS
 * PARAMETERS
 *  msg_handle      [IN]        
 *  msg_id          [IN]        
 * RETURNS
 *  JC_OK or JC_ERR_MMS_ENCODE_PENDING  on success
 *****************************************************************************/
JC_RETCODE mmi_jmms_uc_send_mms(MSG_HANDLE msg_handle, JC_UINT32 msg_id)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    JC_RETCODE ret_code = JC_OK;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    PRINT_INFORMATION_2(MMI_TRACE_INFO, "mmi_jmms_uc_send_mms: %d", msg_id);

    ASSERT((msg_handle != NULL) || (msg_id > 0));
    if (NULL == msg_handle || 0 == msg_id)
    {
        PRINT_INFORMATION_2(MMI_TRACE_INFO, "mmi_jmms_uc_send_mms PARAMS not OK");
        return JC_ERR_INVALID_PARAMETER;
    }
    mmi_jmms_uc_add_send_node(msg_handle, msg_id);

#ifdef __MMI_JMMS_SEND_RETRIES__
    mmi_jmms_set_progress_screen_title(STR_ID_PROGRESS_SENDING);
#endif 

    /* send request for sending */
    ret_code = mmi_jmms_send_mms(
                msg_handle,                     /* message handle */
                E_TYPE_NEW_MMS,                 /* comm_state */
                E_TRUE,                         /* bIsStream */
                1,                              /* retry */
                E_TRUE,                         /* bIsAsync */
                mmi_jmms_uc_response_callback); /* callback */

    /* if sending has failed remove send node from send list */
    if (ret_code != JC_OK && ret_code != JC_ERR_MMS_ENCODE_PENDING)
    {
        mmi_jmms_uc_remove_send_node(msg_id);
    }
    return ret_code;
}
Example #9
0
/*****************************************************************************
 * FUNCTION
 *  mmi_jmms_uc_handle_error_ind
 * DESCRIPTION
 *  Function to handle error indication from protocol layer
 * PARAMETERS
 *  error_data_p        [IN]        
 * RETURNS
 *  void
 *****************************************************************************/
void mmi_jmms_uc_handle_error_ind(mmi_jmms_uc_error_struct *error_data_p)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    JC_UINT32 msg_id = 0;
    JC_CHAR *response_text_p = NULL;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    if (error_data_p->communication_handle_p)
    {
        PRINT_INFORMATION_2(MMI_TRACE_INFO, "mmi_jmms_uc_handle_error_ind: %d",
                             error_data_p->communication_handle_p->reference_id);
    }
    else
    {
        PRINT_INFORMATION_2(MMI_TRACE_INFO, "mmi_jmms_uc_handle_error_ind: encap fail");
    }

#ifdef __MMI_JMMS_SEND_RETRIES__
    mmi_jmms_set_progress_screen_title(0);
#endif 

#ifdef __MMI_JMMS_RESPONSE_TIMEOUT__
    mmi_jmms_stop_timeout_timer();
#endif 

    msg_id = mmi_jmms_uc_get_msg_id_from_msg_handle(g_jmms_context->msg_handle);
    ASSERT(msg_id > 0);

    /* remove send node from the sending list */
    mmi_jmms_uc_remove_send_node(msg_id);

    /* call UC API to indicate sending has completed */
    mmi_jmms_uc_sending_complete(msg_id, mmi_jmms_get_error_type(error_data_p->error_code), response_text_p);
}
Example #10
0
/*****************************************************************************
 * FUNCTION
 *  mmi_jmms_uc_handle_sending_complete_rsp
 * DESCRIPTION
 *  
 * PARAMETERS
 *  sending_complete_data_p     [IN]        
 * RETURNS
 *  void
 *****************************************************************************/
void mmi_jmms_uc_handle_sending_complete_rsp(mmi_jmms_uc_sending_complete_struct *sending_complete_data_p)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    JC_UINT32 msg_id = 0;
    JC_CHAR *response_text_p = NULL;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    PRINT_INFORMATION_2(MMI_TRACE_INFO, "mmi_jmms_uc_handle_sending_complete_rsp: %d",
                         sending_complete_data_p->communication_handle_p->reference_id);

#ifdef __MMI_JMMS_SEND_RETRIES__
    mmi_jmms_set_progress_screen_title(0);
#endif 

#ifdef __MMI_JMMS_RESPONSE_TIMEOUT__
    mmi_jmms_stop_timeout_timer();
#endif 

    /* get message ID of the message whose sending was successful. */
    msg_id = mmi_jmms_uc_get_msgid(sending_complete_data_p->communication_handle_p);
    ASSERT(msg_id > 0);

#ifdef __MMI_JMMS_REQUEST_STATUS_TEXT_DISPLAY__
    if (sending_complete_data_p->response_text != NULL)
    {
        PRINT_INFORMATION_2(MMI_TRACE_INFO, "%s", "__MMI_JMMS_TEST_REQUEST_STATUS_TEXT_DISPLAY__");
        response_text_p = (JC_CHAR*) sending_complete_data_p->response_text;
    }
#endif /* __MMI_JMMS_REQUEST_STATUS_TEXT_DISPLAY__ */ 
    mmi_jmms_uc_remove_send_node(msg_id);
    /* call UC API for this to send sending complete response */
    mmi_jmms_uc_sending_complete(msg_id, mmi_jmms_get_error_type(sending_complete_data_p->error_code), response_text_p);
}
Example #11
0
/*****************************************************************************
 * FUNCTION
 *  mmi_jmms_ui_events_hdlr
 * DESCRIPTION
 *  Handles UI events
 * PARAMETERS
 *  event_data_p        [IN]        
 * RETURNS
 *  void
 *****************************************************************************/
void mmi_jmms_ui_events_hdlr(JC_EVENT_DATA *event_data_p)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    PRINT_INFORMATION_2(MMI_TRACE_INFO, "%s", "mmi_jmms_ui_events_hdlr");

    switch (event_data_p->iEventType)
    {
        case E_MMS_GET_MSG_LIST_EVENT:
        {
            PRINT_INFORMATION_2(MMI_TRACE_INFO, "%s", "JMMS Event: E_MMS_GET_MSG_LIST_EVENT");

            mmi_jmms_recieve_get_msg_list_event(event_data_p->pEventInfo);

            break;
        }
        case E_COMM_ERROR_INDICATION_EVENT:
        {

            PRINT_INFORMATION_2(MMI_TRACE_INFO, "%s", "JMMS Event: E_COMM_ERROR_INDICATION_EVENT");

            mmi_jmms_retry_for_error_in_comm(event_data_p->pEventInfo);

            break;
        }
    }
    if (NULL != event_data_p->pEventInfo)   /* remove memory leak */
    {
        jdd_QueueFree(event_data_p);
    }
}
Example #12
0
/**************************************************************

	FUNCTION NAME		: OslWriteCircularQ

  	PURPOSE				: Writes to Circ Queue

	INPUT PARAMETERS	: nil

	OUTPUT PARAMETERS	: nil

	RETURNS				: nil

 
**************************************************************/
U8 OslWriteCircularQ(void *msgPtr)
{
	PRINT_INFORMATION_2((MMI_TRACE_G1_FRM, "OslWriteCircularQ: <#[%d], read:[%d], write:[%d]>", circq_messages, circq_read, circq_write));
	if(circq_messages==CIRCQ_NO_OF_NODES)
	{
		MMI_ASSERT(0);
		return 0;
	}
	memcpy(circq_array + (circq_write * CIRCQ_NODE_SIZE), msgPtr, CIRCQ_NODE_SIZE);
	if(++circq_write == CIRCQ_NO_OF_NODES) circq_write=0;
	++circq_messages;
	if (max_circq_messages<circq_messages)
	{
		max_circq_messages = circq_messages;
	}
	return 1;
}
Example #13
0
/*****************************************************************************
 * FUNCTION
 *  mmi_syncml_get_record_req_ind
 * DESCRIPTION
 *  Protocol event handler
 * PARAMETERS
 *  info        [IN]            message content
 * RETURNS
 *  void
 *****************************************************************************/
void mmi_syncml_get_record_req_ind(void *info)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    mmi_syncml_get_record_req_ind_struct *local_data = (mmi_syncml_get_record_req_ind_struct*) info;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    if (!mmi_syncml_is_phb_sync_now() && !mmi_syncml_is_tdl_sync_now())
    {
        return;
    }

    PRINT_INFORMATION_2(MMI_TRACE_G7_MISC, "[SyncML] Get record, LUID = %d, db = %d...", local_data->luid, local_data->database_type);


    g_syncml_sync_context.operation = local_data->operation_type;
    g_syncml_sync_context.database = local_data->database_type;
    g_syncml_sync_context.luid = local_data->luid;

    /* if get deletion , only to reponse directly without geting data actually. */
    if (g_syncml_sync_context.operation == SYNCML_RECORD_GET_DEL_NOTIFY)
    {
        g_syncml_sync_context.result = SYNCML_OK;
        mmi_syncml_get_record_res_req();
        return;
    }

    if (local_data->database_type == SYNCML_DB_PHONEBOOK) /* phb */
    {
        mmi_phb_sync_vcard(MMI_PHB_VCARD_READ, (S8*) SYNCML_VOBJ_PATH, g_syncml_sync_context.luid, 0);
    }
    else if (local_data->database_type == SYNCML_DB_TODOLIST) /* tdl */
    {
        g_syncml_sync_context.result = (mmi_tdl_sync_task(MMI_TDL_SYNCML_GET, (S8*) SYNCML_VOBJ_PATH, &g_syncml_sync_context.luid, 0) == MMI_TDL_SYNCML_ERR_NO_ERROR) ? SYNCML_OK : SYNCML_FAIL;
        mmi_syncml_get_record_res_req();
    }
    else
    {

    }

    /* mmi_syncml_get_record_res_req(); */
}
Example #14
0
/*****************************************************************************
 * FUNCTION
 *  mmi_jmms_uc_handle_progress_ind
 * DESCRIPTION
 *  Function to handle progress indication
 * PARAMETERS
 *  progress_ind_data_p     [IN]        
 * RETURNS
 *  void
 *****************************************************************************/
void mmi_jmms_uc_handle_progress_ind(mmi_jmms_comm_progress_struct *progress_ind_data_p)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    COMM_PROGRESS_IND *progress_ind_p = NULL;
    JC_UINT32 percentage_of_progress = 0;
    JC_UINT32 msg_id = 0;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    PRINT_INFORMATION_2(MMI_TRACE_INFO, "mmi_jmms_uc_handle_progress_ind: %d",
                         progress_ind_data_p->communication_handle_p->reference_id);

    ASSERT(progress_ind_data_p);
    if (progress_ind_data_p->progress_ind_p != NULL)
    {
        progress_ind_p = progress_ind_data_p->progress_ind_p;
    }
    msg_id = mmi_jmms_uc_get_msgid(progress_ind_data_p->communication_handle_p);
    if (msg_id == -1)
    {
        ASSERT(0);
    }

    if (progress_ind_p)
    {
        if (progress_ind_p->eStackStatus == E_COMM_STACK_SENDING)
        {
            percentage_of_progress = (progress_ind_p->uiBytesSent) * 100;
            percentage_of_progress = percentage_of_progress / (progress_ind_p->uiTotalBytesToSend);
        }
    }

    // if progress_ind_p is NULL then we will send
    // indication to UC for retry mechanism
    if ((percentage_of_progress > 0) || (progress_ind_p == NULL))
    {
        mmi_jmms_uc_send_progress_ind(
            msg_id,
            percentage_of_progress,
            (U8) (progress_ind_data_p->communication_handle_p->retry_counter - 1));
        progress_ind_data_p->communication_handle_p->percent_sent = percentage_of_progress;
    }
}
Example #15
0
/*****************************************************************************
* FUNCTION
*	SpofRestore
* DESCRIPTION
*   Restore default value of SPOF variables and save to NVRAM
* PARAMETERS
*	None.
 * RETURNS
*	None.
* GLOBALS AFFECTED
*	External global
*****************************************************************************/
void SpofRestore(void)
{
	S32 i;
	g_spof_cntx.CurrHiliteActivation= SPOF_DISABLE;
	g_spof_cntx.CurrHiliteOnOff = SPOF_POWERON;

     PRINT_INFORMATION_2 ((MMI_TRACE_G7_MISC, "=== SpofRestore(): Cancel SPOF Aalrm. ===\n"));

	for(i=0;i<NUM_OF_SPOF;i++)	
		if(g_spof_cntx.SPOFList[i].Status == SPOF_ENABLE)
		{
			AlmCancelAlarm((U8)(ALM_SPOF_START+i));
			AlmCancelAlarm((U8)(ALM_SPON_START+i));
		}

	memset(g_spof_cntx.SPOFList,0,sizeof(g_spof_cntx.SPOFList));
	SpofWritetoNvram();
}
Example #16
0
/*****************************************************************************
 * FUNCTION
 *  mmi_jmms_uc_get_communication_handle
 * DESCRIPTION
 *  Function to get communication handle from message ID
 * PARAMETERS
 *  msg_id      [IN]        
 * RETURNS
 *  communication state node of the desired message ID
 *****************************************************************************/
mmi_jmms_communication_state_node_struct *mmi_jmms_uc_get_communication_handle(JC_UINT32 msg_id)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    mmi_jmms_sending_list_struct *send_node_list_p = NULL;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    PRINT_INFORMATION_2(MMI_TRACE_INFO, "mmi_jmms_uc_get_communication_handle:%x", msg_id);

    send_node_list_p = g_jmms_context->send_node_list;
    while (send_node_list_p)
    {
        if (send_node_list_p->msg_id == msg_id)
        {
            return send_node_list_p->communication_handle_p;
        }
        send_node_list_p = send_node_list_p->next;
    }
    return NULL;
}
Example #17
0
/*****************************************************************************
 * FUNCTION
 *  mmi_syncml_query_luid_list_res_req
 * DESCRIPTION
 *  Protocol event sender
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void mmi_syncml_query_luid_list_res_req(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    MYQUEUE Message;
    mmi_syncml_query_luid_list_res_req_struct *dataPtr;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    Message.oslSrcId = MOD_MMI;
    Message.oslDestId = MOD_SYNCML;
    Message.oslMsgId = MSG_ID_MMI_SYNCML_QUERY_LUID_LIST_RES_REQ;

    dataPtr =
        (mmi_syncml_query_luid_list_res_req_struct*) OslConstructDataPtr(sizeof(mmi_syncml_query_luid_list_res_req_struct));

    dataPtr->luid = g_syncml_sync_context.luid_buf;

    if (g_syncml_sync_context.database == SYNCML_DB_PHONEBOOK) /* phb */
    {
        if ( g_syncml_sync_context.operation == SYNCML_RECORD_ALL ||
            (g_syncml_sync_context.operation == SYNCML_RECORD_ADD && g_syncml_context.last_phb_anchor[g_syncml_context.active_profile - 1] == 0) )
        {
            /* sync all records */
            dataPtr->count = mmi_phb_get_phone_index_arrary(dataPtr->luid); /* How to fix 1000 phb entries? */
        }
        else if(g_syncml_context.last_phb_anchor[g_syncml_context.active_profile - 1] == 0)
        {
            dataPtr->count = 0;
        }
        else
        {
            dataPtr->count = mmi_syncml_query_change_log(g_syncml_sync_context.operation, g_syncml_sync_context.database, dataPtr->luid);
        }
    }

    if (g_syncml_sync_context.database == SYNCML_DB_TODOLIST) /* tdl */
    {
        if ( g_syncml_sync_context.operation == SYNCML_RECORD_ALL ||
            (g_syncml_sync_context.operation == SYNCML_RECORD_ADD && g_syncml_context.last_tdl_anchor[g_syncml_context.active_profile - 1] == 0) )
        {
            /* sync all records */
            dataPtr->count = mmi_tdl_get_total_index(dataPtr->luid);
        }
        else if(g_syncml_context.last_tdl_anchor[g_syncml_context.active_profile - 1] == 0)
        {
            dataPtr->count = 0;
        }
        else
        {
            dataPtr->count = mmi_syncml_query_change_log(g_syncml_sync_context.operation, g_syncml_sync_context.database, dataPtr->luid);
        }
    }

    dataPtr->more_data = 0;
    PRINT_INFORMATION_2(MMI_TRACE_G7_MISC, "[SyncML] Query change log, op = %d, total %d records...", g_syncml_sync_context.operation, dataPtr->count);

    Message.oslDataPtr = (oslParaType*) dataPtr;
    Message.oslPeerBuffPtr = NULL;
    OslMsgSendExtQueue(&Message);
}
Example #18
0
/*****************************************************************************
 * FUNCTION
 *  mmi_syncml_get_record_res_req
 * DESCRIPTION
 *  Protocol event sender
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void mmi_syncml_get_record_res_req(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    MYQUEUE Message;
    mmi_syncml_get_record_res_req_struct *dataPtr;

    FS_HANDLE fs_handle;
    U32 read_length, fs_size;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/

    if (g_syncml_sync_context.operation != SYNCML_RECORD_GET_DEL_NOTIFY)
    {
        if (g_syncml_sync_context.result == SYNCML_OK)
        {
            fs_handle = FS_Open(SYNCML_VOBJ_PATH, FS_READ_ONLY);
            FS_GetFileSize(fs_handle, &fs_size);
            mmi_syncml_free_vobj_buffer();
            g_syncml_sync_context.vobj_ptr = OslMalloc(fs_size);
            FS_Read(fs_handle, (void*) g_syncml_sync_context.vobj_ptr, fs_size, &read_length);
            FS_Close(fs_handle);
            FS_Delete(SYNCML_VOBJ_PATH);
         }
         else
        {
            mmi_syncml_free_vobj_buffer();
            fs_size = 0;
            g_syncml_sync_context.result = SYNCML_FAIL;
            PRINT_INFORMATION_2(MMI_TRACE_G7_MISC, "[SyncML] Get record fail");
        }
    }

    Message.oslSrcId = MOD_MMI;
    Message.oslDestId = MOD_SYNCML;
    Message.oslMsgId = MSG_ID_MMI_SYNCML_GET_RECORD_RES_REQ;

    dataPtr =
        (mmi_syncml_get_record_res_req_struct*) OslConstructDataPtr(sizeof(mmi_syncml_get_record_res_req_struct));

    dataPtr->result = g_syncml_sync_context.result;
    if (g_syncml_sync_context.operation != SYNCML_RECORD_GET_DEL_NOTIFY)
    {
        dataPtr->data_length = fs_size;
        dataPtr->data = g_syncml_sync_context.vobj_ptr;
        dataPtr->more_data = 0;
    }

    Message.oslDataPtr = (oslParaType*) dataPtr;
    Message.oslPeerBuffPtr = NULL;
    OslMsgSendExtQueue(&Message);

    /* update to show the current progress */
 
    if (g_syncml_sync_context.database == SYNCML_DB_PHONEBOOK)
    {
        g_syncml_context.contact_send_current++;
        mmi_syncml_update_progress_string(PROGRESS_CONTACT_DATASTORE_SENDING);
    }
    else if (g_syncml_sync_context.database == SYNCML_DB_TODOLIST)
    {
        g_syncml_context.calendar_send_current++;
        mmi_syncml_update_progress_string(PROGRESS_TASK_DATASTORE_SENDING);
    }
    
}
Example #19
0
/*****************************************************************************
 * FUNCTION
 *  mmi_syncml_set_record_req_ind
 * DESCRIPTION
 *  Protocol event handler
 * PARAMETERS
 *  info        [IN]            message content
 * RETURNS
 *  void
 *****************************************************************************/
void mmi_syncml_set_record_req_ind(void *info)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    mmi_syncml_set_record_req_ind_struct *local_data = (mmi_syncml_set_record_req_ind_struct*) info;

    FS_HANDLE fs_handle;
    U32 written_length;

    U16 temp_count, i, tdl_result;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    if (!mmi_syncml_is_phb_sync_now() && !mmi_syncml_is_tdl_sync_now())
    {
        return;
    }

    PRINT_INFORMATION_2(MMI_TRACE_G7_MISC, "[SyncML] Set record, LUID = %d, op = %d, db = %d...", local_data->luid, local_data->operation_type, local_data->database_type);

    g_syncml_sync_context.luid = (local_data->operation_type != SYNCML_RECORD_ADD) ? local_data->luid : 0xFFFF;
    g_syncml_sync_context.operation = local_data->operation_type;
    g_syncml_sync_context.database = local_data->database_type;
    g_syncml_sync_context.more_data = local_data->more_data;

    if (local_data->operation_type != SYNCML_RECORD_DELETE)
    {
        fs_handle = FS_Open(SYNCML_VOBJ_PATH, FS_CREATE | FS_READ_WRITE);
        FS_Seek(fs_handle, 0, FS_FILE_END);
        FS_Write(fs_handle, (void*) local_data->data, local_data->data_length, &written_length);
        FS_Close(fs_handle);
    }

    if (g_syncml_sync_context.more_data)
    {
        g_syncml_sync_context.result = SYNCML_OK;
        mmi_syncml_set_record_res_req();
        return;
    }

    if (local_data->database_type == SYNCML_DB_PHONEBOOK) /* phb */
    {
        if (local_data->operation_type == SYNCML_RECORD_MODIFY)
        {
            /* REPLACE: modify the record or add new record if LUID is not present */
            temp_count = mmi_phb_get_phone_index_arrary(temp_luid);
            for (i = 0; i < temp_count; i++)
            {
                if (temp_luid[i] == g_syncml_sync_context.luid)
                {
                    break;
                }
            }
            if (i == temp_count)
            {
                g_syncml_sync_context.operation = SYNCML_RECORD_ADD;
                g_syncml_sync_context.luid = 0xFFFF;
            }
        }

        mmi_phb_sync_vcard(g_syncml_sync_context.operation, (S8*) SYNCML_VOBJ_PATH, g_syncml_sync_context.luid, 
                local_data->charset);
    }
    else if (local_data->database_type == SYNCML_DB_TODOLIST) /* tdl */
    {
        if (local_data->operation_type == SYNCML_RECORD_MODIFY)
        {
            /* REPLACE: modify the record or add new record if LUID is not present */
            temp_count = mmi_tdl_get_total_index(temp_luid);
            for (i = 0; i < temp_count; i++)
            {
                if (temp_luid[i] == g_syncml_sync_context.luid)
                {
                    break;
                }
            }
            if (i == temp_count)
            {
                g_syncml_sync_context.operation = SYNCML_RECORD_ADD;
                g_syncml_sync_context.luid = 0xFFFF;
            }
        }

        tdl_result = mmi_tdl_sync_task(g_syncml_sync_context.operation, (S8*) SYNCML_VOBJ_PATH, &g_syncml_sync_context.luid, 
                local_data->charset);
        switch (tdl_result)
        {
            case MMI_TDL_SYNCML_ERR_NO_ERROR:
               g_syncml_sync_context.result = SYNCML_OK;
               break;

            case MMI_TDL_SYNCML_ERR_MEMORY_FULL:
               g_syncml_sync_context.result = SYNCML_DEVICE_FULL;
               break;

            default:
               g_syncml_sync_context.result = SYNCML_FAIL;
               break;
        }
        mmi_syncml_set_record_res_req();
    }
    else
    {

    }

    /* mmi_syncml_set_record_res_req(); */
}
Example #20
0
/*****************************************************************************
 * FUNCTION
 *  mmi_brw_entry_service_inbox
 * DESCRIPTION
 *  Entry function for service inbox
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void mmi_brw_entry_service_inbox(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    U8 *guiBuffer;
    U32 ret_code = 0;
    JC_UINT32 brw_total_msg_count = 0;
    JC_UINT32 brw_unread_msg_count = 0;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    if (NULL == g_mmi_brw_push_cntx.service_msg_list_p)
    {
        DisplayPopup(
            (PU8) GetString(STR_ID_BRW_PUSH_MEMORY_NOT_ENOUGH),
            IMG_GLOBAL_ERROR,
            1,
            UI_POPUP_NOTIFYDURATION_TIME,
            ERROR_TONE);
        return;
    }

    ret_code = mmi_brw_get_push_statistics(&brw_total_msg_count, &brw_unread_msg_count);
    if (ret_code != JC_OK)
    {
        PRINT_INFORMATION_2(MMI_TRACE_INFO, "%s %u", "PUSH- Inside Push Inbox", ret_code);
        ASSERT(0);
    }

    /* While reading the messsage from idle screen when user will press back.
       at that time while displying the message list local buffer should clear
       Vivek - 12082006 */
    mmi_brw_push_free_service_value_struct(&g_mmi_brw_push_cntx.current_service_message);

    g_mmi_brw_cntx.push_msg_rcvd_flag = MMI_FALSE;
    g_mmi_brw_push_cntx.push_delete_notification = MMI_FALSE;

    /* Display 'Empty' if no push messages are present */
    if ((brw_total_msg_count) == 0)
    {
        DisplayPopup(
            (PU8) GetString(STR_GLOBAL_EMPTY),
            IMG_GLOBAL_EMPTY,
            1,
            UI_POPUP_NOTIFYDURATION_TIME,
            EMPTY_LIST_TONE);

        /* Added by Vivek - 30july, 2006. If push inbox is open from the 'idle screen
           push indication'. After showing the empty pop up it should return to
           idle screen */
        if (SCR_ID_BRW_NEW_PUSH_MESSAGE_IND == GetCurrScrnId())
        {
            DeleteNHistory(1);
        }
    }
    else
    {
        EntryNewScreen(SCR_ID_BRW_SERVICE_INBOX, NULL, mmi_brw_entry_service_inbox, NULL);

        /* Added by Vivek - 11july, 2006. If push inbox is open from the 'idle screen
           push indication' */
        if (SCR_ID_BRW_NEW_PUSH_MESSAGE_IND == GetCurrScrnId())
        {
            DeleteNHistory(1);
        }

        guiBuffer = GetCurrGuiBuffer(SCR_ID_BRW_SERVICE_INBOX);

        mmi_brw_create_push_msg_list();

        ShowCategory184Screen(
            STR_ID_BRW_SERVICE_INBOX,
            GetRootTitleIcon(SERVICES_WAP_MENU_ID),
            STR_GLOBAL_OPTIONS,
            0,
            STR_GLOBAL_BACK,
            0,
            brw_total_msg_count,
            mmi_brw_service_inbox_list_get_item,
            0,
            0,
            guiBuffer);

        SetLeftSoftkeyFunction(mmi_brw_highlighted_push_msg, KEY_EVENT_UP);
        SetKeyHandler(mmi_brw_highlighted_push_msg, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);

        SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
        SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
    }
}