Skip to content

Commit 582bb6e

Browse files
Merge pull request #3 from QuecPython/main
update audio.Record()
2 parents ff1a6b9 + 60ff3c5 commit 582bb6e

File tree

2 files changed

+143
-15
lines changed

2 files changed

+143
-15
lines changed

en-us/api/QuecPythonClasslib.md

Lines changed: 71 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1355,6 +1355,70 @@ This function sets DTMF.
13551355

13561356

13571357

1358+
##### Enable DTMF identification
1359+
1360+
> **voiceCall.dtmfDetEnable(enable)**
1361+
1362+
Enable DTMF identification. It is disabled by default.
1363+
1364+
* Parameter
1365+
1366+
| Parameter | Type | Description |
1367+
| --------- | ------ | ------------------------------------------------------------ |
1368+
| enable | int | 1:Enable DTMF identification, 0:Disable DTMF identification |
1369+
1370+
* Return Value
1371+
1372+
* Returns 0 on success, -1 otherwise.
1373+
1374+
* Example
1375+
1376+
See the example of 'voiceCall.dtmfSetCb()'
1377+
1378+
1379+
1380+
##### set the callback of DTMF identification
1381+
1382+
> **voiceCall.dtmfSetCb(cb)**
1383+
1384+
Set the callback of DTMF identification
1385+
1386+
* Parameter
1387+
1388+
| Parameter | Type | Description |
1389+
| --------- | ------ | ------------------------------------------------------------ |
1390+
| cb | function | callback function |
1391+
1392+
* Return Value
1393+
1394+
* Returns 0 on success, -1 otherwise.
1395+
1396+
* Example
1397+
1398+
```
1399+
>>> def cb(args):
1400+
... print(args)
1401+
...
1402+
...
1403+
...
1404+
>>> voiceCall.dtmfSetCb(cb)
1405+
0
1406+
>>> voiceCall.dtmfDetEnable(1)
1407+
0
1408+
1409+
>>> voiceCall.callStart('13855169092')
1410+
1411+
0
1412+
>>>
1413+
1 //Press "1" on the phone, callback function will receive the pressed character "1".
1414+
1415+
8 //Press "8" on the phone
1416+
1417+
9 //Press "9" on the phone
1418+
```
1419+
1420+
1421+
13581422
##### Set FWmode
13591423

13601424
> **voiceCall.setFw(reason, fwmode, phonenum)**
@@ -7558,7 +7622,7 @@ True
75587622
| timeout | Integer type | This parameter is the timeout of upper layer application. When the application triggers timeout, it actively reports the scanned hot spot information. The application automatically reports the hot spot information if it scans all the hop spots which have been set previously or the underlying layer scan reaches the frequency sweeping timeout before the timeout of the application. <br>Range:<br/>600S: 4255; unit: s.<br/>200U/600U: 1205000; unit: ms. |
75597623
| round | Integer type | This parameter is the scanning rounds of wifi. When reaching the scanning rounds, the scan stops and the scanning results are obtained. <br/>Range:<br/>600S: 13; unit: round<br/>200U/600U: 110; unit: round |
75607624
| max_bssid_num | Integer type | This parameter determines the maximum number of hot spots to be scanned. If the number of hot spots scanned by the underlying layer reaches the maximum, the scan stops and the scanning results are obtained. <br/>Range:<br/>600S: 430<br/>200U/600U: 1300 |
7561-
| scan_timeout | Integer type | This parameter is the wifi hot spot scanning timeout of underlying layer. If the underlying layer scan reaches the hot spot scanning timeout set previously, the scan stops and the scanning results are obtained. Range: 1255. Unit: second. 200U or 600U platforms do not support this parameter. You can set this parameter to 0. |
7625+
| scan_timeout | Integer type | This parameter is the wifi hot spot scanning timeout of underlying layer. If the underlying layer scan reaches the hot spot scanning timeout set previously, the scan stops and the scanning results are obtained. Range: 1255. |
75627626
| priority | Integer type | This parameter is the priority setting of wifi scanning service. 0 indicates that ps is preferred; 1 indicates that wifi is preferred. When ps is preferred, the wifi scan is terminated when a data service is initiated. When wifi is preferred, RRC connection is not connected when a data service is initiated. wifi scan runs normally. The RRC connection is only established after the scan completes. 200U or 600U platforms do not support this parameter. You can set this parameter to 0. |
75637627

