diff --git a/en-us/api/QuecPythonClasslib.md b/en-us/api/QuecPythonClasslib.md index c7cdeb5..bc29a1e 100644 --- a/en-us/api/QuecPythonClasslib.md +++ b/en-us/api/QuecPythonClasslib.md @@ -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 | @@ -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 { @@ -1319,7 +1329,7 @@ def cb(args): switchcard_state = args print('sim switchcard states:{}'.format(switchcard_state)) -sim.setCallback(cb) +sim.setSwitchcardCallback(cb) ``` diff --git a/zh-cn/api/QuecPythonClasslib.md b/zh-cn/api/QuecPythonClasslib.md index 3b6d3fe..d3d1162 100644 --- a/zh-cn/api/QuecPythonClasslib.md +++ b/zh-cn/api/QuecPythonClasslib.md @@ -1255,11 +1255,11 @@ sim.setCallback(cb) -##### sim卡获取当前卡接口 +##### 获取当前卡的SimId > **sim.getCurSimid()** -sim卡获取当前卡接口。(仅1606平台支持) +获取当前卡的SimId。(仅1606平台支持) * 参数 @@ -1280,7 +1280,7 @@ sim卡获取当前卡接口。(仅1606平台支持) -##### sim卡切卡接口 +##### 切卡接口 > **sim.switchCard(simid)** @@ -1309,12 +1309,21 @@ sim卡切卡接口。(仅1606平台支持) -##### SIM卡切卡注册监听回调函数 +##### 注册监听SIM卡切卡状态回调函数 > **sim.setSwitchcardCallback(usrFun)** 注册监听回调函数。响应SIM卡切卡动作。(仅1606平台支持) +*注意 + +不是所有的切卡失败都会通过回调返回: +1、目标卡不存在或者目标卡状态异常 +2、目标卡是当前卡 +以上情况切卡接口直接返回-1,不会走到实际切卡的流程,也就不会触发回调 + +如果满足切卡条件,切卡接口返回0,底层建立task走切卡流程,这个时候切卡失败或者成功,会通过callback返回 + * 参数 | 参数 | 参数类型 | 参数说明 | @@ -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 { @@ -1352,7 +1361,7 @@ def cb(args): switchcard_state = args print('sim switchcard states:{}'.format(switchcard_state)) -sim.setCallback(cb) +sim.setSwitchcardCallback(cb) ```