热门标签 | 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


推荐阅读
  • 知识图谱——机器大脑中的知识库
    本文介绍了知识图谱在机器大脑中的应用,以及搜索引擎在知识图谱方面的发展。以谷歌知识图谱为例,说明了知识图谱的智能化特点。通过搜索引擎用户可以获取更加智能化的答案,如搜索关键词"Marie Curie",会得到居里夫人的详细信息以及与之相关的历史人物。知识图谱的出现引起了搜索引擎行业的变革,不仅美国的微软必应,中国的百度、搜狗等搜索引擎公司也纷纷推出了自己的知识图谱。 ... [详细]
  • 本文介绍了lua语言中闭包的特性及其在模式匹配、日期处理、编译和模块化等方面的应用。lua中的闭包是严格遵循词法定界的第一类值,函数可以作为变量自由传递,也可以作为参数传递给其他函数。这些特性使得lua语言具有极大的灵活性,为程序开发带来了便利。 ... [详细]
  • 本文介绍了C#中生成随机数的三种方法,并分析了其中存在的问题。首先介绍了使用Random类生成随机数的默认方法,但在高并发情况下可能会出现重复的情况。接着通过循环生成了一系列随机数,进一步突显了这个问题。文章指出,随机数生成在任何编程语言中都是必备的功能,但Random类生成的随机数并不可靠。最后,提出了需要寻找其他可靠的随机数生成方法的建议。 ... [详细]
  • 本文讨论了如何优化解决hdu 1003 java题目的动态规划方法,通过分析加法规则和最大和的性质,提出了一种优化的思路。具体方法是,当从1加到n为负时,即sum(1,n)sum(n,s),可以继续加法计算。同时,还考虑了两种特殊情况:都是负数的情况和有0的情况。最后,通过使用Scanner类来获取输入数据。 ... [详细]
  • CF:3D City Model(小思维)问题解析和代码实现
    本文通过解析CF:3D City Model问题,介绍了问题的背景和要求,并给出了相应的代码实现。该问题涉及到在一个矩形的网格上建造城市的情景,每个网格单元可以作为建筑的基础,建筑由多个立方体叠加而成。文章详细讲解了问题的解决思路,并给出了相应的代码实现供读者参考。 ... [详细]
  • 本文内容为asp.net微信公众平台开发的目录汇总,包括数据库设计、多层架构框架搭建和入口实现、微信消息封装及反射赋值、关注事件、用户记录、回复文本消息、图文消息、服务搭建(接入)、自定义菜单等。同时提供了示例代码和相关的后台管理功能。内容涵盖了多个方面,适合综合运用。 ... [详细]
  • CSS3选择器的使用方法详解,提高Web开发效率和精准度
    本文详细介绍了CSS3新增的选择器方法,包括属性选择器的使用。通过CSS3选择器,可以提高Web开发的效率和精准度,使得查找元素更加方便和快捷。同时,本文还对属性选择器的各种用法进行了详细解释,并给出了相应的代码示例。通过学习本文,读者可以更好地掌握CSS3选择器的使用方法,提升自己的Web开发能力。 ... [详细]
  • 本文介绍了在SpringBoot中集成thymeleaf前端模版的配置步骤,包括在application.properties配置文件中添加thymeleaf的配置信息,引入thymeleaf的jar包,以及创建PageController并添加index方法。 ... [详细]
  • 本文讲述了作者通过点火测试男友的性格和承受能力,以考验婚姻问题。作者故意不安慰男友并再次点火,观察他的反应。这个行为是善意的玩人,旨在了解男友的性格和避免婚姻问题。 ... [详细]
  • 本文详细介绍了Linux中进程控制块PCBtask_struct结构体的结构和作用,包括进程状态、进程号、待处理信号、进程地址空间、调度标志、锁深度、基本时间片、调度策略以及内存管理信息等方面的内容。阅读本文可以更加深入地了解Linux进程管理的原理和机制。 ... [详细]
  • 1,关于死锁的理解死锁,我们可以简单的理解为是两个线程同时使用同一资源,两个线程又得不到相应的资源而造成永无相互等待的情况。 2,模拟死锁背景介绍:我们创建一个朋友 ... [详细]
  • 后台获取视图对应的字符串
    1.帮助类后台获取视图对应的字符串publicclassViewHelper{将View输出为字符串(注:不会执行对应的ac ... [详细]
  • 《数据结构》学习笔记3——串匹配算法性能评估
    本文主要讨论串匹配算法的性能评估,包括模式匹配、字符种类数量、算法复杂度等内容。通过借助C++中的头文件和库,可以实现对串的匹配操作。其中蛮力算法的复杂度为O(m*n),通过随机取出长度为m的子串作为模式P,在文本T中进行匹配,统计平均复杂度。对于成功和失败的匹配分别进行测试,分析其平均复杂度。详情请参考相关学习资源。 ... [详细]
  • 本文介绍了通过ABAP开发往外网发邮件的需求,并提供了配置和代码整理的资料。其中包括了配置SAP邮件服务器的步骤和ABAP写发送邮件代码的过程。通过RZ10配置参数和icm/server_port_1的设定,可以实现向Sap User和外部邮件发送邮件的功能。希望对需要的开发人员有帮助。摘要长度:184字。 ... [详细]
  • 动态规划算法的基本步骤及最长递增子序列问题详解
    本文详细介绍了动态规划算法的基本步骤,包括划分阶段、选择状态、决策和状态转移方程,并以最长递增子序列问题为例进行了详细解析。动态规划算法的有效性依赖于问题本身所具有的最优子结构性质和子问题重叠性质。通过将子问题的解保存在一个表中,在以后尽可能多地利用这些子问题的解,从而提高算法的效率。 ... [详细]
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社区 版权所有