Describes the features of Android phones in detail.

Source: Internet
Author: User

Android is an efficient. NET programming language. It combines the function language and the object-oriented programming language, and is perfect for programming, algorithms, technology, and exploratory development. Therefore, it can be interesting and attractive in the Process of use.

All depend on the ril. h header file in the include directory. Currently, the cupcake branch is equipped with gsm support and the cdma branch. The gsm driver is analyzed here. The GSM module, due to the history of the Modem, the AP has been interacting with BB through the AT command based on the serial port. Some existing edge or 3G modules, or ap and bp integrated chips such as omap, have already used USB or other high-speed bus communications.

However, most of them still use the simulated serial port mechanism to use the AT command. Here, the RIL (Radio Interface Layer) Layer is mainly based on AT commands, such as sending commands and response Parsing. MUX protocols used for transmission such as gprs are not included here and will not be introduced for the moment .)

The following is a detailed analysis. Due to the length, it will be published in the form of serialization (about 3 articles). This article mainly covers the basic architecture and initialization content. First, we will introduce rild and libril. relationship Between so and librefrence_ril.so:

1. rild:
Implements only one main function as the entry point of the entire ril layer and completes initialization.

2. libril. so:
It is closely integrated with rild and is its shared library. This relationship has been established during compilation. The components are ril. cpp and ril_event.cpp. Libril. so resides in the rild daemon. It mainly completes the communication at the same layer, receives and passes ril requests.

3. librefrence_ril.so:
Rild is loaded in the manual dlopen mode, and the combination is slightly loose. This is also because librefrence. so is mainly responsible for communicating with Modem Hardware. This makes it easier to replace or modify to adapt to more Modem types.

It converts the request from libril. so to the AT command, monitors the Modem feedback, and passes it back to libril. so. During initialization, rild obtains a set of function pointers through the symbol RIL_Init and establishes a connection with them.

4. radiooptions:
Radiooptiongs obtains the startup parameters and uses socket to communicate with rild, so that Modem parameters can be configured during debugging.

Next, analyze the initialization process. The main entry is the main function in rild. c, which mainly completes three tasks:
1. Enable the event mechanism in Android. In RIL_startEventLoop, it is the core message loop driven by multiple I/O channels.

2. initialize librefrence_ril.so, that is, the part that communicates with the hardware or the analog hardware modem is called the hardware), which is completed through the RIL_Init function.

3. Use RIL_Init to obtain a set of function pointers RIL_RadioFunctions, register RIL_register, and open the socket channel that accepts upper-layer commands.

Each ril_event structure can be a file, socket, or pipeline bound to an fd handle) and carries a func pointer to perform the specified operation. The specific process is: after ril_event_init is complete, use ril_event_set to configure a new ril_event and add it to the queue through ril_event_add. rilEventAddWakeup is usually used to add it ).

Add puts all ril_event fd in the queue into a fd set readFds. In this way, ril_event_loop can use a multiplexing I/O mechanism to select) to wait for these fd. If any fd has data to write, it will enter the analysis process processTimeouts (), processreadies (& rfds, n), firePending ().

Later, we will analyze these processes in detail. In addition, we can see that a s_wakeupfd_event has been attached to ril_event_loop, which is implemented through the pipe mechanism, the purpose of this event is to internally wake up the multiplexing blocking of ril_event_loop.

For example, some commands with timeout expire. Now that the analysis of the first task is complete, a message loop based on the event queue is established. Later, the event object of the Upper-layer request can be accepted, in the third task ).

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.