cdma短信Qcril分析

1、发送短信

RIL.java发送RIL_REQUEST_CDMA_SEND_SMS 请求后,qcril.c进入onRequest进行处理。

[00063/02]MSG    02:35:24.035Android QCRIL/High                       qcril.c  05445  RIL[1][main] onRequest: UI --- RIL_REQUEST_CDMA_SEND_SMS (87) ---> RIL [RID 1, token id 11424, data len 372]

在onRequest中,先检查该request是否支持。qcril_request_check_if_suppressed判断该request是否在qcril_request_suppress_list列表中。

[00063/00]MSG    02:35:24.035Android QCRIL/Low                        qcril.c  11222  RIL[1][main] qcril_request_check_if_suppressed: function exit with ret 0

下面会先后判断是否RIL_REQUEST_DIAL或RIL_REQUEST_SETUP_DATA_CALL、RIL_REQUEST_RADIO_POWER或RIL_REQUEST_SCREEN_STATE、RIL_REQUEST_SET_MUTE。(这里暂时不分析这几个request,先略过)。如果不是这几个request,则QCRIL_LOG_CF_PKT_RIL_REQ(这个是干什么的,与QCRIL_LOG_DEBUG有什么区别)

 

[00063/02]MSG    02:35:24.035Android QCRIL/High                       qcril.c  05508  RIL[1][main] onRequest: data stream received from telephony

qcril_qmi_print_hex打印qmi日志。

接下来会针对RIL_REQUEST_OEM_HOOK_RAW进行处理(这里略过)。

接下来开始处理request,先调用qmi_ril_fw_android_request_flow_control_info_lock来设置锁。

[00063/02]MSG    02:35:24.036Android QCRIL/High                       qcril.c  05550  RIL[1][main] onRequest: android request id 87

[00063/02]MSG    02:35:24.036Android QCRIL/High                       qcril.c  05557  RIL[1][main] onRequest: handling caps 51200060 hex

 

调用qmi_ril_fw_create_android_live_params_copy函数存储参数到android_request_param_copy中。

  QCRIL_LOG_FUNC_ENTRY();//打印函数进入的日志:

[00063/00]MSG    02:35:24.036Android QCRIL/Low                        qcril.c  09503  RIL[1][main] qmi_ril_fw_create_android_live_params_copy: function entry

[00063/02]MSG    02:35:24.036Android QCRIL/High                       qcril.c  09504  RIL[1][main] qmi_ril_fw_create_android_live_params_copy: a-r-id 87, a-data 0xabf7afd0, a-data-len 372

[00063/01]MSG    02:35:24.036Android QCRIL/Medium                     qcril.c  10447  RIL[1][main] qmi_ril_fw_create_android_live_params_copy: .. params for Android request id 87 are of complex structure and cloned to 0xab60d900 length 372

  QCRIL_LOG_FUNC_RETURN_WITH_RET( (int)res );//打印函数退出日志

[00063/00]MSG    02:35:24.036Android QCRIL/Low                        qcril.c  10460  RIL[1][main] qmi_ril_fw_create_android_live_params_copy: function exit with ret 2

 

QCRIL_LOG_DEBUG( "method %d, datalen %d", (int)request_param_method, datalen );

[00063/02]MSG    02:35:24.037Android QCRIL/High                       qcril.c  05576  RIL[1][main] onRequest: method 2, datalen 372

 

调用qmi_ril_fw_android_request_flow_control_find_busy_kind(?这个函数)

[00063/00]MSG    02:35:24.037Android QCRIL/Low                        qcril.c  08760  RIL[1][main] qmi_ril_fw_android_request_flow_control_find_busy_kind: function entry

[00063/00]MSG    02:35:24.037Android QCRIL/Low                        qcril.c  08797  RIL[1][main] qmi_ril_fw_android_request_flow_control_find_busy_kind: function exit with ret 0

 

[00063/02]MSG    02:35:24.037Android QCRIL/High                       qcril.c  05665  RIL[1][main] onRequest: clean family 0

 

//qmi_ril_fw_android_request_flow_control_find_request_for_execution

[00063/00]MSG    02:35:24.037Android QCRIL/Low                        qcril.c  08858  RIL[1][main] qmi_ril_fw_android_request_flow_control_find_request_for_execution: function entry

[00063/00]MSG    02:35:24.037Android QCRIL/Low                        qcril.c  08838  RIL[1][main] qmi_ril_fw_android_request_flow_control_find_outstanding_request_within_kind: function exit with ret 0

[00063/00]MSG    02:35:24.037Android QCRIL/Low                        qcril.c  08945  RIL[1][main] qmi_ril_fw_android_request_flow_control_find_request_for_execution: function exit with ret 0

[00063/02]MSG    02:35:24.038Android QCRIL/High                       qcril.c  05678  RIL[1][main] onRequest: already waiting for exec 0

 

[00063/02]MSG    02:35:24.038Android QCRIL/High                       qcril.c  05713  RIL[1][main] onRequest: android_request_param_holder af665400 hex

[00063/00]MSG    02:35:24.038Android QCRIL/Low                        qcril.c  09313  RIL[1][main] qmi_ril_fw_android_request_flow_control_overview_request_review_holders: function entry

[00063/00]MSG    02:35:24.038Android QCRIL/Low                        qcril.c  09358  RIL[1][main] qmi_ril_fw_android_request_flow_control_overview_request_review_holders: function exit

 

