Skip to content

Commit 625dc0d

Browse files
authored
Merge branch 'QuecPython:main' into main
2 parents 788e357 + 595c304 commit 625dc0d

File tree

2 files changed

+264
-94
lines changed

2 files changed

+264
-94
lines changed

en-us/api/QuecPythonClasslib.md

Lines changed: 125 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ Call this API to activating the PDP Context.
6969
| apn | string | Optional. APN name. The maximum length is 63 bytes. (The maximum length is 64 bytes in EC200U/EC200A) |
7070
| username | string | Optional. APN user name. The maximum length is 15 bytes.(The maximum length is 64 bytes in EC200U/EC200A) |
7171
| password | string | Optional. APN password. The maximum length is 15 bytes.(The maximum length is 64 bytes in EC200U/EC200A) |
72-
| authType | int | Authentication type. 0-No authentication, 1-PAP, 2-CHAP. |
72+
| authType | int | Authentication type. 0-No authentication, 1-PAP, 2-CHAP, 3-PAP AND CHAP(just for CAT-M platform).|
7373

7474
* Return Value
7575

@@ -347,7 +347,7 @@ After calling this interface, the user_apn.json will be created in the user part
347347
| apn | string | Optional. APN name. The maximum length is 63 bytes.(The maximum length is 64 bytes in EC200U/EC200A) |
348348
| username | string | Optional. APN user name. The maximum length is 15 bytes.(The maximum length is 64 bytes in EC200U/EC200A) |
349349
| password | string | Optional. APN password. The maximum length is 15 bytes.(The maximum length is 64 bytes in EC200U/EC200A) |
350-
| authType | int | Authentication type. 0-No authentication, 1-PAP, 2-CHAP. |
350+
| authType | int | Authentication type. 0-No authentication, 1-PAP, 2-CHAP, 3-PAP AND CHAP(just for CAT-M platform). |
351351
| flag | int | This parameter is optional. The default value is 0, indicating that only a user_apn.json file is created to save user APN information. If the value is 1, the user_apn.json file is created to save user APN information, and the APN information is used for PDP context activation immediately. |
352352

353353
* Return Value
@@ -705,8 +705,6 @@ Obtain Coordinate Information.
705705

706706
Function:send AT cmd.
707707

708-
Note:This module only supports 1803S/EC200U/CATM platform.
709-
710708
#### send AT cmd
711709

712710
> **atcmd.sendSync(atcmd,resp,include_str,timeout)**
@@ -2135,16 +2133,25 @@ Function: Provides APIs to query/set network related performance.
21352133

21362134
##### Set APN
21372135

2138-
> **net.setApn(apn, simid)**
2136+
> **net.setApn(\*args)**
21392137

21402138
This function sets APN. After setting, you need to restart or switch to mode 0 and then mode 1 through the `net.setmodemFun (mode)` interface for the setting to take effect.
21412139

21422140
* Parameter
21432141

2144-
| Parameter | Type | Description |
2145-
| --------- | ------ | ------------------------------------------- |
2146-
| apn | string | apn name |
2147-
| simid | int | simid<br>0 : SIM card 1<br/>1 : SIM card 2 |
2142+
This API is a variable parameter function in Qualcomm/ASR_1803s/Unisoc(excluding EG915) platform, and the number of parameters is 2 or 7. The number of parameters in other platforms is fixed at 2
2143+
The number of parameters is 2:net.setApn(apn, simid)
2144+
The number of parameters is 7:net.setApn(pid, iptype, apn, usrname, password, authtype, simid)
2145+
2146+
| Parameter | Type | Description |
2147+
| ----- | -------- | -------------------------------------------- |
2148+
| pid | int | PDP context index. |
2149+
| iptype | int | IP type. 0-IPV4, 1-IPV6, 2-IPV4 and IPV6. |
2150+
| apn | string | apn name, The maximum length is 63 bytes. |
2151+
| usrname | string | user name, The maximum length is 63 bytes. |
2152+
| password | string | password, The maximum length is 63 bytes. |
2153+
| authtype | int | Authentication type,0-No authentication, 1-PAP, 2-CHAP, 3-PAP AND CHAP(just for CATM Platform)|
2154+
| simid | int | simid<br>0 : SIM card 1<br/>1 : SIM card 2 |
21482155

