热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

AndroidRILArchitecture

AndroidRILArchitectureIntroductionTheArticleexplainsaboutthebuildingblocksofAndroidtelepho
Android RIL Architecture
 
by Gomathi Sankar
 

Introduction

 

The Article explains about the building blocks of Android telephony and how it works.

 

Android telephony architecture

 
技术分享图片
Android RIL Architecture
 

Application: All the telephony related applications like Dialer, Call tracker, SMS, MMS, GPRS, Antenna signal indicator and etc, will come into this section. All these applications will be started during the android boot up. These applications will be tied up with the Android telephony framework services. The telephony framework provides APIs to access the Phone.

Framework services: Telephony framework will be initialized and started during the system start up. All the queries from the application through API will directed to the Radio interface Layer of Android by these services. The service will keep tracking of all the unsolicited commands from the modem. Unsolicited commands are the commands initiated from the modem.

Radio Interface Layer: It is the bridge between Android phone framework services and the hardware. In other words, it is the protocol stack for Telephone. The RIL consist of two primary components.

 
  1. RIL Daemon
  2. Vendor RIL
 

RIL Daemon

 

RILD will be initialized during the Android system start up. It will read the system property to find which library has to be used for Vendor RIL, provide the appropriate input for vendor RIL and finally calls RIL_Init function of Vendor RIL to map all the Vendor RIL functions to the upper layer. Each vendor RIL has RIL_Init function.

 

Vendor RIL

 

It is a library specific to each modem. In other words, we can call it as a driver to function the modem. The RIL daemon will call the RIL_Init function with the device location (eg: /dev/ttyS0). It will initiate the modem and returns theRIL_RadioFunctions structure contains the handles of radio functions

 
type structure { 

intRIL_version;

RIL_RequestFunconRequest;

RIL_RadioStateRequestonStateRequest;

RIL_Supports supports;

RIL_CancelonCancel;

RIL_GetVersiongetVersion;

} RIL_RadioFunctions;

 

RIL_version : Version of Android RIL

onRequest : Call to Vendor RIL to make a RIL_REQUEST. It must be completed with a call to RIL_onRequestComplete().It will always be called from the same thread, so returning here implies that the radio is ready to process another command (whether or not the previous command has completed)

supports   : Return current radio state.RADIO_STATE_UNAVAILABLE should be the initial state

getVersion: Version of Vendor RIL

There are two forms of communications in Android RIL

 

Solicited Commands :

 

These are commands initiated from the upper layer. Like, Dialing/Send SMS are the solicited commands from the upper layer to the RIL. OnRequestis the function for sending the solicited commands from the upper layer

The following diagram describes the solicited call in Android

 
技术分享图片
Solicited call in Android
 

Each onRequest call should end with RIL_onRequestComplete. It is to send the response for the previous onRequest and to intimate we are ready for the next command. Refer ril.h for all the solicited commands

 

Unsolicited commands

技术分享图片

These are the commands initiated from the modem to the upper layer. Like, Receive Call /Receive SMS are the commands. The Vendor RIL has to continuously monitor the device for unsolicited command from the modem.

The following diagram describes the unsolicited call in Android

 
技术分享图片
Unsolicited call in Android
 

Implementation of Vendor RIL

 

Android is providing the basic vendor RIL with minimum feature set (reference-ril). It is good to start with that reference code. Compile the Vendor RIL as a shared library with the following style

libril--.so

libril - all the Vendor ril library should start with this

 

Vendor RIL Configuration :

 

Replace the following line in the init.rc file

serviceril-daemon /system/bin/rild

with

serviceril-daemon /system/bin/rild -l /system/lib/libreference-ril.so a€” -d/dev/ttySx

Commands after "-" will be input for Vendor ril.

 

Here is sample log of Sending a SMS

 

D/SMS     ( 1962): SMS send size=0time=1319439322559

D/RILJ    ( 1962): [0312]> SEND_SMS

D/RIL     ( 1814): onRequest: SEND_SMS

D/AT      ( 1814): MUX[primary]: AT> AT+CMGS=14

D/AT      ( 1814): MUX[primary]: AT<>

D/AT      ( 1814): AT> 0001000a814978045948000002c834^Z

D/AT      ( 1814): MUX[primary]: AT

D/AT      ( 1814): MUX[primary]: AT<+CUSD: 0,”Your Last Call charge IS Rs  0.5000  AND CURRENT Balance IS  47.8770 AND EXP IS  25/09/21. Love Spl 6 Caller tunes for Jd

D/RILC    ( 1814): Unsolicited Response!!!

