Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions en-us/api/QuecPythonClasslib.md
Original file line number Diff line number Diff line change
Expand Up @@ -1284,6 +1284,16 @@ switchcard api.(just supported on the 1606 platform)

Call this API to registers the listening callback function.(just supported on the 1606 platform)

* Note

Not all switchcard failures are returned via callbacks:
1. The target card does not exist or is abnormal
2. The target card is the current card
In the preceding cases, the card switching interface directly returns -1 and does not enter the actual card switching process. Therefore, the callback is not triggered

If the card switching condition is met, the card switching interface returns 0, and the underlying task is created to perform the card switching process.
If the card switching fails or succeeds, the system returns the result through callback

* Parameter

| Parameter | Type | Description |
Expand All @@ -1297,8 +1307,8 @@ Call this API to registers the listening callback function.(just supported on th
* Example

```python
HELIOS_SIM_SWITCH_CURRSIM_PSDC_UP(switchcard succeeded)
HELIOS_SIM_SWITCH_ERROR(switchcard failed)
HELIOS_SIM_SWITCH_CURRSIM_PSDC_UP(switchcard succeeded:7
HELIOS_SIM_SWITCH_ERROR(switchcard failed: 8

typedef enum
{
Expand All @@ -1319,7 +1329,7 @@ def cb(args):
switchcard_state = args
print('sim switchcard states:{}'.format(switchcard_state))

sim.setCallback(cb)
sim.setSwitchcardCallback(cb)
```


Expand Down
23 changes: 16 additions & 7 deletions zh-cn/api/QuecPythonClasslib.md
Original file line number Diff line number Diff line change
Expand Up @@ -1255,11 +1255,11 @@ sim.setCallback(cb)



##### sim卡获取当前卡接口
##### 获取当前卡的SimId

> **sim.getCurSimid()**

sim卡获取当前卡接口。(仅1606平台支持)
获取当前卡的SimId。(仅1606平台支持)

* 参数

Expand All @@ -1280,7 +1280,7 @@ sim卡获取当前卡接口。(仅1606平台支持)



##### sim卡切卡接口
##### 切卡接口

> **sim.switchCard(simid)**

Expand Down Expand Up @@ -1309,12 +1309,21 @@ sim卡切卡接口。(仅1606平台支持)



##### SIM卡切卡注册监听回调函数
##### 注册监听SIM卡切卡状态回调函数

> **sim.setSwitchcardCallback(usrFun)**

注册监听回调函数。响应SIM卡切卡动作。(仅1606平台支持)

*注意

不是所有的切卡失败都会通过回调返回:
1、目标卡不存在或者目标卡状态异常
2、目标卡是当前卡
以上情况切卡接口直接返回-1,不会走到实际切卡的流程,也就不会触发回调

如果满足切卡条件,切卡接口返回0,底层建立task走切卡流程,这个时候切卡失败或者成功,会通过callback返回

* 参数

| 参数 | 参数类型 | 参数说明 |
Expand All @@ -1330,8 +1339,8 @@ sim卡切卡接口。(仅1606平台支持)
```python

//切卡状态枚举值,目前给到python侧的数据只有:
HELIOS_SIM_SWITCH_CURRSIM_PSDC_UP(切卡成功)
HELIOS_SIM_SWITCH_ERROR(切卡失败)
HELIOS_SIM_SWITCH_CURRSIM_PSDC_UP(切卡成功:7
HELIOS_SIM_SWITCH_ERROR(切卡失败:8

typedef enum
{
Expand All @@ -1352,7 +1361,7 @@ def cb(args):
switchcard_state = args
print('sim switchcard states:{}'.format(switchcard_state))

sim.setCallback(cb)
sim.setSwitchcardCallback(cb)
```


Expand Down