21492156
* Return Value
21502157

@@ -2155,29 +2162,56 @@ This function sets APN. After setting, you need to restart or switch to mode 0 a
21552162

21562163
The BC25PA platform does not support this module function.
21572164

2165+
* Example
2166+
2167+
```python
2168+
>>> net.setApn('3gnet',0)
2169+
0
2170+
>>> net.setApn(1,1,'3gnet','mia','123',2,0)
2171+
0
2172+
```
21582173

21592174

2175+
21602176
##### Obtain the Current APN
21612177

2162-
> **net.getApn(simid)**
2178+
> **net.getApn(\*args)**
21632179

21642180
This function obtains the current APN.
21652181

21662182
* Parameter
21672183

2168-
| Parameter | Type | Description |
2169-
| --------- | ---- | -------------------------------------------- |
2170-
| simid | int | simid<br/>0 : SIM card 1<br/>1 : SIM card 2 |
2184+
This API is a variable parameter function in Qualcomm/ASR_1803s/Unisoc(excluding EG915) platform, and the number of parameters is 1 or 2. The number of parameters in other platforms is fixed at 1
2185+
The number of parameters is 2:net.setApn(pid, simid)
2186+
The number of parameters is 1:net.setApn(simid)
2187+
2188+
| Parameter | Type | Description |
2189+
| ----- | -------- | -------------------------------------------- |
2190+
| pid | int | PDP context index. |
2191+
| simid | int | simid<br>0 : SIM card 1<br/>1 : SIM card 2 |
21712192

21722193
* Return Value
21732194

2174-
* 0 Successful execution
2175-
* -1 Failed execution
2195+
The number of parameters is 2:
2196+
* pdp context: Successful execution
2197+
* -1 Failed execution
2198+
The number of parameters is 1:
2199+
* apn info: Successful execution
2200+
* -1 Failed execution
21762201

21772202
* Note
21782203

21792204
* The BC25PA platform does not support this module function.
21802205

2206+
* Example
2207+
2208+
```python
2209+
>>> net.getApn(0)
2210+
'3gnet'
2211+
>>> net.getApn(1,0)
2212+
(1, '3gnet', 'mia', '123', 2)
2213+
```
2214+
21812215

21822216

21832217
##### Obtain CSQ
@@ -2208,7 +2242,7 @@ This function obtains CSQ.
22082242

22092243
##### Obtain Neighbor Cell Information
22102244

2211-
> **net.getCellInfo()**
2245+
> **net.getCellInfo(\*args)**
22122246

22132247
This function obtains the information of Cell information.
22142248

@@ -2222,13 +2256,19 @@ case with one Parameter:
22222256

22232257
* Parameter
22242258

2225-
* None
2259+
This API is a variable parameter function in BC25 platform, and the number of parameters is 0 or 1. The number of parameters in other platforms is fixed at 0
2260+
The number of parameters is 0:net.getCellInfo()
2261+
The number of parameters is 1:net.getCellInfo(sinr_enable)
2262+
2263+
| Parameter | Type | Description |
2264+
| ----- | -------- | -------------------------------------------- |
2265+
| enable | int | range:0/1, 0:disable to get sinr 1:enable to get sinr|
22262266

22272267
* Return Value
22282268

22292269
* If the execution is failed, -1 is returned. If the execution is successful, the list of neighbor cell information including RATs GSM/UMTS/LTE are returned in the following format. And when the neighbor cell information for one RAT is null, the corresponding list returned is null.
22302270

2231-
* `([(flag, cid, mcc, mnc, lac, arfcn, bsic, rssi)], [(flag, cid, licd, mcc, mnc, lac, arfcn, bsic, rssi)], [(flag, cid, mcc, mnc, pci, tac, earfcn, rssi),...])`
2271+
* `([(flag, cid, mcc, mnc, lac, arfcn, bsic, rssi)], [(flag, cid, licd, mcc, mnc, lac, arfcn, bsic, rssi)], [(flag, cid, mcc, mnc, pci, tac, earfcn, rssi, sinr),...])`
22322272

22332273
* The description of the return value for GSM:
22342274

