Skip to content

Commit 38cbe01

Browse files
committed
新增双卡相关接口以及单双天线配置接口
1 parent 179e2b9 commit 38cbe01

File tree

2 files changed

+273
-1
lines changed

2 files changed

+273
-1
lines changed

en-us/api/QuecPythonClasslib.md

Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1226,6 +1226,104 @@ This function obtains the SIM card hot-plugging related configuration.
12261226

12271227

12281228

1229+
##### get the current simid
1230+
1231+
> **sim.getCurSimid()**
1232+
1233+
get the current simid.(just supported on the 1606 platform)
1234+
1235+
* Parameter
1236+
1237+
* None
1238+
1239+
* Return Value
1240+
1241+
* Returns the current simid, or returns -1 if failed.
1242+
1243+
* Example
1244+
1245+
```python
1246+
>>> sim.getCurSimid() //current simid is sim0
1247+
0
1248+
```
1249+
1250+
1251+
1252+
##### switchcard api
1253+
1254+
> **sim.switchCard(simid)**
1255+
1256+
switchcard api.(just supported on the 1606 platform)
1257+
1258+
* Parameter
1259+
1260+
| Parameter | Type | Description |
1261+
| ------------ | ---- | ------------------------------------------------------------ |
1262+
| simid | int | simid, 0:sim1 1:sim2 |
1263+
1264+
* Return Value
1265+
1266+
* rerurn 0 if switchcard action is successful, else return -1;
1267+
1268+
* Example
1269+
1270+
```python
1271+
>>> sim.getCurSimid() //current simid is sim0
1272+
0
1273+
>>> sim.switchCard(1) //switchcard from sim0 to sim1
1274+
0
1275+
>>> sim.getCurSimid() //current simid is sim1
1276+
1
1277+
```
1278+
1279+
1280+
1281+
##### Register Callback Function for switchcard
1282+
1283+
> **sim.setSwitchcardCallback(usrFun)**
1284+
1285+
Call this API to registers the listening callback function.(just supported on the 1606 platform)
1286+
1287+
* Parameter
1288+
1289+
| Parameter | Type | Description |
1290+
| --------- | -------- | ---------------------------------------------------------- |
1291+
| usrFun | function | Listening callback function. See example for more details. |
1292+
1293+
* Return Value
1294+
1295+
* Returns 0 on success, -1 otherwise.
1296+
1297+
* Example
1298+
1299+
```python
1300+
HELIOS_SIM_SWITCH_CURRSIM_PSDC_UP(switchcard succeeded)
1301+
HELIOS_SIM_SWITCH_ERROR(switchcard failed)
1302+
1303+
typedef enum
1304+
{
1305+
HELIOS_SIM_SWITCH_INIT = 0,
1306+
HELIOS_SIM_SWITCH_START,
1307+
HELIOS_SIM_SWITCH_PRESIM_PDP_DOWN,
1308+
HELIOS_SIM_SWITCH_PRESIM_IMS_DOWN,
1309+
HELIOS_SIM_SWITCH_PRESIM_PSDC_DOWN,
1310+
HELIOS_SIM_SWITCH_CURRSIM_PDP_UP,
1311+
HELIOS_SIM_SWITCH_PRESIM_IMS_UP,
1312+
HELIOS_SIM_SWITCH_CURRSIM_PSDC_UP,
1313+
HELIOS_SIM_SWITCH_ERROR
1314+
}HELIOS_SIM_SWITCH_STATE;
1315+
1316+
import sim
1317+
1318+
def cb(args):
1319+
switchcard_state = args
1320+
print('sim switchcard states:{}'.format(switchcard_state))
1321+
1322+
sim.setCallback(cb)
1323+
```
1324+
1325+
1326+
12291327
#### voiceCall - Call Related
12301328

12311329
Function: Provides call related APIs.
@@ -5101,6 +5199,42 @@ USBNET.open()
51015199

51025200

51035201

5202+
##### single and dual antenna configuration and query API
5203+
5204+
> **misc.antennaSecRXOffCtrl(\*args)**
5205+
5206+
single and dual antenna configuration and query API(just supported on the 1803s platform)
5207+
5208+
* parameter
5209+
5210+
This API is a variable parameter function ,and the number of parameters is 0 or 1
5211+
The number of parameters is 0(query):misc.antennaSecRXOffCtrl()
5212+
The number of parameters is 1(set):misc.antennaSecRXOffCtrl(SecRXOff_set)
5213+
5214+
| Parameter | Type | Description |
5215+
| -------- | -------- | ----------------------------------------------------- |
5216+
| SecRXOff_set | int | range:0/1, 0:forceSecRXOffDisable 1:forceSecRXOffEnable |
5217+
5218+
* Return Value
5219+
5220+
* query: Return 0/1 if successful, otherwise return -1
5221+
5222+
* set: Return 0 if successful, otherwise return -1
5223+
5224+
* Example
5225+
5226+
```python
5227+
import misc
5228+
misc.antennaSecRXOffCtrl() //get
5229+
0
5230+
misc.antennaSecRXOffCtrl(1) //set
5231+
0
5232+
misc.antennaSecRXOffCtrl() //get
5233+
1
5234+
```
5235+
5236+
5237+
51045238
#### modem - Related Device
51055239

51065240
Function: This module gets device information.

zh-cn/api/QuecPythonClasslib.md

Lines changed: 139 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1154,7 +1154,7 @@ sim卡解锁。当多次错误输入 PIN/PIN2 码后,SIM 卡状态为请求 PU
11541154

