IMEI && IMSI && APN设置

本文详细介绍了IMEI(国际移动设备身份码)和IMSI(国际移动用户识别码)的概念及其组成。IMEI用于唯一标识手机设备,而IMSI用于唯一标识移动用户。文章还解释了两者在不同标准下的变化及获取方式。

(1)IMEI(International Mobile Equipment Identity)是国际移动设备身份码的缩写,国际移动装备辨识码,是由15位数字组成的"电子串号",它与每台手机一一对应,而且该码是全世界唯一的。我们写的imei号是写在手机里面的,但是imei号是基站识别手机的一个标识,和sim卡是有关联的但本质是独立的。

(2)2004年以前的标准中,IMEI共15位(取值必须是0~9的数字),依次分别是6位TAC、2位FAC、6位SNR、1位CD校验位。2004年以后的标准中删去了最后的1位CD校验位,新加入了2位SVN(software version number),故称IMEISV,共16位(取值仍必须是0~9的数字)。
         网络对于IMEI或者IMEISV的检查是非必须的,各运营商会按照自己的策略在通信的某个阶段检查手机的IMEI或者IMEISV,并可能做进一步的动作。可能检查IMEI或者IMEISV的阶段有:A,开机注册网络时;B,周期性位置更新时;C,进行接打电话、收发短信、上网等业务时;D,或者其他(根据运营商的策略决定)。网络检查的时候会指明检查IMEI还是IMEISV,如果是检查IMEI,则手机许上报前14位IMEI(1位CD校验位不上报),如果是检查IMEISV,则手机上报16位IMEISV。
(3)这个号码是存在手机NVRAM里面的,以前一直以为返回IMEI号是直接读存储器就行了,直到最近看android手机CODE,发现需要AT命令交互,如下:

[cpp]  view plain copy
  1. void getIMEI(int sim, char *result) {  
  2.     ..........  
  3.     if(sim==1) strcpy(buf, "AT+EGMR=0,7\r\n");  
  4.     else strcpy(buf, "AT+EGMR=0,10\r\n");  
  5.     fd= open("/dev/ttyC0",O_RDWR);  
  6.     write(fd,buf,strlen(buf));  
  7.     usleep(200000);  
  8.     read(fd,buf,1024);  
  9.     close(fd);  
  10.     .............  
  11. }  

        
=============================================================================================================

        IMSI是国际移动用户识别码的简称(International Mobile Subscriber Identity),IMSI共有15位,其结构如下:MCC+MNC+MIN。MCC:Mobile Country Code,移动国家码,共3位,中国为460;MNC:Mobile NetworkCode,移动网络码,共2位,在中国,移动的代码为电00和02,联通的代码为01,电信的代码为03。所以合起来就是(Android手机中APN配置文件中的代码):中国移动:46000 46002;中国联通:46001;中国电信:46003。比如一个典型的IMSI号码为460030912121001。

======================================================================================================

         apn设定在CODE中的体现,有XML文件载入。一个例子如下:

Hi, We have some quality issue to investigate with Android TV (SFR CTV) connected to the NX511v and NB410v later. To remeber the REST API is used to provide environment vision at the CTV. For this reason we need to have power signal value report in 5g and 4g. Could you add in 1.28.0 scope the small adding ? Now curl http://192.168.1.1:80/api/1.0/?method=cellular.getInfo <?xml version="1.0" encoding="UTF-8"?><rsp stat="ok" version="1.0"><cellular status="up" service="" type="router5g" model="TPLink-NX511v" imei="350817800152855" imsi="208101594331862" apn="box" network="5GNSA" /></rsp> Need curl http://192.168.1.1:80/api/1.0/?method=cellular.getInfo <?xml version="1.0" encoding="UTF-8"?><rsp stat="ok" version="1.0"><cellular status="up" service="" type="router5g" model="TPLink-NX511v" imei="350817800152855" imsi="208101594331862" apn="box" network="5GNSA" power_5g="75" power_4g="100" /></rsp> ==== cellular.getInfo * Méthode HTTP : GET * Accès : privé * Description : informations sur le Module/Backup ou la techno radio. * Retour : ** balise *cellular* > attribut *status* = +(ascii)+.Status du module ** balise *cellular* > attribut *service* = +(ascii)+.Status du service du module ** balise *cellular* > attribut *type* = +(ascii)+. Type de module ** balise *cellular* > attribut *model* = +(ascii)+.Modele equipement ** balise *cellular* > attribut *imei* = +(ascii)+.Numéro IMEI de l’équipement ** balise *cellular* > attribut *imsi* = +(ascii)+.Numéro IMSI de la SIM dans l’equipement ** balise *cellular* > attribut *apn* = +(ascii)+.Nom d’APN utilisé par la SIM dans l’équipement ** balise *cellular* > attribut *network* = +(None|3G|4G|4G+|5GNSA|5GSA)+. techno radio ** balise *cellular* > attribut *power_5g* = +(100|75|50|25|0)+. power signal computed 5G ** balise *cellular* > attribut *power_4g* = +(100|75|50|25|0)+. power signal computed 4G .Exemple [source,xml] ---- $ curl 'http://192.168.1.1/api/1.0/?method= cellular.getInfo' <?xml version="1.0" encoding="UTF-8"?> <rsp stat="ok" version="1.0"> <wan.cellular status="" service="ready" type ="Box de poche 4G" model="MT504" imie="868510056876864" imsi="208103289707194" apn="box" network="5GNSA" power_5g="75" power_4g="100"/ > </rsp>所以这个要求是要做啥
最新发布
12-20
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值