⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mmisatclasse.c

📁 是一个手机功能的模拟程序
💻 C
📖 第 1 页 / 共 2 页
字号:
}

/*******************************************************************************

 $Function:    	sat_class_e_exec

 $Description:	      Dialog function for Sat Class E window.

 $Returns:		none

 $Arguments:	      win - current window
 				event - window event
 				value - unique id
 				call_setup_parameter - call setup info

 SPR#2321 - DS - Corrected misleading comments.
 
*******************************************************************************/
void sat_class_e_exec (T_MFW_HND win, USHORT event, SHORT value,  T_SAT_CMD * sat_command)
{
    
    T_MFW_WIN       * win_data;  
    T_sat_open_channel * data;
    char* text_string;
    
    T_DISPLAY_DATA    display_info;
    
    TRACE_FUNCTION ("sat_class_e_exec()");

    if (win == NULL) 
    {
       TRACE_ERROR("ERROR: win is NULL!");
       return;
    }

    win_data = ((T_MFW_HDR *)win)->data;

    if (win_data == NULL)
    {
        TRACE_ERROR("ERROR: win_data is NULL!");
        return;
    }

    data = (T_sat_open_channel *)win_data->user;

    if (data == NULL)
    {
        TRACE_ERROR("ERROR: data is NULL!");
        return;
    }
    
    switch (event)
    {
        case SAT_OPEN_CHANNEL:

            TRACE_EVENT("SAT_OPEN_CHANNEL");
                
            /* Start an info screen to accept or reject the Open Channel request */
            data->sat_command = sat_command;	

            /* Extract the data from the Open Channel sat command */
            if (sat_command != NULL)
            {

		  TRACE_EVENT_P2("dcs: %x, len: %d", sat_command->c.open.alpha_id.code, sat_command->c.open.alpha_id.len);
		  
                /* Alpha identifier */

                /* Check alpha identifier has valid length */
                if ( (sat_command->c.open.alpha_id.len > 0) &&
                     (sat_command->c.open.alpha_id.len != (U8)-1) )
                {
                    /* Extract alpha_id data and create string */
                    data->alpha_id = sat_create_TEXT_ASCIIZ(&sat_command->c.open.alpha_id);
                }
                else
                {
                    data->alpha_id = NULL;
                }
            }
	     else
	     {
	     	     TRACE_ERROR("ERROR: NULL sat_command!");
	     }

            if (data->alpha_id)
            {
                text_string = data->alpha_id;
#ifdef NO_ASCIIZ/*MC SPR 940/2 Add tag to Unicode strings so info dialog displays them correctly*/
		   sat_add_unicode_tag_if_needed(text_string);
#endif               
            }
            else
            {
                text_string = "Open Channel"; //Need to implement for Chinese
            }
                    
            
            //dlg_initDisplayData_TextStr( &display_info, TxtAccept, TxtReject, text_string, NULL, COLOUR_STATUS);
            //dlg_initDisplayData_events( &display_info, (T_VOID_FUNC)sat_open_channel_cb, FOREVER, KEY_LEFT|KEY_RIGHT );
	
	    dialog_info_init(&display_info);
	    display_info.LeftSoftKey	= TxtAccept;
	    display_info.RightSoftKey	= TxtReject;
	    display_info.TextString 	= text_string;
	    display_info.TextString2 	= NULL;
	    display_info.Callback 	= (T_VOID_FUNC)sat_open_channel_cb;
	    
	    display_info.Time		= FOREVER;
	    display_info.KeyEvents	= KEY_LEFT|KEY_RIGHT;
	    
	
            display_info.Identifier   = event;
            
            
            /*
            * Call Info Screen
            */
            info_dialog (win, &display_info);
                
            break;
        
        case SAT_CLOSE_CHANNEL:

            TRACE_EVENT("SAT_CLOSE_CHANNEL");
                
            /* Start an info screen to inform the user that the SIM is closing the open channel*/
            data->sat_command = sat_command;

            /* Extract the data from the Close Channel sat command */
            if (sat_command != NULL)
            {
                TRACE_EVENT_P2("dcs: %x, len: %d", sat_command->c.close.alpha_id.code, sat_command->c.close.alpha_id.len);
		  
                /* Alpha identifier */

                /* SPR#2321 - DS - Check alpha identifier has valid length */
                if ( (sat_command->c.close.alpha_id.len > 0) &&
                     (sat_command->c.close.alpha_id.len != (U8)-1) )
                {
                    /* Extract alpha_id data and create string */
                    data->alpha_id = sat_create_TEXT_ASCIIZ(&sat_command->c.close.alpha_id);
                }
                else
                {
                    data->alpha_id = NULL;
                }
            }

            if (data->alpha_id)
            {
                text_string = data->alpha_id;
#ifdef NO_ASCIIZ/*MC SPR 940/2 Add tag to Unicode strings so info dialog displays them correctly*/
		   sat_add_unicode_tag_if_needed(text_string);
#endif               
            }
            else
            {
                text_string = "Closing Channel"; //Need to implement for Chinese
            }
                    
            
            //dlg_initDisplayData_TextStr( &display_info, TxtNull, TxtNull, text_string, NULL, COLOUR_STATUS);
            //dlg_initDisplayData_events( &display_info, (T_VOID_FUNC)sat_class_e_cb, THREE_SECS, KEY_LEFT|KEY_RIGHT );

	    dialog_info_init(&display_info);
	    display_info.LeftSoftKey	= TxtNull;
	    display_info.RightSoftKey	= TxtNull;
	    display_info.TextString 	= text_string;
	    display_info.TextString2 	= NULL;
	    
	    display_info.Callback 	= (T_VOID_FUNC)sat_class_e_cb;
	    
	    display_info.Time		= THREE_SECS;
	    display_info.KeyEvents	= KEY_LEFT|KEY_RIGHT;

            display_info.Identifier   = event;
            
            /*
            * Call Info Screen
            */
            info_dialog (win, &display_info);
                
            break;

        case SAT_SEND_DATA:

	     TRACE_EVENT("SAT_SEND_DATA");
                
            /* Start an info screen to inform the user that the SIM is sending data */
            data->sat_command = sat_command;

            /* Extract the data from the Send Data sat command */
            if (sat_command != NULL)
            {
                TRACE_EVENT_P2("dcs: %x, len: %d", sat_command->c.send.alpha_id.code, sat_command->c.send.alpha_id.len);
		  
                /* Alpha identifier */

                /* SPR#2321 - DS - Check alpha identifier has valid length */
                if ( (sat_command->c.send.alpha_id.len > 0) &&
                     (sat_command->c.send.alpha_id.len != (U8)-1) )
                {
                    /* Extract alpha_id data and create string */
                    data->alpha_id = sat_create_TEXT_ASCIIZ(&sat_command->c.send.alpha_id);
                }
                else
                {
                    data->alpha_id = NULL;
                }
            }

            if (data->alpha_id)
            {
                text_string = data->alpha_id;
#ifdef NO_ASCIIZ/*MC SPR 940/2 Add tag to Unicode strings so info dialog displays them correctly*/
		   sat_add_unicode_tag_if_needed(text_string);
#endif               
            }
            else
            {
                text_string = "Sending Data"; //Need to implement for Chinese
            }                   
            
            //dlg_initDisplayData_TextStr( &display_info, TxtNull, TxtNull, text_string, NULL, COLOUR_STATUS);
            //dlg_initDisplayData_events( &display_info, (T_VOID_FUNC)sat_class_e_cb, THREE_SECS, KEY_LEFT|KEY_RIGHT );
            
	    dialog_info_init(&display_info);
	    display_info.LeftSoftKey	= TxtNull;
	    display_info.RightSoftKey	= TxtNull;
	    display_info.TextString 	= text_string;
	    display_info.TextString2 	= NULL;
	    display_info.Callback 	= (T_VOID_FUNC)sat_class_e_cb;
	    
	    display_info.Time		= THREE_SECS;
	    display_info.KeyEvents	= KEY_LEFT|KEY_RIGHT;
            

            display_info.Identifier   = event;
            
            /*
            * Call Info Screen
            */
            info_dialog (win, &display_info);
                
            break;

        case SAT_RECEIVE_DATA:

	     TRACE_EVENT("SAT_RECEIVE_DATA");

            /* Start an info screen to inform the user that the SIM is receiving data */
            data->sat_command = sat_command;

            /* Extract the data from the Receive Data sat command */
            if (sat_command != NULL)
            {
                TRACE_EVENT_P2("dcs: %x, len: %d", sat_command->c.receive.alpha_id.code, sat_command->c.receive.alpha_id.len);
		  
                /* Alpha identifier */

                /* SPR#2321 - DS - Check alpha identifier has valid length */
                if ( (sat_command->c.receive.alpha_id.len > 0) &&
                     (sat_command->c.receive.alpha_id.len != (U8)-1) )
                {
                    /* Extract alpha_id data and create string */
                    data->alpha_id = sat_create_TEXT_ASCIIZ(&sat_command->c.receive.alpha_id);
                }
                else
                {
                    data->alpha_id = NULL;
                }
            }

            if (data->alpha_id)
            {
                text_string = data->alpha_id;
#ifdef NO_ASCIIZ/*MC SPR 940/2 Add tag to Unicode strings so info dialog displays them correctly*/
		   sat_add_unicode_tag_if_needed(text_string);
#endif               
            }
            else
            {
                text_string = "Receiving Data"; //Need to implement for Chinese
            }                   
            
            //dlg_initDisplayData_TextStr( &display_info, TxtNull, TxtNull, text_string, NULL, COLOUR_STATUS);
            //dlg_initDisplayData_events( &display_info, (T_VOID_FUNC)sat_class_e_cb, THREE_SECS, KEY_LEFT|KEY_RIGHT );

	    dialog_info_init(&display_info);
	    display_info.LeftSoftKey	= TxtNull;
	    display_info.RightSoftKey	= TxtNull;
	    display_info.TextString 	= text_string;
	    display_info.TextString2 	= NULL;
	    
	    display_info.Callback 	= (T_VOID_FUNC)sat_class_e_cb;
	    
	    display_info.Time		= THREE_SECS;
	    display_info.KeyEvents	= KEY_LEFT|KEY_RIGHT;


            display_info.Identifier   = event;
            
            /*
            * Call Info Screen
            */
            info_dialog (win, &display_info);
                
            break;

        default:
            TRACE_EVENT("sat_open_channel_exec() unexpected event");
            return;
    }

}

/* EOF - End Of File */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -