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-<companyname>-<RIL version>.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 — -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< Q: 31,0

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]< UNSOL_ON_USSD 0

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

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

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

 
 

Android RIL Architecture的更多相关文章

  1. Android RIL的java框架

    Android RIL的Java部分也被分为了两个模块,RIL模块与Phone模块.其中RIL模块负责进行请求以及相应的处理,它将直接与RIL的原声代码进行通信.而Phone模块则向应用程序开发者提供 ...

  2. Android RIL结构分析与移植

    介绍 本文档对Android RIL部分的内容进行了介绍,其重点放在了Android RIL的原生代码部分. 包括四个主题: 1.Android RIL框架介绍 2.Android RIL与 Wind ...

  3. Android RIL概述

    前言 Android作为一个通用的移动平台,其首要的功能就是通话.短信以及上网等通信功能.那么,从系统的角度来看,Android究竟是怎么实现与网络的交互的了? 这篇文章里,就来看一看Android中 ...

  4. Android RIL Log

    转载: 要调试 RIL,最好的方法就是打开 radio的log: $ adb logcat -b radio 最好加上 log语法亮度工具coloredlogcat.py ,一些常见的LOG TAG要 ...

  5. Android App Architecture使用详解

    Android应用架构简介 对于经过过构建app的Android开发人员来说, 现在是时候了解一下构建鲁棒, 质量高的应用的最佳实践和推荐架构了. 这篇文章假设读者对Android framework ...

  6. 【Android】Architecture Components最佳实践--Lifecycles

    UI controllers (activities and fragments) 中代码越少越好,不应该自己去请求数据,而是用ViewModel来更新数据,并且监听LiveData来更新UI UI ...

  7. Android 5.1.1 源码目录结构

    点击打开链接 最近公司培训新同事,我负责整理一点关于android的基础知识,遥想当年,刚接触android,也是一头雾水, 啥都不懂,就是靠看文档和视频,对android有一个初步了解,然后就通过查 ...

  8. (转)Android 5.1.1 源码目录结构

    转自:http://blog.csdn.net/tfslovexizi/article/details/51888458最近公司培训新同事,我负责整理一点关于android的基础知识,遥想当年,刚接触 ...

  9. 【腾讯Bugly干货分享】一步一步实现Android的MVP框架

    本文来自于腾讯bugly开发者社区,非经作者同意,请勿转载,原文地址:http://dev.qq.com/topic/5799d7844bef22a823b3ad44 内容大纲: Android 开发 ...

随机推荐

  1. Emacs矩形操作

    原始矩形块模式 emacs以C-x r开头的命令来进行矩形操作.先用C-space或者C-@设一个mark,移动光标到另一点,用以下命令进行列操作: C-x r r 复制一个矩形区域到寄存器 C-x ...

  2. Python int操作

    a = 1 # 1 print(a.bit_length()) #计算一个数字的二进制长度.没啥用

  3. nodejs tutorials

    设置npm的镜像为淘宝镜像 npm config list npm config set registry " https://registry.npm.taobao.org "

  4. 小程序引入多个e-charts

    小程序引入e-charts图表 这里是狗尾草第一次发表掘金文章,日后望各位大佬多多支持~ 前言:运营助手,见名知意,没有图表数据的展示,看上去是有多空白.因此,俺们UI做了很好的交互,一个页面来了4个 ...

  5. qwb的骚扰

    题目描述 自从学姐拒绝了qwb之后,qwb开始了疯狂的骚扰.qwb来到了一个公共电话亭,他摸摸口袋只有n元钱. 已知该公用电话的规则是,前3分钟一共收费x元(不到3分钟也要收x元),超过3分钟每分钟收 ...

  6. Descriptor&web.xml

    Deployment Descriptor部署描述符: - 部署描述符是要部署到Web容器或EJB容器的Web应用程序或EJB应用程序的配置文件. - 部署描述符应包含EJB应用程序中所有企业bean ...

  7. day9 python学习 文件的操作 读 写 seek

    文件的操作 1   文件的打开操作: 文件句柄 = open('文件路径', '模式') f=open('wangyakun','a+',encoding='utf-8') #文件名, 如果是绝对路径 ...

  8. C#编程之IList<T>、List<T>、ArrayList、IList, ICollection、IEnumerable、IEnumerator、IQueryable 和 IEnumerable的区别

    额...今天看了半天Ilist<T>和List<T>的区别,然后惊奇的发现使用IList<T>还是List<T>对我的项目来说没有区别...  在C#中 ...

  9. CentOS 7防火墙开放端口快速方法

    这篇文章主要为大家详细介绍了Centos7.1防火墙开放端口的快速方法,具有一定的参考价值,感兴趣的小伙伴们可以参考一下   例如安装Nagios后,要开放5666端口与服务器连接,命令如下: [ro ...

  10. svn 报错及解决

    报错: svn: E155015: One or more conflicts were produced while merging r68508:73308 into '[分支]' -- reso ...