75647628
* Return Value:
@@ -11182,7 +11246,7 @@ $GNGSA,A,3,31,3
1118211246

1118311247
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.
1118411248

11185-
At present, only ec600n and ec600s series projects are supported
11249+
At present, only ec600n series projects are supported
1118611250

1118711251
##### Data storage
1118811252

@@ -11234,10 +11298,10 @@ databuf = '\x31\x32\x33\x34\x35\x36\x37\x38'
1123411298
SecureData.Store(1, databuf, 8)
1123511299
#Define an array with a length of 20 to read the stored data
1123611300
buf = bytearray(20)
11237-
#Read the data in the storage area with index 1 into buf, and store the length of the read data in the variable len
11238-
lenth = SecureData.Read(1, buf, 20)
11301+
#Read the data in the storage area with index 1 into buf, and store the length of the read data in the variable length
11302+
length = SecureData.Read(1, buf, 20)
1123911303
#Output read data
11240-
print(buf[:lenth])
11304+
print(buf[:length])
1124111305
```
1124211306

1124311307
* implementation results
@@ -11248,8 +11312,8 @@ print(buf[:lenth])
1124811312
>>> SecureData.Store(1, databuf, 8)
1124911313
0
1125011314
>>> buf = bytearray(20)
11251-
>>> lenth = SecureData.Read(1, buf, 20)
11252-
>>> print(buf[:lenth])
11315+
>>> length = SecureData.Read(1, buf, 20)
11316+
>>> print(buf[:length])
1125311317
bytearray(b'12345678')
1125411318
>>>
1125511319
```

zh-cn/api/QuecPythonClasslib.md

Lines changed: 72 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1386,6 +1386,70 @@ sim.setCallback(cb)
13861386

13871387

13881388

1389+
##### DTMF识别使能接口
1390+
1391+
> **voiceCall.dtmfDetEnable(enable)**
1392+
1393+
DTMF识别使能接口,默认不开启DTMF识别
1394+
1395+
* 参数
1396+
1397+
| 参数 | 参数类型 | 参数说明 |
1398+
| -------- | -------- | ------------------------------------------------------------ |
1399+
| enable | int | 使能开关,取值0/1,0:不开启DTMF识别,1:开启DTMF识别 |
1400+
1401+
* 返回值
1402+
1403+
设置成功返回整型0,设置失败返回整型-1
1404+
1405+
* 示例
1406+
1407+
见voiceCall.dtmfSetCb()接口示例
1408+
1409+
1410+
1411+
##### 设置DTMF识别回调接口
1412+
1413+
> **voiceCall.dtmfSetCb(cb)**
1414+
1415+
设置DTMF识别回调接口
1416+
1417+
* 参数
1418+
1419+
| 参数 | 参数类型 | 参数说明 |
1420+
| -------- | -------- | ------------------------------------------------------------ |
1421+
| cb | function | 回调函数 |
1422+
1423+
* 返回值
1424+
1425+
设置成功返回整型0,设置失败返回整型-1
1426+
1427+
* 示例
1428+
1429+
```
1430+
>>> def cb(args):
1431+
... print(args)
1432+
...
1433+
...
1434+
...
1435+
>>> voiceCall.dtmfSetCb(cb)
1436+
0
1437+
>>> voiceCall.dtmfDetEnable(1)
1438+
0
1439+
1440+
>>> voiceCall.callStart('13855169092')
1441+
1442+
0
1443+
>>>
1444+
1 //手机端按下1,callback中会收到按下的字符“1
1445+
1446+
8 //手机端按下8
1447+
1448+
9 //手机端按下9
1449+
```
1450+
1451+
1452+
13891453
##### 设置控制呼叫转移
13901454

