当前位置:网站首页>Haas506 2.0 development tutorial - Advanced Component Library -modem Net (only supports versions above 2.2)
Haas506 2.0 development tutorial - Advanced Component Library -modem Net (only supports versions above 2.2)
2022-06-23 06:37:00 【Zhiyunfu】
haas506 2.0 Development tutorial - Advanced component library -modem.net
1. obtain net Information
Case description :
- The development board networking needs to be inserted SIM card
- Use in this case net The module obtains the signal strength , near CELL Information, etc .
main.py
# -*- coding: UTF-8 -*-
from modem import net
import utime as time
print("-----------start net test----------")
time.sleep_ms(3000)
print("methods in net:",dir(net))
print(" Set the working mode :",net.setModem(0))
print(" Signal strength :",net.getCsq())
print(" Get proximity CELL Information about :",net.getCellInfo())
print(" Get working mode :",net.getModem())
print(" Get the current network mode :",net.getMode())
print("------------end net test------------")
Log output
-----------start net test----------
methods in net: ['__class__', '__name__', '__bases__', '__dict__', 'checkNet', 'dataCall', 'csqQueryPoll', 'getCsq', 'getCellInfo', 'getMode', 'getModem', 'setModem']
Set the working mode : 0
Signal strength : 31
Get proximity CELL Information about :([], [], [(0, 68395803, 1120, 272, 46, 0, 16734, -65), (0, 68395804, 1120, 272, 45, 0, 16734, -68), (0, 68395825, 1120, 272, 69, 0, 16734, -73)])
Get working mode : 0
Get the current network mode : 0
------------end net test------------
2.Class-net
| getModem | setModem | getCsq | getCellInfo | getMode |
|---|---|---|---|---|
| Get working mode | Set the working mode | Get the signal strength | Obtain the attached cell information | Get the current network mode |
net - Network function
- The function prototype :
modem.net()
- Parameter description : nothing
setModem - Set flight mode
The functionality : Set flight mode
The function prototype :
net.setModem(value)
- Parameter description :
| Parameters | type | explain |
|---|---|---|
| value | int | value=0 Full function mode ;value=1 Turn on flight mode |
getModem - Get working mode
The functionality : Get working mode
The function prototype :
net.getModem()
Parameter description : nothing
Return value : Return value =1, Flight Mode ; Return value =0, Normal mode
getCsq - Get working mode
The functionality : Get the flight mode status
The function prototype :
net.getCsq()
Parameter description : nothing
Return value : Successfully returned integer csq Signal strength value
getMode - Get the current network mode
The functionality : Get the current network mode
The function prototype :
net.getMode()
Parameter description : nothing
Return value :
| The number | explain |
|---|---|
| 0 | auto |
| 1 | GSM only |
| 3 | LTE only |
getCellInfo - Obtain the attached cell information
The functionality : Obtain the attached cell information
The function prototype :
net.getCellInfo()
Parameter description : nothing
Return value : The successful return contains three network systems (GSM、UMTS、LTE) Of information list, If the corresponding network system information is empty , Returns empty List.(UMTS Temporary does not support , Default return []), The format of the return value is as follows :
([(cid, mcc, mnc, lac, arfcn, bsic)], [], [(cid, mcc, mnc, pci, earfcn,tac),…])
GSM Description of network system return value
| Parameters | Parameter meaning |
|---|---|
| cid | return GSM Under the Internet cell id Information ,0 Is empty , Range 0 ~ 65535 |
| mcc | Mobile device country code , Range 0 ~ 999 Be careful :EC100Y/EC600S/EC600N Series of modules , The value is expressed in hexadecimal , For example, the decimal number in the following example 1120, Expressed in hexadecimal as 0x460, Indicates the mobile device country code 460, Other model modules , The value is expressed directly in decimal , For example, mobile device country code 460, It's in decimal system 460 To express . |
| mnc | Mobile device network code , Range 0 ~ 99 |
| lac | Location area code , Range 1 ~ 65534 |
| arfcn | Wireless channel number , Range 0 ~ 65535 |
| bsic | Base station identification number , Range 0 ~ 255 |
LTE Description of network system return value
| Parameters | Parameter meaning |
|---|---|
| cid | return LTE Under the Internet Cell identity Information ,Cell identity = RNC_ID * 65536 + Cell_ID,Cell identity Range 0x0000000 ~ 0xFFFFFFF( Notice that this is 28bits); among RNC_ID The range is 0 ~ 4095,Cell_ID The range is 0 ~ 65535 |
| mcc | Mobile device country code , Range 0 ~ 999 |
| mnc | Mobile device network code , Range 0 ~ 99 |
| pci | Physical layer cell ID ,0 ~ 503 |
| tac | Tracking area code ,0 ~ 65535 |
| earfcn | Wireless channel number , Range 0 ~ 65535 |
边栏推荐
- ffplay实现自定义输入流播放
- LeetCode笔记:Weekly Contest 298
- 2020 smart power plant industry insight white paper
- Docker practice - redis cluster deployment and micro service deployment project
- 2.17 haas506 2.0开发教程-system(仅支持2.2以上版本)
- In the half year summary, it people just want to lie flat
- Day_ 11 smart communication health project - graphic report and poi Report
- C Advanced Learning -- Reflection
- Find the number of nodes in the widest layer of a binary tree
- 什么是PDCA循环?如何整合 PDCA 循环和 OKR
猜你喜欢

haas506 2.0開發教程-高級組件庫-modem.sms(僅支持2.2以上版本)

Day_05 传智健康项目-预约管理-预约设置

同步开关电源降低EMI布局 dv/dt di/dt

Gridsearchcv (grid search), a model parameter adjuster in sklearn

什么是客户体验自动化?

设计师需要懂的数据指标与数据分析模型

Detailed explanation of redis persistence, master-slave and sentry architecture

Day_ 01 smart communication health project - project overview and environmental construction

Day_ 11 smart communication health project - graphic report and poi Report

光谱共焦的测量原理及厚度测量模式
随机推荐
把CSMA/CD、Token Bus、Token Ring说清楚
【踩坑记录】数据库连接未关闭连接,释放资源的坑
Shutter style
Leetcode topic resolution remove nth node from end of list
Leetcode topic resolution valid Sudoku
Repeated DNA sequences for leetcode topic resolution
279.完全平方数
haas506 2.0开发教程-高级组件库-modem.sim(仅支持2.2以上版本)
C语言去除字符串尾部的换行(或其他字符)
Given a node of a binary tree, return the successor node of the node
Day_ 09 smart health project - mobile terminal development - Mobile quick login and permission control
How to batch produce QR codes that can be read online after scanning
Day_ 13 smart health project - Chapter 13
What is a PDCA cycle? How to integrate PDCA cycle and OKR
Day_ 06 smart health project - mobile terminal development - physical examination appointment
开源生态|超实用开源License基础知识扫盲帖(下)
Coordinate transformation
C language obtains second, millisecond, subtle and nanosecond timestamps
如何查看本机IP
Gridsearchcv (grid search), a model parameter adjuster in sklearn