11551155

11561156

1157-
##### 注册监听回调函数
1157+
##### 热插拔注册监听回调函数
11581158

11591159
> **sim.setCallback(usrFun)**
11601160

@@ -1255,6 +1255,108 @@ sim.setCallback(cb)
12551255

12561256

12571257

1258+
##### sim卡获取当前卡接口
1259+
1260+
> **sim.getCurSimid()**
1261+
1262+
sim卡获取当前卡接口。(仅1606平台支持)
1263+
1264+
* 参数
1265+
1266+
1267+
1268+
* 返回值
1269+
1270+
获取成功,返回当前simid(0:卡1,1:卡2)
1271+
1272+
获取失败,返回整形-1
1273+
1274+
* 示例
1275+
1276+
```python
1277+
>>> sim.getCurSimid() //获取当前卡,当前是卡1
1278+
0
1279+
```
1280+
1281+
1282+
1283+
##### sim卡切卡接口
1284+
1285+
> **sim.switchCard(simid)**
1286+
1287+
sim卡切卡接口。(仅1606平台支持)
1288+
1289+
* 参数
1290+
1291+
| 参数 | 参数类型 | 参数说明 |
1292+
| ------ | -------- | ------------------------------- |
1293+
| simid | int | 0:卡1 1:卡2 |
1294+
1295+
* 返回值
1296+
1297+
切卡动作发起成功返回整形0,切换动作发起失败返回整形-1
1298+
1299+
* 示例
1300+
1301+
```python
1302+
>>> sim.getCurSimid() //获取当前卡,当前是卡1
1303+
0
1304+
>>> sim.switchCard(1) //切到卡2
1305+
0
1306+
>>> sim.getCurSimid() //获取当前卡,成功切到卡2
1307+
1
1308+
```
1309+
1310+
1311+
1312+
##### SIM卡切卡注册监听回调函数
1313+
1314+
> **sim.setSwitchcardCallback(usrFun)**
1315+
1316+
注册监听回调函数。响应SIM卡切卡动作。(仅1606平台支持)
1317+
1318+
* 参数
1319+
1320+
| 参数 | 参数类型 | 参数说明 |
1321+
| ------ | -------- | -------------------------------------- |
1322+
| usrFun | function | 监听回调函数,回调具体形式及用法见示例 |
1323+
1324+
* 返回值
1325+
1326+
注册成功返回整型0,失败返回整型-1
1327+
1328+
* 示例
1329+
1330+
```python
1331+
1332+
//切卡状态枚举值,目前给到python侧的数据只有:
1333+
HELIOS_SIM_SWITCH_CURRSIM_PSDC_UP(切卡成功)
1334+
HELIOS_SIM_SWITCH_ERROR(切卡失败)
1335+
1336+
typedef enum
1337+
{
1338+
HELIOS_SIM_SWITCH_INIT = 0,
1339+
HELIOS_SIM_SWITCH_START,
1340+
HELIOS_SIM_SWITCH_PRESIM_PDP_DOWN,
1341+
HELIOS_SIM_SWITCH_PRESIM_IMS_DOWN,
1342+
HELIOS_SIM_SWITCH_PRESIM_PSDC_DOWN,
1343+
HELIOS_SIM_SWITCH_CURRSIM_PDP_UP,
1344+
HELIOS_SIM_SWITCH_PRESIM_IMS_UP,
1345+
HELIOS_SIM_SWITCH_CURRSIM_PSDC_UP,
1346+
HELIOS_SIM_SWITCH_ERROR
1347+
}HELIOS_SIM_SWITCH_STATE;
1348+
1349+
import sim
1350+
1351+
def cb(args):
1352+
switchcard_state = args
1353+
print('sim switchcard states:{}'.format(switchcard_state))
1354+
1355+
sim.setCallback(cb)
1356+
```
1357+
1358+
1359+
12581360
#### voiceCall - 电话功能
12591361

12601362
模块功能:该模块提供电话功能相关接口。
@@ -5642,6 +5744,42 @@ USBNET.open()
56425744

56435745

56445746

5747+
##### 单双天线配置接口
5748+
5749+
> **misc.antennaSecRXOffCtrl(\*args)**
5750+
5751+
单双天线配置、查询接口。(仅1803S平台支持该接口)
5752+
5753+
* 参数
5754+
5755+
该接口为可变参形式:
5756+
参数个数为0,表示获取单双天线配置:misc.antennaSecRXOffCtrl()
5757+
参数个数为1,表示设置单双天线:misc.antennaSecRXOffCtrl(SecRXOff_set)
5758+
5759+
| 参数 | 参数类型 | 参数说明 |
5760+
| ------ | -------- | ----------------------------------------------------- |
5761+
| SecRXOff_set | int | 范围0/1, 0:forceSecRXOffDisable 1:forceSecRXOffEnable |
5762+
5763+
* 返回值
5764+
5765+
失败返回整型值-1,成功返回整形0
5766+
5767+
* 示例
5768+
5769+
```python
5770+
import misc
5771+
5772+
misc.antennaSecRXOffCtrl()
5773+
0
5774+
misc.antennaSecRXOffCtrl(1)
5775+
0
5776+
misc.antennaSecRXOffCtrl()
5777+
1
5778+
5779+
```
5780+
5781+
5782+
56455783
#### modem - 设备相关
56465784

56475785
模块功能:设备信息获取。

0 commit comments

Comments
 (0)