怎样用AT指令查询本机手机号码

AT+CNUM是向SIM卡查询本机号码的。



但是你必须先把这个号码写到SIM卡里面。

因为无论移动或者联通的SIM卡,买给用户的时候都没有把本机号码写到SIM卡内。

一旦你把本机号码写到了SIM卡内,无论你把这张SIM卡插到那台手机,用AT+CNUM都可以查出本机号码的。



Action command returns the MSISDNs relatedto the subscriber (this information can be stored in the SIM or in the

ME). If subscriber has different MSISDN fordifferent services, each MSISDN is returned in a separate line.



MSISDN Buffer Format(See GSM 11.11subclause10.3.5):

Bytes Description Length(bytes)

0-X Alpha Identifier X

X+1 Length of BCD number 1

X+2 TON and NPI 1

X+3--X+12 Dialling Number 10

X+13 Capability/Configuration Identifier 1

X+14 Extension1 Record Identifier 1



普通用户的SIM卡必须先把本机号码写入SIM卡内,才能读出来,不然读出来的是空的。



你可以找一张没有写入本机号码的SIM试试,在手机上查看本机号会是空的,如果你把本机号添加进去之后(会写入到SIM卡,一般的手机在查看本机号码的界面都可以添加本机号码的),你不但可以在你添加本机号码的手机上查看到本机号码,而且你把这张SIM卡插到别的手机上,照样可以查看到本机号码。

转自bbs.sendsms.cn

猜你喜欢

转载自sunrong201504170630.iteye.com/blog/2256702