[00063/02]MSG    02:35:24.038Android QCRIL/High                       qcril.c  05725  RIL[1][main] onRequest: pending req kind 0x0 hex, awaitingexec req kind 0x0 hex

[00063/02]MSG    02:35:24.038Android QCRIL/High                       qcril.c  05753  RIL[1][main] onRequest: token under exec 11424

 

//调用qmi_ril_fw_android_request_flow_control_info_unlock()解锁

 

[00063/02]MSG    02:35:24.038Android QCRIL/High                       qcril.c  05762  RIL[1][main] onRequest: pre-exec token id 11424, a-r-id 87, audit 0, nrender 0

 

//调用qmi_ril_fw_android_request_render_execution

[00063/00]MSG    02:35:24.040Android QCRIL/Low                        qcril.c  08392  RIL[1][main] qmi_ril_fw_android_request_render_execution: function entry

[00063/02]MSG    02:35:24.040Android QCRIL/High                       qcril.c  08404  RIL[1][main] qmi_ril_fw_android_request_render_execution: rendering exec for token id 11424

    //调用qcril_execute_event

[00063/00]MSG    02:35:24.040Android QCRIL/Low                        qcril.c  06116  RIL[1][main] qcril_execute_event: function entry

      //do dispatch internally

      QCRIL_LOG_INFO("Dispatching event/android request..");

      error = qcril_dispatch_event( entry_ptr, params_ptr );

[00063/01]MSG    02:35:24.040Android QCRIL/Medium                     qcril.c  06233  RIL[1][main] qcril_execute_event: Dispatching event/android request..

 

进入qcril_qmi_sms.c的qcril_sms_request_cdma_send_sms方法

[00063/00]MSG    02:35:24.040Android QCRIL/Low                qcril_qmi_sms.c  03085  RIL[1][main] qcril_sms_request_cdma_send_sms: function entry

qcril_sms_request_cdma_send_sms的处理:

第一步:获取LTE_SMS状态和voLTE状态(分别通过方法qcril_qmi_nas_fetch_lte_sms_status和qcril_qmi_nas_is_voice_over_lte_registered,这两个方法都是根据nas_cached_info值来判断,qcril_qmi_nas.c文件中)

    qcril_qmi_nas_fetch_lte_sms_status( &lte_sms_status_valid, &lte_sms_status);

    is_voice_over_lte = qcril_qmi_nas_is_voice_over_lte_registered();

[00063/00]MSG    02:35:24.040Android QCRIL/Low                qcril_qmi_nas.c  43095  RIL[1][main] qcril_qmi_nas_is_voice_over_lte_registered: function exit with ret 0 //voLTE未注册

第二步:检查3gpp2 的wms service服务是否没有OK(下面日志显示已经OK),并且voLTE也没有注册,    此时返回失败

if (!wms_ready_atleast_limited_3gpp2() &&

        !(is_voice_over_lte && lte_sms_status_valid && (NAS_SMS_STATUS_1X_V01 == lte_sms_status))

       )

[00063/00]MSG    02:35:24.040Android QCRIL/Low                qcril_qmi_sms.c  08301  RIL[1][main] wms_ready_atleast_limited_3gpp2: function entry

[00063/02]MSG    02:35:24.040Android QCRIL/High               qcril_qmi_sms.c  08318  RIL[1][main] wms_ready_atleast_limited_3gpp2: WMS service is ready for atleast limited/full 3GPP2, WMS_SERVICE_READY_STATUS_3GPP_AND_3GPP2

[00063/00]MSG    02:35:24.040Android QCRIL/Low                qcril_qmi_sms.c  08327  RIL[1][main] wms_ready_atleast_limited_3gpp2: function exit with ret 1

第三步:检查SMS数据是否为NULL,是则返回failure。

第四步:在IMS

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
CDMA短信是通过CDMA网络传输的短信。CDMA短信的格式与GSM的短信格式有所不同。CDMA短信使用PDU格式进行传输。PDU格式是一种将短信数据以二进制形式进行编码和传输的格式。CDMA短信的PDU格式与GSM的PDU格式相差很多,不能直接用肉眼看出来。\[3\] 为了实现长短信的拆分和组合功能,CDMA终端需要支持IS637C协议中关于长短消息处理的参数。其中,HEADER_IND参数用于指示User Data Header是否包含消息头。若包含消息头,则HEADER_IND设置为'1',否则设置为'0'。具体的拆分和组合过程可以参考IS637C或《中国电信CDMA终端需求规范-SMS分册-V1.0》。需要注意的是,一些CDMA模组厂家为了方便用户,会自动处理用户数据头,例如自动加上(1/2)、(2/2)等。如果想要手动解析短信,建议与模组厂家进行沟通确认。\[2\] 总结起来,CDMA短信是通过CDMA网络传输的短信,使用PDU格式进行编码和传输。为了实现长短信的拆分和组合功能,CDMA终端需要支持相应的参数和协议。\[1\]\[2\]\[3\] #### 引用[.reference_title] - *1* [短信猫发送GSM 和 CDMA PDU长短信](https://blog.csdn.net/zhaoxj_2017/article/details/94450749)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control,239^v3^insert_chatgpt"}} ] [.reference_item] - *2* *3* [CDMA SMS pdu解码](https://blog.csdn.net/zx249388847/article/details/52607862)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值