千家论坛_弱电智能化技术与工程讨论(建筑智能,家居智能,人工智能)

培训与展会
收藏本版 (9) |订阅

培训与展会 今日: 2658 |主题: 2386|排名: 8 

发新帖
打印 上一主题 下一主题

MTK短信开发详解(三)...

[复制链接]
shuhaipeixun 发布于: 2010-10-26 10:24 1016 次浏览 0 位用户参与讨论
跳转到指定楼层

MTK短信开发详解(三)
2.3.6、短信发送请求
   void mmi_frm_sms_send_sms_req(void)                                    
   {                                                                      
       [...]                                                              
                                                                          
       /* check SC: get SC address, inMsg keeps the flag */               
       if ((sendSMS->sendcheck & MMI_FRM_SMS_SC) != MMI_FRM_SMS_SC)       
       {                                                                  
           [... 首次进入 ...]                                             
           return;                                                        
       }                                                                  
                                                                          
       /* check DA: show input screen, inMsg keeps the number */          
       if ((sendSMS->sendcheck & MMI_FRM_SMS_DA) != MMI_FRM_SMS_DA)       
       {                                                                  
           [...二次进入, 弹出号码输入框...]                               
           else if ((strlen((S8*) sendSMS->number) == 0) && ((sendSMS->sendrequire & MMI_FRM_SMS_REPLY) == 0))
           {                                                              
               if (GetCurrScrnId() != SCR_ID_MSG_NUMBER)                  
               {                                                          
                   mmi_frm_sms_entry_number();                            
               }                                                          
               return;                                                    
           }                                                              
           sendSMS->sendcheck = MMI_FRM_SMS_DA;                          
       }                                                                  
                                                                          
       /* check validity of DA */                                         
           [...]                                                          
                                                                          
       /* check FDL: when FDN on */                                       
       {                                                                  
           [...号码输入完毕, 按[确认]到此...]                             
                                                                          
           [...短信内容编码...]                                           
           result = mmi_frm_sms_pack_sms();                               
                                                                          
               [...绘制发送短信发送界面...]                               
               mmi_frm_sms_entry_send();                                  
                                                                          
               [...设置短信发送回调...]                                   
               SetProtocolEventHandler(mmi_frm_sms_send_sms_rsp, PRT_MSG_ID_MMI_SMS_SEND_MSG_RSP);
               SetProtocolEventHandler(mmi_frm_sms_abort_sms_ind, PRT_MSG_ID_MMI_SMS_SEND_ABORT_START_IND);
                                                                          
               [...(如果是长短信,循环)发送...]                            
                   for (i = 0; i < j; i++)                                
                   {                                                      
                       mmi_frm_sms_send_sms_seg();                        
                   }                                                      
           [...]                                                          
       }                                                                  
   }                                                                      


   void mmi_frm_sms_send_sms_seg(void)                                    
   {                                                                      
       MMI_FRM_SMS_SEND_MSG_REQ_STRUCT *sendSms;                          
       [...]                                                              
       mmi_frm_sms_send_message(MOD_MMI, MOD_L4C, 0, PRT_MSG_ID_MMI_SMS_SEND_MSG_REQ, (oslParaType*) sendSms, NULL);
       [...]                                                              
   }   


2.3.7、短信发送回调
无论发送是否成功(或者[取消]),  最后返回并高亮[写短信]菜单项:HighlightWMessageHandler()。
   [SMSMsg.c]                                                             
   void mmi_frm_sms_send_sms_rsp(void *inMsg)                             
   {                                                                      
           [...]                                                          
           mmi_frm_sms_callback_action((void*)number, sendResult);        
           [...]                                                          
   }


   [SmsPsHandler.c]                                                       
   void mmi_msg_send_msg_rsp(void *number, module_type mod, U16 result)   
   {                                                                      
       switch (result)                                                    
       {                                                                  
           case MMI_FRM_SMS_OK:                                           
                                                                          
               [... 设置跳转节点 ...]                                     
               else if (IsScreenPresent(SCR_ID_MSG_WRITE))                
               {                                                          
                   SetMessagesScrnIdToDelHistoryNodes(SCR_ID_MSG_WRITE);  
               }                                                          
                                                                          
               [... 删除历史屏幕, 返回[写短信]...]                        
               if (g_msg_cntx.msg_send_info.CurrSendSmsNumbers == g_msg_cntx.msg_send_info.TotalSendSmsNumbers)
               {                                                          
                   DeleteMessagesHistoryNodes();                          
                   mmi_frm_sms_delete_screen_history();                   
               }                                                          
               [...]                                                      
       }                                                                  
   } 

完整版本请见 http://www.51qianru.cn/bbs/
                                                        曙海教育

                                                曙海嵌入式学院3G通信培训中心

                                            (MTK培训,Android培训,iPhone培训)

                                                电话:021-51875830

                                                网址:http://www.51qianru.cn

                                                    讲师:李现路

                                              版权所有-曙海教育 转发请注明出处

 

回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册 新浪微博登陆 千家通行证登陆

本版积分规则

千家智客微信号
千家智客微信
玩物说商城
玩物说商城