@@ -2329,6 +2369,12 @@ The function obtains the current RAT and the roaming configuration.
23292369
| 16 | GSM_LTE, dual link |
23302370
| 17 | UMTS_LTE, dual link. Not supported in EC100Y and EC200S |
23312371
| 18 | GSM_UMTS_LTE, dual link. Not supported in EC100Y and EC200S |
2372+
| 19 | CATM, BG95 supported |
2373+
| 20 | GSM_CATM, BG95 supported |
2374+
| 21 | CATNB, BG95 supported |
2375+
| 22 | GSM_CATNB, BG95 supported |
2376+
| 23 | CATM_CATNB, BG95 supported |
2377+
| 24 | GSM_CATM_CATNB, BG95 supported |
23322378

23332379
* Example
23342380

@@ -2397,6 +2443,24 @@ This function obtains the network mode.
23972443
| 9 | E TRAN A |
23982444
| 10 | NONE |
23992445

2446+
* Note:For CATM platforms, see the following table
2447+
2448+
| Value| ACT Mode |
2449+
| ---- | ------------------ |
2450+
| 0 | GSM |
2451+
| 1 | GSM COMPACT |
2452+
| 2 | UTRAN |
2453+
| 3 | GSM wEGPRS |
2454+
| 4 | UTRAN wHSDPA |
2455+
| 5 | UTRAN wHSUPA |
2456+
| 6 | UTRAN wHSDPA HSUPA |
2457+
| 7 | E_UTRAN |
2458+
| 8 | UTRAN HSPAP |
2459+
| 9 | E_UTRAN_CA |
2460+
| 10 | E_UTRAN_NBIOT |
2461+
| 11 | E_UTRAN_EMTC |
2462+
| 12 | NONE |
2463+
24002464
* Example
24012465