D/RILJ    ( 1962): [UNSL]

D/AT      ( 1814): MUX[primary]: AT<“,15

D/AT      ( 1814): MUX[primary]: AT<+CMGS: 219

D/AT      ( 1814): MUX[primary]: AT

 
 

Android RIL Architecture


推荐阅读
  • 解决Bootstrap DataTable Ajax请求重复问题
    在最近的一个项目中,我们使用了JQuery DataTable进行数据展示,虽然使用起来非常方便,但在测试过程中发现了一个问题:当查询条件改变时,有时查询结果的数据不正确。通过FireBug调试发现,点击搜索按钮时,会发送两次Ajax请求,一次是原条件的请求,一次是新条件的请求。 ... [详细]
  • Python 数据可视化实战指南
    本文详细介绍如何使用 Python 进行数据可视化,涵盖从环境搭建到具体实例的全过程。 ... [详细]
  • MySQL的查询执行流程涉及多个关键组件,包括连接器、查询缓存、分析器和优化器。在服务层,连接器负责建立与客户端的连接,查询缓存用于存储和检索常用查询结果,以提高性能。分析器则解析SQL语句,生成语法树,而优化器负责选择最优的查询执行计划。这一流程确保了MySQL能够高效地处理各种复杂的查询请求。 ... [详细]
  • 本文详细介绍了Java代码分层的基本概念和常见分层模式,特别是MVC模式。同时探讨了不同项目需求下的分层策略,帮助读者更好地理解和应用Java分层思想。 ... [详细]
  • 如果应用程序经常播放密集、急促而又短暂的音效(如游戏音效)那么使用MediaPlayer显得有些不太适合了。因为MediaPlayer存在如下缺点:1)延时时间较长,且资源占用率高 ... [详细]
  • 使用ArcGIS for Java和Flex浏览自定义ArcGIS Server 9.3地图
    本文介绍了如何在Flex应用程序中实现浏览自定义ArcGIS Server 9.3发布的地图。这是一个基本的入门示例,适用于初学者。 ... [详细]
  • 用阿里云的免费 SSL 证书让网站从 HTTP 换成 HTTPS
    HTTP协议是不加密传输数据的,也就是用户跟你的网站之间传递数据有可能在途中被截获,破解传递的真实内容,所以使用不加密的HTTP的网站是不 ... [详细]
  • [c++基础]STL
    cppfig15_10.cppincludeincludeusingnamespacestd;templatevoidprintVector(constvector&integer ... [详细]
  • 本文详细介绍了如何解决DNS服务器配置转发无法解析的问题,包括编辑主配置文件和重启域名服务的具体步骤。 ... [详细]
  • Framework7:构建跨平台移动应用的高效框架
    Framework7 是一个开源免费的框架,适用于开发混合移动应用(原生与HTML混合)或iOS&Android风格的Web应用。此外,它还可以作为原型开发工具,帮助开发者快速创建应用原型。 ... [详细]
  • 开机自启动的几种方式
    0x01快速自启动目录快速启动目录自启动方式源于Windows中的一个目录,这个目录一般叫启动或者Startup。位于该目录下的PE文件会在开机后进行自启动 ... [详细]
  • Spark中使用map或flatMap将DataSet[A]转换为DataSet[B]时Schema变为Binary的问题及解决方案
    本文探讨了在使用Spark的map或flatMap算子将一个数据集转换为另一个数据集时,遇到的Schema变为Binary的问题,并提供了详细的解决方案。 ... [详细]
  • 解决 Windows Server 2016 网络连接问题
    本文详细介绍了如何解决 Windows Server 2016 在使用无线网络 (WLAN) 和有线网络 (以太网) 时遇到的连接问题。包括添加必要的功能和安装正确的驱动程序。 ... [详细]
  • Bootstrap 支持用户自定义样式调整。即使长时间未使用 Bootstrap,也可以通过添加新的 CSS 类或覆盖现有类来轻松修改默认样式,以满足特定的设计需求。 ... [详细]
  • CentOS 7 中 iptables 过滤表实例与 NAT 表应用详解
    在 CentOS 7 系统中,iptables 的过滤表和 NAT 表具有重要的应用价值。本文通过具体实例详细介绍了如何配置 iptables 的过滤表,包括编写脚本文件 `/usr/local/sbin/iptables.sh`,并使用 `iptables -F` 清空现有规则。此外,还深入探讨了 NAT 表的配置方法,帮助读者更好地理解和应用这些网络防火墙技术。 ... [详细]
author-avatar
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有