Android Wireless Boot Process Analysis

Source: Internet
Author: User

Before we can learn more about the work of the RIL layer, but if simply to tune Reference-ril Library, there is no need to learn more about the other libraries. But we need to know the basic boot process to facilitate debugging.

The initialization process of the wireless module during the boot process:

Rild invoke the function in the reference implementation REFERENCE-RIL.C (Hardware/ril/reference-ril):

Const ril_radiofunctions *ril_init (const struct RIL_ENV *env, int argc, char **argv)

ret = Pthread_create (&s_tid_mainloop, &attr, Mainloop, NULL);

static void *mainloop (void *param) ret = At_open (FD, onunsolicited);

Ril_requesttimedcallback (Initializecallback, NULL, &timeval_0);

The cat was initialized in the Initializecallback function.

That is, send a bunch of AT commands, make the corresponding settings, we can make the corresponding settings modification.

By default the RF module is assumed to be good,

The initialization of the wireless module is triggered by Setradiostate (Radio_state_sim_not_ready).

Initializes the wireless module with the static void Onradiopoweron ().

First through Pollsimstate (NULL); Poll the SIM card status.

static void Pollsimstate (void *param)

{

Atresponse *p_response;

int ret;

if (sstate! = Radio_state_sim_not_ready) {

No longer valid to poll

Return

}

Switch (Getsimstatus ()) {

Case Ril_sim_absent:

Case Ril_sim_pin:

Case RIL_SIM_PUK:

Case Ril_sim_network_personalization:

Default

Setradiostate (radio_state_sim_locked_or_absent);

Return

Case Ril_sim_not_ready:

Ril_requesttimedcallback (Pollsimstate, NULL, &timeval_simpoll);

Return

Case Ril_sim_ready:

Setradiostate (Radio_state_sim_ready);

Return

}

}

The function to read the SIM card status is: Getsimstatus ()

Err = At_send_command_singleline ("At+cpin?", "+cpin:", &p_response);

It sent the AT command to the cat At+cpin? To query the status of the wireless module, if the wireless module is not ready, then he is 1 seconds apart

Continue calling

The SIM card status polling function Pollsimstate until the SIM card status is obtained.

When the SIM status is ready, set the variable by setradiostate (Radio_state_sim_ready) sstate

For:

Radio_state_sim_ready, the function static void Onsimready () is called to further initialize the wireless

Module.

The AT commands that are sent are:

At_send_command_singleline ("At+csms=1″," +csms: ", NULL);

At_send_command ("At+cnmi=1,2,2,1,1″, NULL);

The basic boot process is like this, and when you get up, continue to debug the various requests. Each module is not the same, we need a different at command set.

I was only doing the task of debugging 3g modules, so the WiFi and so on modules do not understand.

Android Wireless Boot Process Analysis

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.