24022466
```python
@@ -2408,7 +2472,7 @@ This function obtains the network mode.
24082472

24092473
##### Obtain the Signal Strength
24102474

2411-
> **net.getSignal()**
2475+
> **net.getSignal(\*args)**
24122476

24132477
This function obtains the signal strength.
24142478

@@ -2422,13 +2486,19 @@ case with one Parameter:
24222486

24232487
* Parameter
24242488

2425-
* None
2489+
This API is a variable parameter function in BC25 platform, and the number of parameters is 0 or 1. The number of parameters in other platforms is fixed at 0
2490+
The number of parameters is 0:net.getCellInfo()
2491+
The number of parameters is 1:net.getCellInfo(sinr_enable)
2492+
2493+
| Parameter | Type | Description |
2494+
| ----- | -------- | -------------------------------------------- |
2495+
| enable | int | range:0/1, 0:disable to get sinr 1:enable to get sinr|
24262496

24272497
* Return Value
24282498

24292499
* If the execution is failed, -1 is returned. If the execution is successful, a tuple including 2 list (GW/LTE) is returned in the following format:
24302500

2431-
`([rssi, bitErrorRate, rscp, ecno], [rssi, rsrp, rsrq, cqi])`
2501+
`([rssi, bitErrorRate, rscp, ecno], [rssi, rsrp, rsrq, cqi, sinr])`
24322502

24332503
* The description of the return value:
24342504

@@ -2535,7 +2605,7 @@ This function obtains the registration state.
25352605

25362606
* If the execution is failed, -1 is returned. If the execution is successful, a tuple is returned in the following format. The tuple contains voice and network registration information. The tuple starting with 'voice\_' indicates voice registration information, and the tuple starting with 'data\_' indicates network registration information:
25372607

2538-
`([voice_state, voice_lac, voice_cid, voice_rat, voice_reject_cause, voice_psc], [data_state, data _lac, data _cid, data _rat, data _reject_cause, data _psc])`
2608+
`([voice_state, voice_lac, voice_cid, voice_rat, voice_reject_cause, voice_psc], [data_state, data_lac, data_cid, data_rat, data_reject_cause, data_psc])`
25392609

25402610
The description of the return value:
25412611

@@ -2581,7 +2651,23 @@ This function obtains the registration state.
25812651
| 9 | E_UTRAN_CA |
25822652
| 10 | NONE |
25832653

2654+
* Note:For CATM platforms, see the following table
25842655

2656+
| Value| ACT Mode |
2657+
| ---- | ------------------ |
2658+
| 0 | GSM |
2659+
| 1 | GSM COMPACT |
2660+
| 2 | UTRAN |
2661+
| 3 | GSM wEGPRS |
2662+
| 4 | UTRAN wHSDPA |
2663+
| 5 | UTRAN wHSUPA |
2664+
| 6 | UTRAN wHSDPA HSUPA |
2665+
| 7 | E_UTRAN |
2666+
| 8 | UTRAN HSPAP |
2667+
| 9 | E_UTRAN_CA |
2668+
| 10 | E_UTRAN_NBIOT |
2669+
| 11 | E_UTRAN_EMTC |
2670+
| 12 | NONE |
25852671

25862672
* Example
25872673

@@ -5970,7 +6056,7 @@ Class function: A two-wire protocol used for communication between devices.
59706056

59716057
| Parameter | Type | Description |
59726058
| --------- | ---- | ------------------------------------------------------------ |
5973-
| I2Cn | int | I2C channel index number:<br />I2C.I2C0 : 0 <br />I2C.I2C0 : 1 |
6059+
| I2Cn | int | I2C channel index number:<br />I2C.I2C0 : 0 <br />I2C.I2C1 : 1 |
59746060
| MODE | int | I2C working mode:<br />I2C.STANDARD_MODE : 0 Standard mode<br />I2C.FAST_MODE1 Fast mode |
59756061

59766062
- Pin Correspondence
@@ -11060,13 +11146,13 @@ $GNGSA,A,3,31,3
1106011146

1106111147
Module function: the module provides a bare flash area and a special read-write interface for customers to store important information, and the information will not be lost after burning the firmware (burning the firmware without this function cannot be guaranteed not to be lost). Provide a storage and read interface, not a delete interface.
1106211148

11063-
>At present, only ec600n and ec600s series projects are supported
11149+
At present, only ec600n and ec600s series projects are supported
1106411150

1106511151
##### Data storage
1106611152

11067-
SecureData.Store(index, databuf, len)
11153+
>**SecureData.Store(index, databuf, len)**
1106811154

11069-
**Parameter**
11155+
* Parameter
1107011156

1107111157
| Parameter | type | description |
1107211158
| ------ | -------- | ------------------------------------------------------------ |
@@ -11077,16 +11163,16 @@ SecureData.Store(index, databuf, len)
1107711163

1107811164
When storing, it is stored according to the shorter of databuf and Len
1107911165

11080-
**Return Value**
11166+
* Return Value
1108111167

11082-
* -1: Parameter error
11083-
* 0: normal execution
11168+
-1: Parameter error
11169+
0: normal execution
1108411170

1108511171
##### Data reading
1108611172

11087-
SecureData.Read(index,databuf,len)
11173+
>**SecureData.Read(index,databuf,len)**
1108811174

11089-
**Parameter**
11175+
* Parameter
1109011176

1109111177
| Parameter | type | description |
1109211178
| ------ | -------- | ----------------------------------------------- |
@@ -11096,13 +11182,13 @@ SecureData.Read(index,databuf,len)
1109611182

1109711183
If the stored data is not as large as the incoming len, the actual stored data length is returned
1109811184

11099-
**Return Value**
11185+
* Return Value
1110011186

11101-
* -2: The stored data does not exist and the backup data does not exist
11102-
* -1: Parameter error
11103-
* Other: length of data actually read
11187+
-2: The stored data does not exist and the backup data does not exist
11188+
-1: Parameter error
11189+
Other: length of data actually read
1110411190

11105-
**Example**
11191+
* Example
1110611192

1110711193
```python
1110811194
import SecureData
@@ -11117,7 +11203,9 @@ len = SecureData.Read(1, buf, 20)
1111711203
#Output read data
1111811204
print(buf[:len])
1111911205
```
11120-
**implementation results**
11206+
11207+
* implementation results
11208+
1112111209
```python
1112211210
>>> import SecureData
1112311211
>>> databuf = '\x31\x32\x33\x34\x35\x36\x37\x38'
@@ -11941,4 +12029,3 @@ if __name__ == '__main__':
1194112029

1194212030
```
1194312031

11944-

0 commit comments

Comments
 (0)