资源描述:
《gprs启动过程分析》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、gprs启动过程分析android无线启动过程分析.http://blog.csdn.net/badboyplane/article/details/6548578android无线启动过程分析开机过程中无线模块的初始化过程:rild调用参考实现Reference-ril.c(hardware/ril/reference-ril)中的函数:constRIL_RadioFunctions*RIL_Init(conststructRIL_Env*env,intargc,char**argv)ret=pthread_create(&s_tid_mai
2、nloop,&attr,mainLoop,NULL);staticvoid*mainLoop(void*param)ret=at_open(fd,onUnsolicited);RIL_requestTimedCallback(initializeCallback,NULL,&TIMEVAL_0);在initializeCallback函数中对猫进行了初始化。staticvoidinitializeCallback(void*param){ATResponse*p_response=NULL;interr;setRadioState(RADIO_
3、STATE_OFF);at_handshake();/*note:wedon'tcheckerrorshere.EverythingimportantwillbehandledinonATTimeoutandonATReaderClosed*//*atchannelistolerantofechobutitmust*//*haveverboseresultcodes*/at_send_command("ATE0Q0V1",NULL);/*Noauto-answer*/at_send_command("ATS0=0",NULL);/*Extend
4、ederrors*/at_send_command("AT+CMEE=1",NULL);/*Networkregistrationevents*/err=at_send_command("AT+CREG=2",&p_response);/*somehandsets--intetheredmode--don'tsupportCREG=2*/if(errsuccess==0){at_send_command("AT+CREG=1",NULL);}at_response_free(p_response);/*GPRSregistrationevent
5、s*/at_send_command("AT+CGREG=1",NULL);/*CallWaitingnotifications*/at_send_command("AT+CCWA=1",NULL);/*Alternatingvoice/dataoff*/at_send_command("AT+CMOD=0",NULL);/*Notmuted*/at_send_command("AT+CMUT=0",NULL);/*+CSSUunsolicitedsuppservicenotifications*/at_send_command("AT+CSS
6、N=0,1",NULL);/*noconnectedlineidentification*/at_send_command("AT+COLP=0",NULL);/*HEXcharacterset*/at_send_command("AT+CSCS=/"HEX/"",NULL);/*USSDunsolicited*/at_send_command("AT+CUSD=1",NULL);/*Enable+CGEVGPRSeventnotifications,butdon'tbuffer*/at_send_command("AT+CGEREP=1,0"
7、,NULL);/*SMSPDUmode*/at_send_command("AT+CMGF=0",NULL);#ifdefUSE_TI_COMMANDSat_send_command("AT%CPI=3",NULL);/*TIspecific--notificationswhenSMSisready(currentlyignored)*/at_send_command("AT%CSTAT=1",NULL);#endif/*USE_TI_COMMANDS*//*assumeradioisoffonerror*/if(isRadioOn()>0){
8、setRadioState(RADIO_STATE_SIM_NOT_READY);}}默认状况下假设射频模块是好的,通过setRadioState(R