当前位置:网站首页>Haas506 2.0 development tutorial - Advanced Component Library -modem Sim (only supports versions above 2.2)

Haas506 2.0 development tutorial - Advanced Component Library -modem Sim (only supports versions above 2.2)

2022-06-23 06:37:00 Zhiyunfu

haas506 2.0 Development tutorial - Advanced component library -modem.sim

1. obtain sim Card information

Case description :

  • The development board networking needs to be inserted SIM card
  • obtain ICCID、IMSI Etc .

main.py

from modem import sim

print(" obtain SIM Card status :",sim.getStatus())
print("ICCID:",sim.getIccid())
print("IMSI:",sim.getImsi())

Log output

 obtain SIM Card status : 0
ICCID: 89860622310046855807
IMSI: 460065201385580

2.Class-sim

getStatusgetIccidgetImsi
obtain SIM Card status obtain ICCID obtain IMSI

sim - SIM Card function

  • The function prototype :

modem.sim()

  • Parameter description : nothing

  • Return value : sim Object created successfully , return Name(sim)

getImsi - obtain IMSI( International mobile user identification number )

  • The functionality : obtain IMSI( International mobile user identification number )

  • The function prototype :

sim.getImsi()

  • Parameter description : nothing

  • Return value : return IMSI

getIccid - obtain ICCID( IC card identification number )

  • The functionality : obtain ICCID( IC card identification number )

  • The function prototype :

sim.getIccid()

  • Parameter description : nothing

  • Return value : return ICCID

getStatus - obtain SIM Card status

  • The functionality : obtain SIM Card status

  • The function prototype :

sim.getStatus()

  • Parameter description : nothing

  • Return value : Return value =0,sim The card is normal , Return value =-1,sim Abnormal card

原网站

版权声明
本文为[Zhiyunfu]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/174/202206230512037546.html