浅谈 IMEI 及 IMEISV

众所周知,所有的手机都是通过输入“*#06#”来查询IMEI号.


有关IMEI/IMEISV,从网上查了些资料,其中比较权威的是GSM Assocication的文档, 里面详细介绍了整个IMEI的情况.

http://imeidb.gsm.org/imei/DG06.pdf,    “IMEIAllocation and Approval Guidelines”


IMEI(International Mobile Equipment Identity)国际移动设备标识码

The International Mobile Equipment Identify number (IMEI) uniquely identifies an individual mobile station. The IMEI is unique to every ME and thereby provides a means for controlling access to GSM networks based on ME types or individual units.

 The “IMEI”consists of a number of fields total 15 digits, all digits have the range of 0 to 9 coded as binary coded decimal. Values outside this range are not permitted.

Some of the fields in the IMEI are under the control of the “Reporting Body”. The remainder is under the control of the Type allocation holder.

The IMEI format valid from 01/01/03 is as shown below:

 

TAC:

The TAC identifies the type allocation code, formerly known as the type Approval code,for the type of the ME. It consists of two parts, the first part (NN) defines the reporting body allocating the TAC and the second part (XXXXYY) defines the ME type.

These 6 digits together with the reporting body 2 digit identifier uniquely identify each ME type.

Serial Number:

The serial number (SNR) is used to uniquely identify each individual ME of a particular ME type. The number range is allocated by the reporting body but assigned to individual mobile station by the manufacturer.

Check Digit:

The check digit shall be calculated according to Luhn formula, the check digit is a function of all other digits in the IMEI. The purpose of the check digit is to help guard against the possibility of incorrect entries to CEIR and EIR equipment.


IMEI Software Version Numbers (SVN)

The networkcan also request the IMEISV from Phase 2(or later) ME, the IMEISV shall containthe first 14 digits of the IMEI plus software version number (SVN).

The SVN shall be incremented when the ME software is modified. Allocation of the 2 digits SVN may be controlled by the reporting body, SVN of “99” is reserved for future use.



Here is the example for SVN using by MS manufacturer.

SVN

S/W version Comments

00

The initial version

01

The trial version

02

the official version

03

Maintenance version


The SVN is a separate field from the IMEI, although it is associated with IMEI, and when the network requests the IMEI from the MS, the SVN (if present) is also sent towards the network. It comprises 2 decimal digits.

It’s very important for network operator using, in the case of any S/W upgrade in the future after the device commercialized, the operator can use IMEISV on the core network side to trace how many devices was updated.

In LTE network,it is sent by the device in the 'Security Mode Complete’ signaling message during the procedures of attaching to the network.




<think>好的,我现在需要帮助用户查询AT命令中AT+CGSN的含义和用法。首先,回顾用户之前的问题,用户之前询问过AT+CSGN命令,是关于服务小区名称显示模式的。现在用户转向AT+CGSN,可能是在使用类似命令时遇到了混淆,或者需要获取设备的唯一标识信息。 首先,我需要确认AT+CGSN的正确功能。根据提供的引用资料,引用[1]提到AT+CGSN用于获取手机序列号(IMEI),而引用[3]详细说明了AT+CGSN的不同参数及其返回结果,比如=1返回IMEI,=2返回IMEISV,=3返回SVN。这说明AT+CGSN主要用于获取设备的唯一标识和版本信息。 用户可能的需求是了解如何通过AT命令获取设备的IMEI号,这在物联网设备开发中非常重要,比如设备注册、身份验证等场景。需要明确命令的语法、参数和响应格式,以及使用时需要注意的事项,比如SIM卡状态或网络注册情况,这些可能影响命令的执行。 接下来,我需要整理这些信息,确保结构清晰。首先定义命令的基本用途,然后分查询和设置模式,给出示例,再列出技术要点和常见错误。同时,要关联之前的回答,比如AT+CSGN用于服务小区名称,而AT+CGSN是设备标识,两者都属于AT命令集但功能不同,可能需要对比说明。 还要检查是否有潜在的混淆点,比如用户是否可能将AT+CGSN与其他类似命令如AT+CGMI(厂商信息)、AT+CGMR(版本号)混淆,所以在相关命令部分需要提及这些,帮助用户区分。此外,示例需要简洁明了,展示不同参数的使用和响应,让用户能直接复制使用。 最后,生成相关问题时要考虑用户可能的后续问题,比如如何获取其他设备信息,如何处理错误响应,以及与其他命令的关系,确保覆盖用户可能的需求,并提供进一步学习的路径。</think>### AT+CGSN命令详解 AT+CGSN是移动通信模块中用于**获取设备唯一标识信息**的核心指令,主要用于读取国际移动设备识别码(IMEI)和软件版本信息[^1][^3]。 #### 一、命令定义 - **功能定位**:属于设备身份识别类AT命令(GSM 07.07标准) - **核心作用**: ▸ 读取15位IMEI码(设备唯一身份证) ▸ 获取IMEISV(含软件版本号的扩展标识) ▸ 查询固件版本号[^3][^4] #### 二、语法结构 1. **查询模式** $$ AT+CGSN? $$ *响应示例*: `+CGSN: 123456789012345` `OK` 2. **参数设置模式** $$ AT+CGSN=<n> $$ 参数定义: | 参数值 | 功能说明 | |---|---| | `0` | 返回设备序列号(默认模式) | | `1` | 返回完整IMEI | | `2` | 返回IMEISV标识 | | `3` | 返回软件版本号SVN |[^3] #### 三、应用示例 ```plaintext // 获取完整IMEI AT+CGSN=1 +CGSN: 868744036640526 OK // 查询软件版本 AT+CGSN=3 +CGSN: R15.2.1-2023 OK ``` #### 四、技术规范 1. **前置条件**: - SIM卡已正确插入(AT+CPIN?返回READY) - 模块完成网络注册(AT+CREG=1) 2. **错误代码**: - `ERROR 516`:SIM卡未初始化 - `ERROR 530`:不支持该参数值 3. **数据特性**: - IMEI长度固定为15位数字 - IMEISV格式:IMEI+2位SVN号[^4] #### 五、关联命令 | 命令 | 功能对比 | |---|---| | AT+CGMI | 获取设备厂商信息 | | AT+CGMR | 读取固件版本号 | | AT+CIMI | 查询SIM卡IMSI号 |[^1] --- ### 相关问题 1. 如何通过AT命令验证IMEI号的合法性? 2. IMEI与IMSI在物联网设备管理中分别起什么作用? 3. 设备返回ERROR 516时应该检查哪些硬件状态?
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值