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
讲师:李现路
版权所有-曙海教育 转发请注明出处
|