13911455
> **voiceCall.setFw(reason, fwmode, phonenum)**
@@ -4870,7 +4934,7 @@ while 1:
48704934

48714935

48724936

4873-
###### 获取模块启动原因
4937+
###### 获取模块开机原因
48744938

48754939
> **Power. powerOnReason()**
48764940

@@ -7996,7 +8060,7 @@ True
79968060
| timeout | 整型 | 该超时时间参数是上层应用的超时,当触发超时会主动上报已扫描到的热点信息,若在超时前扫描到设置的热点个数或达到底层扫频超时时间会自动上报热点信息。<br>参数范围:<br/>600S4-255<br/>200U/600U120-5000毫秒 |
79978061
| round | 整型 | 该参数是wifi扫描轮,达到扫描轮数后,会结束扫描并获取扫描结果。<br/>参数范围:<br/>600S1-3轮次<br/>200U/600U1-10轮次 |
79988062
| max_bssid_num | 整型 | 该参数是wifi扫描热点最大个,若底层扫描热点个数达到设置的最大个数,会结束扫描并获取扫描结果。<br/>参数范围:<br/>600S4-30<br/>200U/600U1-300|
7999-
| scan_timeout | 整型 | 该参数是底层wifi扫描热点超时时间,若底层扫描热点时间达到设置的超时时间,会结束扫描并获取扫描结果。该参数设置范围为1-255秒。200U/600U 平台不支持该参数,设置时写0即可。 |
8063+
| scan_timeout | 整型 | 该参数是底层wifi扫描热点超时时间,若底层扫描热点时间达到设置的超时时间,会结束扫描并获取扫描结果。该参数设置范围为1-255秒。 |
80008064
| priority | 整型 | 该参数是wifi扫描业务优先级设置,0为ps优先,1为wifi优先。ps优先时,当有数据业务发起时会中断wifi扫描。Wifi优先时,当有数据业务发起时,不会建立RRC连接,保障wifi扫描正常执行,扫描结束后才会建立RRC连接。200U/600U 平台不支持该参数,设置时写0即可。 |
80018065

80028066
* 返回值:
@@ -11595,7 +11659,7 @@ $GNGSA,A,3,31,3
1159511659
#### SecureData - 安全数据区
1159611660

1159711661
模块功能:模组提供一块裸flash区域及专门的读写接口供客户存贮重要信息,且信息在烧录固件后不丢失(烧录不包含此功能的固件无法保证不丢失)。提供一个存储和读取接口,不提供删除接口。
11598-
目前只支持EC600NEC600S系列项目
11662+
目前只支持EC600N系列项目
1159911663

1160011664
##### 数据存储
1160111665

@@ -11647,10 +11711,10 @@ databuf = '\x31\x32\x33\x34\x35\x36\x37\x38'
1164711711
SecureData.Store(1, databuf, 8)
1164811712
# 定义一个长度为20的数组用于读取存储的数据
1164911713
buf = bytearray(20)
11650-
# 读取index为1的存储区域中的数据至buf中,将读取到数据的长度存储在变量len中
11651-
lenth = SecureData.Read(1, buf, 20)
11714+
# 读取index为1的存储区域中的数据至buf中,将读取到数据的长度存储在变量length中
11715+
length = SecureData.Read(1, buf, 20)
1165211716
# 输出读到的数据
11653-
print(buf[:lenth])
11717+
print(buf[:length])
1165411718
```
1165511719

1165611720
* 执行结果
@@ -11661,8 +11725,8 @@ print(buf[:lenth])
1166111725
>>> SecureData.Store(1, databuf, 8)
1166211726
0
1166311727
>>> buf = bytearray(20)
11664-
>>> lenth = SecureData.Read(1, buf, 20)
11665-
>>> print(buf[:lenth])
11728+
>>> length = SecureData.Read(1, buf, 20)
11729+
>>> print(buf[:length])
1166611730
bytearray(b'12345678')
1166711731
>>>
1166811732
```

0 commit comments

Comments
 (0)