2/3G PLMN LIST
在MM_RATCM_PLMN_LIST_CNF或NWSEL_MM_PLMN_SEARCH_CNF消息中可以查看2,3G搜到的PLMN LIST
内容如下:
RAT:Radio Access Technologies 无线接入技术
PLMN (Public Land Mobile Network,公共陆地移动网络):由MCC和MNC组成;MCC(mobile contrary code)移动国家号码:唯一表示移动用户的所属国家,中国的MCC为460;MNC(mobile net code)移动网号:唯一表示该国家中的网络,例如中国移动GSM网为00,中国联通GSM网为01;
MCC MNC 运营商
460 00 中国移动
460 01 中国联通
460 02 中国移动
460 03 中国电信
460 06 中国联通
460 07 中国移动
460 20 中国铁通
460 05 中国电信
MOD_NIL, , TRACE_INFO, [AT_R p24, s15]+COPS: 0,2,”46001″,3
MOD_NIL, , TRACE_INFO, [AT_R p24, s15]+COPS: 0,2,”46001″,0
+COPS: 返回当前网络注册的状态
第一个参数<mode>: 0 – automatic; 1 – manual;
第二个参数<stat>: 0 – unknown; 1 – available; 2 – current; 3 – forbidden;
第三个参数<oper> : string type
第四个参数<Act> : 0 – GSM; 2 – UTRAN; 7 – LTE;
未开启数据连接,有如下反馈信息:
注册2G:
CM_Service 建立成功:
CREG : CS 网络注册状态
参数<n>:0 – disable network registration unsolicited result code;
1 – enable network registration unsolicited result code +CREG: <stat>;
2 – enable network registration and location information unsolicited result code
+CREG: <stat>[,<lac>,<ci>,[<Act>]]
3 – enable netowrk registration, location inforamtion and cause value information
unsolicited result code
+CREG: <state>[,<lac>,<ci>,[<Act>][,<cause_type>,<reject_cause>]]
第1个参数<stat>:0 – not registered, MT is not currently searching a new operator to register to
1 – registered, home network
2 – not registered, but MT is currently searching a new operator to register to
3 – registration denied
4 – unknown
5 – registered, roaming
6 – registered for “SMS only”, home network (applicable only when <AcT> indicates E-UTRAN)
7 – registered for “SMS only”, roaming (applicable only when <AcT> indicates EUTRAN)
8 – attached for emergency bearer services only (see NOTE 2) (not applicable)
9 – registered for “CSFB not preferred”, home network (applicable only when <AcT> indicates E-UTRAN)
10 – registered for “CSFB not preferred”, roaming (applicable only when <AcT> indicates E-UTRAN)
第2个参数<lac> : string type;
two byte location area code in hexadecimal format (e.g. “00C3” equals
195 in decimal)
第4个参数<Act>: 0 – GSM
2 – UTRAN
3 – GSM w/EGPRS
4 – UTRAN w/HSDPA
5 – UTRAN w/HSUPA
6 – UTRAN w/HSDPA and HSUPA
7 – E-UTRAN
网络状态更新:
/vendor/mediatek/proprietary/hardware/ril/gsm/mtk-ril/Ril_nw.c
根据 +CREG: 的返回,调用onNetworkStateChanged() 函数:
设置 is_cs = 1; is_r8 = 0;上报 RIL_UNSOL_RESPONSE_VOICE_NETWORK_STATE_CHANGED :
该函数的实现在:
/vendor/mediatek/proprietary/hardware/ril/gsm/librilmtk/Ril.cpp
此消息通过Socket传输到RILJ 层,processUnsolicited()函数处理:
/frameworks/opt/telephony/src/java/com/android/internal/telephony/RIL.java
消息的处理:
mVoiceNetworkStateRegistrants 添加监听者方法:
该方法被GsmServiceStateTracker 和 CdmaServiceStateTracker 调用,以Gsm为例:
通过this 传入参数可知,该GsmServiceStateTracker 为监听者,消息处理如下:
调用onNetworkStateChangeResult() 方法:
其中的log信息:
pollState() 方法:
消息EVENT_PS_NETWORK_STATE_CHANGED 的处理:
其中onPsNetworkStateChangeResult() :