1e41f4b71Sopenharmony_ci# @ohos.telephony.radio (网络搜索)(系统接口) 2e41f4b71Sopenharmony_ci 3e41f4b71Sopenharmony_ci网络搜索模块提供管理网络搜索的一些基础功能,包括获取当前接入的CS域和PS域无线接入技术、获取网络状态、获取当前选网模式、获取注册网络所在国家的ISO国家码、获取主卡所在卡槽的索引号、获取指定SIM卡槽对应的注册网络信号强度信息列表、获取运营商名称、获取设备的指定卡槽的IMEI、获取设备的指定卡槽的MEID、获取设备的指定卡槽的唯一设备ID,判断当前设备是否支持5G\(NR\)、判断主卡的Radio是否打开等。 4e41f4b71Sopenharmony_ci 5e41f4b71Sopenharmony_ci>**说明:** 6e41f4b71Sopenharmony_ci> 7e41f4b71Sopenharmony_ci>本模块首批接口从API version 6开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。 8e41f4b71Sopenharmony_ci> 当前页面仅包含本模块的系统接口,其他公开接口参见[@ohos.telephony.radio (网络搜索)](js-apis-radio.md) 9e41f4b71Sopenharmony_ci 10e41f4b71Sopenharmony_ci## 导入模块 11e41f4b71Sopenharmony_ci 12e41f4b71Sopenharmony_ci```ts 13e41f4b71Sopenharmony_ciimport { radio } from '@kit.TelephonyKit'; 14e41f4b71Sopenharmony_ci``` 15e41f4b71Sopenharmony_ci 16e41f4b71Sopenharmony_ci 17e41f4b71Sopenharmony_ci## radio.setPrimarySlotId<sup>8+</sup> 18e41f4b71Sopenharmony_ci 19e41f4b71Sopenharmony_cisetPrimarySlotId\(slotId: number, callback: AsyncCallback\<void\>\): void 20e41f4b71Sopenharmony_ci 21e41f4b71Sopenharmony_ci设置主卡所在卡槽的索引号。使用callback异步回调。 22e41f4b71Sopenharmony_ci 23e41f4b71Sopenharmony_ci**系统接口:** 此接口为系统接口。 24e41f4b71Sopenharmony_ci 25e41f4b71Sopenharmony_ci**需要权限**:ohos.permission.SET_TELEPHONY_STATE 26e41f4b71Sopenharmony_ci 27e41f4b71Sopenharmony_ci**系统能力**:SystemCapability.Telephony.CoreService 28e41f4b71Sopenharmony_ci 29e41f4b71Sopenharmony_ci**参数:** 30e41f4b71Sopenharmony_ci 31e41f4b71Sopenharmony_ci| 参数名 | 类型 | 必填 | 说明 | 32e41f4b71Sopenharmony_ci| -------- | --------------------- | ---- | -------------------------------------- | 33e41f4b71Sopenharmony_ci| slotId | number | 是 | 卡槽ID。<br/>- 0:卡槽1<br/>- 1:卡槽2 | 34e41f4b71Sopenharmony_ci| callback | AsyncCallback\<void\> | 是 | 回调函数。返回设置主卡的执行结果。 | 35e41f4b71Sopenharmony_ci 36e41f4b71Sopenharmony_ci**错误码:** 37e41f4b71Sopenharmony_ci 38e41f4b71Sopenharmony_ci以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](errorcode-telephony.md)。 39e41f4b71Sopenharmony_ci 40e41f4b71Sopenharmony_ci| 错误码ID | 错误信息 | 41e41f4b71Sopenharmony_ci| -------- | -------------------------------------------- | 42e41f4b71Sopenharmony_ci| 201 | Permission denied. | 43e41f4b71Sopenharmony_ci| 202 | Non-system applications use system APIs. | 44e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. | 45e41f4b71Sopenharmony_ci| 8300001 | Invalid parameter value. | 46e41f4b71Sopenharmony_ci| 8300002 | Service connection failed. | 47e41f4b71Sopenharmony_ci| 8300003 | System internal error. | 48e41f4b71Sopenharmony_ci| 8300004 | No SIM card found. | 49e41f4b71Sopenharmony_ci| 8300999 | Unknown error. | 50e41f4b71Sopenharmony_ci 51e41f4b71Sopenharmony_ci**示例:** 52e41f4b71Sopenharmony_ci 53e41f4b71Sopenharmony_ci```ts 54e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 55e41f4b71Sopenharmony_ci 56e41f4b71Sopenharmony_cilet slotId: number = 0; 57e41f4b71Sopenharmony_ciradio.setPrimarySlotId(slotId, (err: BusinessError) => { 58e41f4b71Sopenharmony_ci if (err) { 59e41f4b71Sopenharmony_ci console.error(`setPrimarySlotId failed, callback: err->${JSON.stringify(err)}`); 60e41f4b71Sopenharmony_ci return; 61e41f4b71Sopenharmony_ci } 62e41f4b71Sopenharmony_ci console.log(`setPrimarySlotId success.`); 63e41f4b71Sopenharmony_ci}); 64e41f4b71Sopenharmony_ci``` 65e41f4b71Sopenharmony_ci 66e41f4b71Sopenharmony_ci 67e41f4b71Sopenharmony_ci## radio.setPrimarySlotId<sup>8+</sup> 68e41f4b71Sopenharmony_ci 69e41f4b71Sopenharmony_cisetPrimarySlotId\(slotId: number\): Promise\<void\> 70e41f4b71Sopenharmony_ci 71e41f4b71Sopenharmony_ci设置主卡所在卡槽的索引号。使用Promise异步回调。 72e41f4b71Sopenharmony_ci 73e41f4b71Sopenharmony_ci**系统接口:** 此接口为系统接口。 74e41f4b71Sopenharmony_ci 75e41f4b71Sopenharmony_ci**需要权限**:ohos.permission.SET_TELEPHONY_STATE 76e41f4b71Sopenharmony_ci 77e41f4b71Sopenharmony_ci**系统能力**:SystemCapability.Telephony.CoreService 78e41f4b71Sopenharmony_ci 79e41f4b71Sopenharmony_ci**参数:** 80e41f4b71Sopenharmony_ci 81e41f4b71Sopenharmony_ci| 参数名 | 类型 | 必填 | 说明 | 82e41f4b71Sopenharmony_ci| ------ | ------ | ---- | -------------------------------------- | 83e41f4b71Sopenharmony_ci| slotId | number | 是 | 卡槽ID。<br/>- 0:卡槽1<br/>- 1:卡槽2 | 84e41f4b71Sopenharmony_ci 85e41f4b71Sopenharmony_ci**返回值:** 86e41f4b71Sopenharmony_ci 87e41f4b71Sopenharmony_ci| 类型 | 说明 | 88e41f4b71Sopenharmony_ci| --------------- | ------------------------------- | 89e41f4b71Sopenharmony_ci| Promise\<void\> | 以Promise形式异步返回设置结果。 | 90e41f4b71Sopenharmony_ci 91e41f4b71Sopenharmony_ci**错误码:** 92e41f4b71Sopenharmony_ci 93e41f4b71Sopenharmony_ci以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](errorcode-telephony.md)。 94e41f4b71Sopenharmony_ci 95e41f4b71Sopenharmony_ci| 错误码ID | 错误信息 | 96e41f4b71Sopenharmony_ci| -------- | -------------------------------------------- | 97e41f4b71Sopenharmony_ci| 201 | Permission denied. | 98e41f4b71Sopenharmony_ci| 202 | Non-system applications use system APIs. | 99e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. | 100e41f4b71Sopenharmony_ci| 8300001 | Invalid parameter value. | 101e41f4b71Sopenharmony_ci| 8300002 | Service connection failed. | 102e41f4b71Sopenharmony_ci| 8300003 | System internal error. | 103e41f4b71Sopenharmony_ci| 8300004 | No SIM card found. | 104e41f4b71Sopenharmony_ci| 8300999 | Unknown error. | 105e41f4b71Sopenharmony_ci 106e41f4b71Sopenharmony_ci**示例:** 107e41f4b71Sopenharmony_ci 108e41f4b71Sopenharmony_ci```ts 109e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 110e41f4b71Sopenharmony_ci 111e41f4b71Sopenharmony_cilet slotId: number = 0; 112e41f4b71Sopenharmony_ciradio.setPrimarySlotId(slotId).then(() => { 113e41f4b71Sopenharmony_ci console.log(`setPrimarySlotId success.`); 114e41f4b71Sopenharmony_ci}).catch((err: BusinessError) => { 115e41f4b71Sopenharmony_ci console.error(`setPrimarySlotId failed, promise: err->${JSON.stringify(err)}`); 116e41f4b71Sopenharmony_ci}); 117e41f4b71Sopenharmony_ci``` 118e41f4b71Sopenharmony_ci 119e41f4b71Sopenharmony_ci## radio.getIMEI<sup>8+</sup> 120e41f4b71Sopenharmony_ci 121e41f4b71Sopenharmony_cigetIMEI\(callback: AsyncCallback\<string\>\): void 122e41f4b71Sopenharmony_ci 123e41f4b71Sopenharmony_ci获取设备的主卡的IMEI。使用callback异步回调。 124e41f4b71Sopenharmony_ci 125e41f4b71Sopenharmony_ci**系统接口:** 此接口为系统接口。 126e41f4b71Sopenharmony_ci 127e41f4b71Sopenharmony_ci**需要权限**:ohos.permission.GET_TELEPHONY_STATE 128e41f4b71Sopenharmony_ci 129e41f4b71Sopenharmony_ci**系统能力**:SystemCapability.Telephony.CoreService 130e41f4b71Sopenharmony_ci 131e41f4b71Sopenharmony_ci**参数:** 132e41f4b71Sopenharmony_ci 133e41f4b71Sopenharmony_ci| 参数名 | 类型 | 必填 | 说明 | 134e41f4b71Sopenharmony_ci| -------- | ----------------------- | ---- | ------------------------------------------ | 135e41f4b71Sopenharmony_ci| callback | AsyncCallback\<string\> | 是 | 回调函数。返回设备主卡的IMEI。如果IMEI不存在,则返回空字符串。 | 136e41f4b71Sopenharmony_ci 137e41f4b71Sopenharmony_ci**错误码:** 138e41f4b71Sopenharmony_ci 139e41f4b71Sopenharmony_ci以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](errorcode-telephony.md)。 140e41f4b71Sopenharmony_ci 141e41f4b71Sopenharmony_ci| 错误码ID | 错误信息 | 142e41f4b71Sopenharmony_ci| -------- | -------------------------------------------- | 143e41f4b71Sopenharmony_ci| 201 | Permission denied. | 144e41f4b71Sopenharmony_ci| 202 | Non-system applications use system APIs. | 145e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. | 146e41f4b71Sopenharmony_ci| 8300001 | Invalid parameter value. | 147e41f4b71Sopenharmony_ci| 8300002 | Service connection failed. | 148e41f4b71Sopenharmony_ci| 8300003 | System internal error. | 149e41f4b71Sopenharmony_ci| 8300999 | Unknown error. | 150e41f4b71Sopenharmony_ci 151e41f4b71Sopenharmony_ci**示例:** 152e41f4b71Sopenharmony_ci 153e41f4b71Sopenharmony_ci```ts 154e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 155e41f4b71Sopenharmony_ci 156e41f4b71Sopenharmony_ciradio.getIMEI((err: BusinessError, data: string) => { 157e41f4b71Sopenharmony_ci if (err) { 158e41f4b71Sopenharmony_ci console.error(`getIMEI failed, callback: err->${JSON.stringify(err)}`); 159e41f4b71Sopenharmony_ci return; 160e41f4b71Sopenharmony_ci } 161e41f4b71Sopenharmony_ci console.log(`getIMEI success, callback: data->${JSON.stringify(data)}`); 162e41f4b71Sopenharmony_ci}); 163e41f4b71Sopenharmony_ci``` 164e41f4b71Sopenharmony_ci 165e41f4b71Sopenharmony_ci 166e41f4b71Sopenharmony_ci## radio.getIMEI<sup>8+</sup> 167e41f4b71Sopenharmony_ci 168e41f4b71Sopenharmony_cigetIMEI\(slotId: number, callback: AsyncCallback\<string\>\): void 169e41f4b71Sopenharmony_ci 170e41f4b71Sopenharmony_ci获取设备的指定卡槽的IMEI。使用callback异步回调。 171e41f4b71Sopenharmony_ci 172e41f4b71Sopenharmony_ci**系统接口:** 此接口为系统接口。 173e41f4b71Sopenharmony_ci 174e41f4b71Sopenharmony_ci**需要权限**:ohos.permission.GET_TELEPHONY_STATE 175e41f4b71Sopenharmony_ci 176e41f4b71Sopenharmony_ci**系统能力**:SystemCapability.Telephony.CoreService 177e41f4b71Sopenharmony_ci 178e41f4b71Sopenharmony_ci**参数:** 179e41f4b71Sopenharmony_ci 180e41f4b71Sopenharmony_ci| 参数名 | 类型 | 必填 | 说明 | 181e41f4b71Sopenharmony_ci| -------- | ----------------------- | ---- | ------------------------------------------ | 182e41f4b71Sopenharmony_ci| slotId | number | 是 | 卡槽ID。<br/>- 0:卡槽1<br/>- 1:卡槽2 | 183e41f4b71Sopenharmony_ci| callback | AsyncCallback\<string\> | 是 | 回调函数。返回设备指定卡槽的IMEI。如果IMEI不存在,则返回空字符串。 | 184e41f4b71Sopenharmony_ci 185e41f4b71Sopenharmony_ci**错误码:** 186e41f4b71Sopenharmony_ci 187e41f4b71Sopenharmony_ci以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](errorcode-telephony.md)。 188e41f4b71Sopenharmony_ci 189e41f4b71Sopenharmony_ci| 错误码ID | 错误信息 | 190e41f4b71Sopenharmony_ci| -------- | -------------------------------------------- | 191e41f4b71Sopenharmony_ci| 201 | Permission denied. | 192e41f4b71Sopenharmony_ci| 202 | Non-system applications use system APIs. | 193e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. | 194e41f4b71Sopenharmony_ci| 8300001 | Invalid parameter value. | 195e41f4b71Sopenharmony_ci| 8300002 | Service connection failed. | 196e41f4b71Sopenharmony_ci| 8300003 | System internal error. | 197e41f4b71Sopenharmony_ci| 8300999 | Unknown error. | 198e41f4b71Sopenharmony_ci 199e41f4b71Sopenharmony_ci**示例:** 200e41f4b71Sopenharmony_ci 201e41f4b71Sopenharmony_ci```ts 202e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 203e41f4b71Sopenharmony_ci 204e41f4b71Sopenharmony_cilet slotId: number = 0; 205e41f4b71Sopenharmony_ciradio.getIMEI(slotId, (err: BusinessError, data: string) => { 206e41f4b71Sopenharmony_ci if (err) { 207e41f4b71Sopenharmony_ci console.error(`getIMEI failed, callback: err->${JSON.stringify(err)}`); 208e41f4b71Sopenharmony_ci return; 209e41f4b71Sopenharmony_ci } 210e41f4b71Sopenharmony_ci console.log(`getIMEI success, callback: data->${JSON.stringify(data)}`); 211e41f4b71Sopenharmony_ci}); 212e41f4b71Sopenharmony_ci``` 213e41f4b71Sopenharmony_ci 214e41f4b71Sopenharmony_ci 215e41f4b71Sopenharmony_ci## radio.getIMEI<sup>8+</sup> 216e41f4b71Sopenharmony_ci 217e41f4b71Sopenharmony_cigetIMEI\(slotId?: number\): Promise\<string\> 218e41f4b71Sopenharmony_ci 219e41f4b71Sopenharmony_ci获取设备的指定卡槽的IMEI。使用Promise异步回调。 220e41f4b71Sopenharmony_ci 221e41f4b71Sopenharmony_ci**系统接口:** 此接口为系统接口。 222e41f4b71Sopenharmony_ci 223e41f4b71Sopenharmony_ci**需要权限**:ohos.permission.GET_TELEPHONY_STATE 224e41f4b71Sopenharmony_ci 225e41f4b71Sopenharmony_ci**系统能力**:SystemCapability.Telephony.CoreService 226e41f4b71Sopenharmony_ci 227e41f4b71Sopenharmony_ci**参数:** 228e41f4b71Sopenharmony_ci 229e41f4b71Sopenharmony_ci| 参数名 | 类型 | 必填 | 说明 | 230e41f4b71Sopenharmony_ci| ------ | ------ | ---- | -------------------------------------- | 231e41f4b71Sopenharmony_ci| slotId | number | 否 | 卡槽ID。<br/>- 0:卡槽1<br/>- 1:卡槽2 | 232e41f4b71Sopenharmony_ci 233e41f4b71Sopenharmony_ci**返回值:** 234e41f4b71Sopenharmony_ci 235e41f4b71Sopenharmony_ci| 类型 | 说明 | 236e41f4b71Sopenharmony_ci| ----------------- | ------------------------------------------ | 237e41f4b71Sopenharmony_ci| Promise\<string\> | 以Promise形式异步返回设备指定卡槽的IMEI。如果IMEI不存在,则返回空字符串。 | 238e41f4b71Sopenharmony_ci 239e41f4b71Sopenharmony_ci**错误码:** 240e41f4b71Sopenharmony_ci 241e41f4b71Sopenharmony_ci以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](errorcode-telephony.md)。 242e41f4b71Sopenharmony_ci 243e41f4b71Sopenharmony_ci| 错误码ID | 错误信息 | 244e41f4b71Sopenharmony_ci| -------- | -------------------------------------------- | 245e41f4b71Sopenharmony_ci| 201 | Permission denied. | 246e41f4b71Sopenharmony_ci| 202 | Non-system applications use system APIs. | 247e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. | 248e41f4b71Sopenharmony_ci| 8300001 | Invalid parameter value. | 249e41f4b71Sopenharmony_ci| 8300002 | Service connection failed. | 250e41f4b71Sopenharmony_ci| 8300003 | System internal error. | 251e41f4b71Sopenharmony_ci| 8300999 | Unknown error. | 252e41f4b71Sopenharmony_ci 253e41f4b71Sopenharmony_ci**示例:** 254e41f4b71Sopenharmony_ci 255e41f4b71Sopenharmony_ci```ts 256e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 257e41f4b71Sopenharmony_ci 258e41f4b71Sopenharmony_cilet slotId: number = 0; 259e41f4b71Sopenharmony_ciradio.getIMEI(slotId).then((data: string) => { 260e41f4b71Sopenharmony_ci console.log(`getIMEI success, promise: data->${JSON.stringify(data)}`); 261e41f4b71Sopenharmony_ci}).catch((err: BusinessError) => { 262e41f4b71Sopenharmony_ci console.error(`getIMEI failed, promise: err->${JSON.stringify(err)}`); 263e41f4b71Sopenharmony_ci}); 264e41f4b71Sopenharmony_ci``` 265e41f4b71Sopenharmony_ci 266e41f4b71Sopenharmony_ci## radio.getMEID<sup>8+</sup> 267e41f4b71Sopenharmony_ci 268e41f4b71Sopenharmony_cigetMEID\(callback: AsyncCallback\<string\>\): void 269e41f4b71Sopenharmony_ci 270e41f4b71Sopenharmony_ci获取设备的指定卡槽的MEID。使用callback异步回调。 271e41f4b71Sopenharmony_ci 272e41f4b71Sopenharmony_ci**系统接口:** 此接口为系统接口。 273e41f4b71Sopenharmony_ci 274e41f4b71Sopenharmony_ci**需要权限**:ohos.permission.GET_TELEPHONY_STATE 275e41f4b71Sopenharmony_ci 276e41f4b71Sopenharmony_ci**系统能力**:SystemCapability.Telephony.CoreService 277e41f4b71Sopenharmony_ci 278e41f4b71Sopenharmony_ci**参数:** 279e41f4b71Sopenharmony_ci 280e41f4b71Sopenharmony_ci| 参数名 | 类型 | 必填 | 说明 | 281e41f4b71Sopenharmony_ci| -------- | ----------------------- | ---- | ---------- | 282e41f4b71Sopenharmony_ci| callback | AsyncCallback\<string\> | 是 | 回调函数。返回设备的指定卡槽的MEID。如果MEID不存在,则返回空字符串。| 283e41f4b71Sopenharmony_ci 284e41f4b71Sopenharmony_ci**错误码:** 285e41f4b71Sopenharmony_ci 286e41f4b71Sopenharmony_ci以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](errorcode-telephony.md)。 287e41f4b71Sopenharmony_ci 288e41f4b71Sopenharmony_ci| 错误码ID | 错误信息 | 289e41f4b71Sopenharmony_ci| -------- | -------------------------------------------- | 290e41f4b71Sopenharmony_ci| 201 | Permission denied. | 291e41f4b71Sopenharmony_ci| 202 | Non-system applications use system APIs. | 292e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. | 293e41f4b71Sopenharmony_ci| 8300001 | Invalid parameter value. | 294e41f4b71Sopenharmony_ci| 8300002 | Service connection failed. | 295e41f4b71Sopenharmony_ci| 8300003 | System internal error. | 296e41f4b71Sopenharmony_ci| 8300999 | Unknown error. | 297e41f4b71Sopenharmony_ci 298e41f4b71Sopenharmony_ci**示例:** 299e41f4b71Sopenharmony_ci 300e41f4b71Sopenharmony_ci```ts 301e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 302e41f4b71Sopenharmony_ci 303e41f4b71Sopenharmony_ciradio.getMEID((err: BusinessError, data: string) => { 304e41f4b71Sopenharmony_ci if (err) { 305e41f4b71Sopenharmony_ci console.error(`getMEID failed, callback: err->${JSON.stringify(err)}`); 306e41f4b71Sopenharmony_ci return; 307e41f4b71Sopenharmony_ci } 308e41f4b71Sopenharmony_ci console.log(`getMEID success, callback: data->${JSON.stringify(data)}`); 309e41f4b71Sopenharmony_ci}); 310e41f4b71Sopenharmony_ci``` 311e41f4b71Sopenharmony_ci 312e41f4b71Sopenharmony_ci 313e41f4b71Sopenharmony_ci## radio.getMEID<sup>8+</sup> 314e41f4b71Sopenharmony_ci 315e41f4b71Sopenharmony_cigetMEID\(slotId: number, callback: AsyncCallback\<string\>\): void 316e41f4b71Sopenharmony_ci 317e41f4b71Sopenharmony_ci获取设备的指定卡槽的MEID。使用callback异步回调。 318e41f4b71Sopenharmony_ci 319e41f4b71Sopenharmony_ci**系统接口:** 此接口为系统接口。 320e41f4b71Sopenharmony_ci 321e41f4b71Sopenharmony_ci**需要权限**:ohos.permission.GET_TELEPHONY_STATE 322e41f4b71Sopenharmony_ci 323e41f4b71Sopenharmony_ci**系统能力**:SystemCapability.Telephony.CoreService 324e41f4b71Sopenharmony_ci 325e41f4b71Sopenharmony_ci**参数:** 326e41f4b71Sopenharmony_ci 327e41f4b71Sopenharmony_ci| 参数名 | 类型 | 必填 | 说明 | 328e41f4b71Sopenharmony_ci| -------- | ----------------------- | ---- | -------------------------------------- | 329e41f4b71Sopenharmony_ci| slotId | number | 是 | 卡槽ID。<br/>- 0:卡槽1<br/>- 1:卡槽2 | 330e41f4b71Sopenharmony_ci| callback | AsyncCallback\<string\> | 是 | 回调函数。返回设备的指定卡槽的MEID。如果MEID不存在,则返回空字符串。| 331e41f4b71Sopenharmony_ci 332e41f4b71Sopenharmony_ci**错误码:** 333e41f4b71Sopenharmony_ci 334e41f4b71Sopenharmony_ci以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](errorcode-telephony.md)。 335e41f4b71Sopenharmony_ci 336e41f4b71Sopenharmony_ci| 错误码ID | 错误信息 | 337e41f4b71Sopenharmony_ci| -------- | -------------------------------------------- | 338e41f4b71Sopenharmony_ci| 201 | Permission denied. | 339e41f4b71Sopenharmony_ci| 202 | Non-system applications use system APIs. | 340e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. | 341e41f4b71Sopenharmony_ci| 8300001 | Invalid parameter value. | 342e41f4b71Sopenharmony_ci| 8300002 | Service connection failed. | 343e41f4b71Sopenharmony_ci| 8300003 | System internal error. | 344e41f4b71Sopenharmony_ci| 8300999 | Unknown error. | 345e41f4b71Sopenharmony_ci 346e41f4b71Sopenharmony_ci**示例:** 347e41f4b71Sopenharmony_ci 348e41f4b71Sopenharmony_ci```ts 349e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 350e41f4b71Sopenharmony_ci 351e41f4b71Sopenharmony_cilet slotId: number = 0; 352e41f4b71Sopenharmony_ciradio.getMEID(slotId, (err: BusinessError, data: string) => { 353e41f4b71Sopenharmony_ci if (err) { 354e41f4b71Sopenharmony_ci console.error(`getMEID failed, callback: err->${JSON.stringify(err)}`); 355e41f4b71Sopenharmony_ci return; 356e41f4b71Sopenharmony_ci } 357e41f4b71Sopenharmony_ci console.log(`getMEID success, callback: data->${JSON.stringify(data)}`); 358e41f4b71Sopenharmony_ci}); 359e41f4b71Sopenharmony_ci``` 360e41f4b71Sopenharmony_ci 361e41f4b71Sopenharmony_ci 362e41f4b71Sopenharmony_ci## radio.getMEID<sup>8+</sup> 363e41f4b71Sopenharmony_ci 364e41f4b71Sopenharmony_cigetMEID\(slotId?: number\): Promise\<string\> 365e41f4b71Sopenharmony_ci 366e41f4b71Sopenharmony_ci获取设备的指定卡槽的MEID。使用Promise异步回调。 367e41f4b71Sopenharmony_ci 368e41f4b71Sopenharmony_ci**系统接口:** 此接口为系统接口。 369e41f4b71Sopenharmony_ci 370e41f4b71Sopenharmony_ci**需要权限**:ohos.permission.GET_TELEPHONY_STATE 371e41f4b71Sopenharmony_ci 372e41f4b71Sopenharmony_ci**系统能力**:SystemCapability.Telephony.CoreService 373e41f4b71Sopenharmony_ci 374e41f4b71Sopenharmony_ci**参数:** 375e41f4b71Sopenharmony_ci 376e41f4b71Sopenharmony_ci| 参数名 | 类型 | 必填 | 说明 | 377e41f4b71Sopenharmony_ci| ------ | ------ | ---- | -------------------------------------- | 378e41f4b71Sopenharmony_ci| slotId | number | 否 | 卡槽ID。<br/>- 0:卡槽1<br/>- 1:卡槽2 | 379e41f4b71Sopenharmony_ci 380e41f4b71Sopenharmony_ci**返回值:** 381e41f4b71Sopenharmony_ci 382e41f4b71Sopenharmony_ci| 类型 | 说明 | 383e41f4b71Sopenharmony_ci| ----------------- | --------------------------------------- | 384e41f4b71Sopenharmony_ci| Promise\<string\> | 以Promise形式返回设备的指定卡槽的MEID。如果MEID不存在,则返回空字符串。| 385e41f4b71Sopenharmony_ci 386e41f4b71Sopenharmony_ci**错误码:** 387e41f4b71Sopenharmony_ci 388e41f4b71Sopenharmony_ci以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](errorcode-telephony.md)。 389e41f4b71Sopenharmony_ci 390e41f4b71Sopenharmony_ci| 错误码ID | 错误信息 | 391e41f4b71Sopenharmony_ci| -------- | -------------------------------------------- | 392e41f4b71Sopenharmony_ci| 201 | Permission denied. | 393e41f4b71Sopenharmony_ci| 202 | Non-system applications use system APIs. | 394e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. | 395e41f4b71Sopenharmony_ci| 8300001 | Invalid parameter value. | 396e41f4b71Sopenharmony_ci| 8300002 | Service connection failed. | 397e41f4b71Sopenharmony_ci| 8300003 | System internal error. | 398e41f4b71Sopenharmony_ci| 8300999 | Unknown error. | 399e41f4b71Sopenharmony_ci 400e41f4b71Sopenharmony_ci**示例:** 401e41f4b71Sopenharmony_ci 402e41f4b71Sopenharmony_ci```ts 403e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 404e41f4b71Sopenharmony_ci 405e41f4b71Sopenharmony_cilet slotId: number = 0; 406e41f4b71Sopenharmony_ciradio.getMEID(slotId).then((data: string) => { 407e41f4b71Sopenharmony_ci console.log(`getMEID success, promise: data->${JSON.stringify(data)}`); 408e41f4b71Sopenharmony_ci}).catch((err: BusinessError) => { 409e41f4b71Sopenharmony_ci console.error(`getMEID failed, promise: err->${JSON.stringify(err)}`); 410e41f4b71Sopenharmony_ci}); 411e41f4b71Sopenharmony_ci``` 412e41f4b71Sopenharmony_ci 413e41f4b71Sopenharmony_ci## radio.getUniqueDeviceId<sup>8+</sup> 414e41f4b71Sopenharmony_ci 415e41f4b71Sopenharmony_cigetUniqueDeviceId\(callback: AsyncCallback\<string\>\): void 416e41f4b71Sopenharmony_ci 417e41f4b71Sopenharmony_ci获取设备主卡的唯一设备ID。使用callback异步回调。 418e41f4b71Sopenharmony_ci 419e41f4b71Sopenharmony_ci如果设备注册的是3GPP网络,则接口返回IMEI;如果注册的是3GPP2网络,则接口返回MEID。 420e41f4b71Sopenharmony_ci 421e41f4b71Sopenharmony_ci**系统接口:** 此接口为系统接口。 422e41f4b71Sopenharmony_ci 423e41f4b71Sopenharmony_ci**需要权限**:ohos.permission.GET_TELEPHONY_STATE 424e41f4b71Sopenharmony_ci 425e41f4b71Sopenharmony_ci**系统能力**:SystemCapability.Telephony.CoreService 426e41f4b71Sopenharmony_ci 427e41f4b71Sopenharmony_ci**参数:** 428e41f4b71Sopenharmony_ci 429e41f4b71Sopenharmony_ci| 参数名 | 类型 | 必填 | 说明 | 430e41f4b71Sopenharmony_ci| -------- | ----------------------- | ---- | ---------- | 431e41f4b71Sopenharmony_ci| callback | AsyncCallback\<string\> | 是 | 回调函数。返回设备主卡的唯一设备ID。 | 432e41f4b71Sopenharmony_ci 433e41f4b71Sopenharmony_ci**错误码:** 434e41f4b71Sopenharmony_ci 435e41f4b71Sopenharmony_ci以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](errorcode-telephony.md)。 436e41f4b71Sopenharmony_ci 437e41f4b71Sopenharmony_ci| 错误码ID | 错误信息 | 438e41f4b71Sopenharmony_ci| -------- | -------------------------------------------- | 439e41f4b71Sopenharmony_ci| 201 | Permission denied. | 440e41f4b71Sopenharmony_ci| 202 | Non-system applications use system APIs. | 441e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. | 442e41f4b71Sopenharmony_ci| 8300001 | Invalid parameter value. | 443e41f4b71Sopenharmony_ci| 8300002 | Service connection failed. | 444e41f4b71Sopenharmony_ci| 8300003 | System internal error. | 445e41f4b71Sopenharmony_ci| 8300999 | Unknown error. | 446e41f4b71Sopenharmony_ci 447e41f4b71Sopenharmony_ci**示例:** 448e41f4b71Sopenharmony_ci 449e41f4b71Sopenharmony_ci```ts 450e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 451e41f4b71Sopenharmony_ci 452e41f4b71Sopenharmony_ciradio.getUniqueDeviceId((err: BusinessError, data: string) => { 453e41f4b71Sopenharmony_ci if (err) { 454e41f4b71Sopenharmony_ci console.error(`getUniqueDeviceId failed, callback: err->${JSON.stringify(err)}}`); 455e41f4b71Sopenharmony_ci return; 456e41f4b71Sopenharmony_ci } 457e41f4b71Sopenharmony_ci console.log(`getUniqueDeviceId success, callback: data->${JSON.stringify(data)}`); 458e41f4b71Sopenharmony_ci}); 459e41f4b71Sopenharmony_ci``` 460e41f4b71Sopenharmony_ci 461e41f4b71Sopenharmony_ci 462e41f4b71Sopenharmony_ci## radio.getUniqueDeviceId<sup>8+</sup> 463e41f4b71Sopenharmony_ci 464e41f4b71Sopenharmony_cigetUniqueDeviceId\(slotId: number, callback: AsyncCallback\<string\>\): void 465e41f4b71Sopenharmony_ci 466e41f4b71Sopenharmony_ci获取设备的指定卡槽的唯一设备ID。使用callback异步回调。 467e41f4b71Sopenharmony_ci 468e41f4b71Sopenharmony_ci如果设备注册的是3GPP网络,则接口返回IMEI;如果注册的是3GPP2网络,则接口返回MEID。 469e41f4b71Sopenharmony_ci 470e41f4b71Sopenharmony_ci**系统接口:** 此接口为系统接口。 471e41f4b71Sopenharmony_ci 472e41f4b71Sopenharmony_ci**需要权限**:ohos.permission.GET_TELEPHONY_STATE 473e41f4b71Sopenharmony_ci 474e41f4b71Sopenharmony_ci**系统能力**:SystemCapability.Telephony.CoreService 475e41f4b71Sopenharmony_ci 476e41f4b71Sopenharmony_ci**参数:** 477e41f4b71Sopenharmony_ci 478e41f4b71Sopenharmony_ci| 参数名 | 类型 | 必填 | 说明 | 479e41f4b71Sopenharmony_ci| -------- | ----------------------- | ---- | -------------------------------------- | 480e41f4b71Sopenharmony_ci| slotId | number | 是 | 卡槽ID。<br/>- 0:卡槽1<br/>- 1:卡槽2 | 481e41f4b71Sopenharmony_ci| callback | AsyncCallback\<string\> | 是 | 回调函数。返回指定卡槽的唯一设备ID。 | 482e41f4b71Sopenharmony_ci 483e41f4b71Sopenharmony_ci**错误码:** 484e41f4b71Sopenharmony_ci 485e41f4b71Sopenharmony_ci以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](errorcode-telephony.md)。 486e41f4b71Sopenharmony_ci 487e41f4b71Sopenharmony_ci| 错误码ID | 错误信息 | 488e41f4b71Sopenharmony_ci| -------- | -------------------------------------------- | 489e41f4b71Sopenharmony_ci| 201 | Permission denied. | 490e41f4b71Sopenharmony_ci| 202 | Non-system applications use system APIs. | 491e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. | 492e41f4b71Sopenharmony_ci| 8300001 | Invalid parameter value. | 493e41f4b71Sopenharmony_ci| 8300002 | Service connection failed. | 494e41f4b71Sopenharmony_ci| 8300003 | System internal error. | 495e41f4b71Sopenharmony_ci| 8300999 | Unknown error. | 496e41f4b71Sopenharmony_ci 497e41f4b71Sopenharmony_ci**示例:** 498e41f4b71Sopenharmony_ci 499e41f4b71Sopenharmony_ci```ts 500e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 501e41f4b71Sopenharmony_ci 502e41f4b71Sopenharmony_cilet slotId: number = 0; 503e41f4b71Sopenharmony_ciradio.getUniqueDeviceId(slotId, (err: BusinessError, data: string) => { 504e41f4b71Sopenharmony_ci if (err) { 505e41f4b71Sopenharmony_ci console.error(`getUniqueDeviceId failed, callback: err->${JSON.stringify(err)}`); 506e41f4b71Sopenharmony_ci return; 507e41f4b71Sopenharmony_ci } 508e41f4b71Sopenharmony_ci console.log(`getUniqueDeviceId success, callback: data->${JSON.stringify(data)}`); 509e41f4b71Sopenharmony_ci}); 510e41f4b71Sopenharmony_ci``` 511e41f4b71Sopenharmony_ci 512e41f4b71Sopenharmony_ci 513e41f4b71Sopenharmony_ci## radio.getUniqueDeviceId<sup>8+</sup> 514e41f4b71Sopenharmony_ci 515e41f4b71Sopenharmony_cigetUniqueDeviceId\(slotId?: number\): Promise\<string\> 516e41f4b71Sopenharmony_ci 517e41f4b71Sopenharmony_ci获取设备的指定卡槽的唯一设备ID。使用Promise异步回调。 518e41f4b71Sopenharmony_ci 519e41f4b71Sopenharmony_ci如果设备注册的是3GPP网络,则接口返回IMEI;如果注册的是3GPP2网络,则接口返回MEID。 520e41f4b71Sopenharmony_ci 521e41f4b71Sopenharmony_ci**系统接口:** 此接口为系统接口。 522e41f4b71Sopenharmony_ci 523e41f4b71Sopenharmony_ci**需要权限**:ohos.permission.GET_TELEPHONY_STATE 524e41f4b71Sopenharmony_ci 525e41f4b71Sopenharmony_ci**系统能力**:SystemCapability.Telephony.CoreService 526e41f4b71Sopenharmony_ci 527e41f4b71Sopenharmony_ci**参数:** 528e41f4b71Sopenharmony_ci 529e41f4b71Sopenharmony_ci| 参数名 | 类型 | 必填 | 说明 | 530e41f4b71Sopenharmony_ci| ------ | ------ | ---- | -------------------------------------- | 531e41f4b71Sopenharmony_ci| slotId | number | 否 | 卡槽ID。<br/>- 0:卡槽1<br/>- 1:卡槽2 | 532e41f4b71Sopenharmony_ci 533e41f4b71Sopenharmony_ci**返回值:** 534e41f4b71Sopenharmony_ci 535e41f4b71Sopenharmony_ci| 类型 | 说明 | 536e41f4b71Sopenharmony_ci| ----------------- | --------------------------------------------- | 537e41f4b71Sopenharmony_ci| Promise\<string\> | 以Promise形式返回设备的指定卡槽的唯一设备ID。 | 538e41f4b71Sopenharmony_ci 539e41f4b71Sopenharmony_ci**错误码:** 540e41f4b71Sopenharmony_ci 541e41f4b71Sopenharmony_ci以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](errorcode-telephony.md)。 542e41f4b71Sopenharmony_ci 543e41f4b71Sopenharmony_ci| 错误码ID | 错误信息 | 544e41f4b71Sopenharmony_ci| -------- | -------------------------------------------- | 545e41f4b71Sopenharmony_ci| 201 | Permission denied. | 546e41f4b71Sopenharmony_ci| 202 | Non-system applications use system APIs. | 547e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. | 548e41f4b71Sopenharmony_ci| 8300001 | Invalid parameter value. | 549e41f4b71Sopenharmony_ci| 8300002 | Service connection failed. | 550e41f4b71Sopenharmony_ci| 8300003 | System internal error. | 551e41f4b71Sopenharmony_ci| 8300999 | Unknown error. | 552e41f4b71Sopenharmony_ci 553e41f4b71Sopenharmony_ci**示例:** 554e41f4b71Sopenharmony_ci 555e41f4b71Sopenharmony_ci```ts 556e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 557e41f4b71Sopenharmony_ci 558e41f4b71Sopenharmony_cilet slotId: number = 0; 559e41f4b71Sopenharmony_ciradio.getUniqueDeviceId(slotId).then((data: string) => { 560e41f4b71Sopenharmony_ci console.log(`getUniqueDeviceId success, promise: data->${JSON.stringify(data)}`); 561e41f4b71Sopenharmony_ci}).catch((err: BusinessError) => { 562e41f4b71Sopenharmony_ci console.error(`getUniqueDeviceId failed, promise: err->${JSON.stringify(err)}`); 563e41f4b71Sopenharmony_ci}); 564e41f4b71Sopenharmony_ci``` 565e41f4b71Sopenharmony_ci 566e41f4b71Sopenharmony_ci## radio.sendUpdateCellLocationRequest<sup>8+</sup> 567e41f4b71Sopenharmony_ci 568e41f4b71Sopenharmony_cisendUpdateCellLocationRequest\(callback: AsyncCallback\<void\>\): void 569e41f4b71Sopenharmony_ci 570e41f4b71Sopenharmony_ci发送更新小区位置请求。使用callback异步回调。 571e41f4b71Sopenharmony_ci 572e41f4b71Sopenharmony_ci**系统接口:** 此接口为系统接口。 573e41f4b71Sopenharmony_ci 574e41f4b71Sopenharmony_ci**需要权限**:ohos.permission.LOCATION 和 ohos.permission.APPROXIMATELY_LOCATION 575e41f4b71Sopenharmony_ci 576e41f4b71Sopenharmony_ci**系统能力**:SystemCapability.Telephony.CoreService 577e41f4b71Sopenharmony_ci 578e41f4b71Sopenharmony_ci**参数:** 579e41f4b71Sopenharmony_ci 580e41f4b71Sopenharmony_ci| 参数名 | 类型 | 必填 | 说明 | 581e41f4b71Sopenharmony_ci| -------- | --------------------- | ---- | ---------- | 582e41f4b71Sopenharmony_ci| callback | AsyncCallback\<void\> | 是 | 回调函数。返回更新小区位置请求的结果。 | 583e41f4b71Sopenharmony_ci 584e41f4b71Sopenharmony_ci**错误码:** 585e41f4b71Sopenharmony_ci 586e41f4b71Sopenharmony_ci以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](errorcode-telephony.md)。 587e41f4b71Sopenharmony_ci 588e41f4b71Sopenharmony_ci| 错误码ID | 错误信息 | 589e41f4b71Sopenharmony_ci| -------- | -------------------------------------------- | 590e41f4b71Sopenharmony_ci| 201 | Permission denied. | 591e41f4b71Sopenharmony_ci| 202 | Non-system applications use system APIs. | 592e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. | 593e41f4b71Sopenharmony_ci| 8300001 | Invalid parameter value. | 594e41f4b71Sopenharmony_ci| 8300002 | Service connection failed. | 595e41f4b71Sopenharmony_ci| 8300003 | System internal error. | 596e41f4b71Sopenharmony_ci| 8300999 | Unknown error. | 597e41f4b71Sopenharmony_ci 598e41f4b71Sopenharmony_ci**示例:** 599e41f4b71Sopenharmony_ci 600e41f4b71Sopenharmony_ci```ts 601e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 602e41f4b71Sopenharmony_ci 603e41f4b71Sopenharmony_ciradio.sendUpdateCellLocationRequest((err: BusinessError) => { 604e41f4b71Sopenharmony_ci if (err) { 605e41f4b71Sopenharmony_ci console.error(`sendUpdateCellLocationRequest failed, callback: err->${JSON.stringify(err)}`); 606e41f4b71Sopenharmony_ci return; 607e41f4b71Sopenharmony_ci } 608e41f4b71Sopenharmony_ci console.log(`sendUpdateCellLocationRequest success.`); 609e41f4b71Sopenharmony_ci}); 610e41f4b71Sopenharmony_ci``` 611e41f4b71Sopenharmony_ci 612e41f4b71Sopenharmony_ci## radio.sendUpdateCellLocationRequest<sup>8+</sup> 613e41f4b71Sopenharmony_ci 614e41f4b71Sopenharmony_cisendUpdateCellLocationRequest\(slotId: number, callback: AsyncCallback\<void\>\): void 615e41f4b71Sopenharmony_ci 616e41f4b71Sopenharmony_ci发送更新小区位置请求。使用callback异步回调。 617e41f4b71Sopenharmony_ci 618e41f4b71Sopenharmony_ci**系统接口:** 此接口为系统接口。 619e41f4b71Sopenharmony_ci 620e41f4b71Sopenharmony_ci**需要权限**:ohos.permission.LOCATION 和 ohos.permission.APPROXIMATELY_LOCATION 621e41f4b71Sopenharmony_ci 622e41f4b71Sopenharmony_ci**系统能力**:SystemCapability.Telephony.CoreService 623e41f4b71Sopenharmony_ci 624e41f4b71Sopenharmony_ci**参数:** 625e41f4b71Sopenharmony_ci 626e41f4b71Sopenharmony_ci| 参数名 | 类型 | 必填 | 说明 | 627e41f4b71Sopenharmony_ci| -------- | --------------------- | ---- | ---------- | 628e41f4b71Sopenharmony_ci| slotId | number | 是 | 卡槽ID。<br/>- 0:卡槽1<br/>- 1:卡槽2 | 629e41f4b71Sopenharmony_ci| callback | AsyncCallback\<void\> | 是 | 回调函数。返回更新小区位置请求的结果。 | 630e41f4b71Sopenharmony_ci 631e41f4b71Sopenharmony_ci**错误码:** 632e41f4b71Sopenharmony_ci 633e41f4b71Sopenharmony_ci以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](errorcode-telephony.md)。 634e41f4b71Sopenharmony_ci 635e41f4b71Sopenharmony_ci| 错误码ID | 错误信息 | 636e41f4b71Sopenharmony_ci| -------- | -------------------------------------------- | 637e41f4b71Sopenharmony_ci| 201 | Permission denied. | 638e41f4b71Sopenharmony_ci| 202 | Non-system applications use system APIs. | 639e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. | 640e41f4b71Sopenharmony_ci| 8300001 | Invalid parameter value. | 641e41f4b71Sopenharmony_ci| 8300002 | Service connection failed. | 642e41f4b71Sopenharmony_ci| 8300003 | System internal error. | 643e41f4b71Sopenharmony_ci| 8300999 | Unknown error. | 644e41f4b71Sopenharmony_ci 645e41f4b71Sopenharmony_ci**示例:** 646e41f4b71Sopenharmony_ci 647e41f4b71Sopenharmony_ci```ts 648e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 649e41f4b71Sopenharmony_ci 650e41f4b71Sopenharmony_cilet slotId: number = 0; 651e41f4b71Sopenharmony_ciradio.sendUpdateCellLocationRequest(slotId, (err: BusinessError) => { 652e41f4b71Sopenharmony_ci if (err) { 653e41f4b71Sopenharmony_ci console.error(`sendUpdateCellLocationRequest failed, callback: err->${JSON.stringify(err)}`); 654e41f4b71Sopenharmony_ci return; 655e41f4b71Sopenharmony_ci } 656e41f4b71Sopenharmony_ci console.log(`sendUpdateCellLocationRequest success.`); 657e41f4b71Sopenharmony_ci}); 658e41f4b71Sopenharmony_ci``` 659e41f4b71Sopenharmony_ci 660e41f4b71Sopenharmony_ci## radio.sendUpdateCellLocationRequest<sup>8+</sup> 661e41f4b71Sopenharmony_ci 662e41f4b71Sopenharmony_cisendUpdateCellLocationRequest\(slotId?: number\): Promise\<void\> 663e41f4b71Sopenharmony_ci 664e41f4b71Sopenharmony_ci发送更新小区位置请求。使用Promise异步回调。 665e41f4b71Sopenharmony_ci 666e41f4b71Sopenharmony_ci**系统接口:** 此接口为系统接口。 667e41f4b71Sopenharmony_ci 668e41f4b71Sopenharmony_ci**需要权限**:ohos.permission.LOCATION 和 ohos.permission.APPROXIMATELY_LOCATION 669e41f4b71Sopenharmony_ci 670e41f4b71Sopenharmony_ci**系统能力**:SystemCapability.Telephony.CoreService 671e41f4b71Sopenharmony_ci 672e41f4b71Sopenharmony_ci**参数:** 673e41f4b71Sopenharmony_ci 674e41f4b71Sopenharmony_ci| 参数名 | 类型 | 必填 | 说明 | 675e41f4b71Sopenharmony_ci| ------ | ------ | ---- | -------------------------------------- | 676e41f4b71Sopenharmony_ci| slotId | number | 否 | 卡槽ID。<br/>- 0:卡槽1<br/>- 1:卡槽2 | 677e41f4b71Sopenharmony_ci 678e41f4b71Sopenharmony_ci**返回值:** 679e41f4b71Sopenharmony_ci 680e41f4b71Sopenharmony_ci| 类型 | 说明 | 681e41f4b71Sopenharmony_ci| --------------- | ----------------------- | 682e41f4b71Sopenharmony_ci| Promise\<void\> | 以Promise形式返回更新小区位置请求的结果。 | 683e41f4b71Sopenharmony_ci 684e41f4b71Sopenharmony_ci**错误码:** 685e41f4b71Sopenharmony_ci 686e41f4b71Sopenharmony_ci以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](errorcode-telephony.md)。 687e41f4b71Sopenharmony_ci 688e41f4b71Sopenharmony_ci| 错误码ID | 错误信息 | 689e41f4b71Sopenharmony_ci| -------- | -------------------------------------------- | 690e41f4b71Sopenharmony_ci| 201 | Permission denied. | 691e41f4b71Sopenharmony_ci| 202 | Non-system applications use system APIs. | 692e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. | 693e41f4b71Sopenharmony_ci| 8300001 | Invalid parameter value. | 694e41f4b71Sopenharmony_ci| 8300002 | Service connection failed. | 695e41f4b71Sopenharmony_ci| 8300003 | System internal error. | 696e41f4b71Sopenharmony_ci| 8300999 | Unknown error. | 697e41f4b71Sopenharmony_ci 698e41f4b71Sopenharmony_ci**示例:** 699e41f4b71Sopenharmony_ci 700e41f4b71Sopenharmony_ci```ts 701e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 702e41f4b71Sopenharmony_ci 703e41f4b71Sopenharmony_cilet slotId: number = 0; 704e41f4b71Sopenharmony_ciradio.sendUpdateCellLocationRequest(slotId).then(() => { 705e41f4b71Sopenharmony_ci console.log(`sendUpdateCellLocationRequest success.`); 706e41f4b71Sopenharmony_ci}).catch((err: BusinessError) => { 707e41f4b71Sopenharmony_ci console.error(`sendUpdateCellLocationRequest failed, promise: err->${JSON.stringify(err)}`); 708e41f4b71Sopenharmony_ci}); 709e41f4b71Sopenharmony_ci``` 710e41f4b71Sopenharmony_ci 711e41f4b71Sopenharmony_ci## radio.getCellInformation<sup>8+</sup> 712e41f4b71Sopenharmony_ci 713e41f4b71Sopenharmony_cigetCellInformation\(callback: AsyncCallback\<Array\<CellInformation\>\>\): void 714e41f4b71Sopenharmony_ci 715e41f4b71Sopenharmony_ci获取小区信息。使用callback异步回调。 716e41f4b71Sopenharmony_ci 717e41f4b71Sopenharmony_ci**系统接口:** 此接口为系统接口。 718e41f4b71Sopenharmony_ci 719e41f4b71Sopenharmony_ci**需要权限**:ohos.permission.LOCATION 和 ohos.permission.APPROXIMATELY_LOCATION 720e41f4b71Sopenharmony_ci 721e41f4b71Sopenharmony_ci**系统能力**:SystemCapability.Telephony.CoreService 722e41f4b71Sopenharmony_ci 723e41f4b71Sopenharmony_ci**参数:** 724e41f4b71Sopenharmony_ci 725e41f4b71Sopenharmony_ci| 参数名 | 类型 | 必填 | 说明 | 726e41f4b71Sopenharmony_ci| -------- | ------------------------------------------------------------ | ---- | ------------------------ | 727e41f4b71Sopenharmony_ci| callback | AsyncCallback\<Array<[CellInformation](#cellinformation8)\>\> | 是 | 回调函数。返回小区信息。 | 728e41f4b71Sopenharmony_ci 729e41f4b71Sopenharmony_ci**错误码:** 730e41f4b71Sopenharmony_ci 731e41f4b71Sopenharmony_ci以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](errorcode-telephony.md)。 732e41f4b71Sopenharmony_ci 733e41f4b71Sopenharmony_ci| 错误码ID | 错误信息 | 734e41f4b71Sopenharmony_ci| -------- | -------------------------------------------- | 735e41f4b71Sopenharmony_ci| 201 | Permission denied. | 736e41f4b71Sopenharmony_ci| 202 | Non-system applications use system APIs. | 737e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. | 738e41f4b71Sopenharmony_ci| 8300001 | Invalid parameter value. | 739e41f4b71Sopenharmony_ci| 8300002 | Service connection failed. | 740e41f4b71Sopenharmony_ci| 8300003 | System internal error. | 741e41f4b71Sopenharmony_ci| 8300999 | Unknown error. | 742e41f4b71Sopenharmony_ci 743e41f4b71Sopenharmony_ci**示例:** 744e41f4b71Sopenharmony_ci 745e41f4b71Sopenharmony_ci```ts 746e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 747e41f4b71Sopenharmony_ci 748e41f4b71Sopenharmony_ciradio.getCellInformation((err: BusinessError, data: Array<radio.CellInformation>) => { 749e41f4b71Sopenharmony_ci if (err) { 750e41f4b71Sopenharmony_ci console.error(`getCellInformation failed, callback: err->${JSON.stringify(err)}`); 751e41f4b71Sopenharmony_ci return; 752e41f4b71Sopenharmony_ci } 753e41f4b71Sopenharmony_ci console.log(`getCellInformation success, callback: data->${JSON.stringify(data)}`); 754e41f4b71Sopenharmony_ci}); 755e41f4b71Sopenharmony_ci``` 756e41f4b71Sopenharmony_ci 757e41f4b71Sopenharmony_ci 758e41f4b71Sopenharmony_ci## radio.getCellInformation<sup>8+</sup> 759e41f4b71Sopenharmony_ci 760e41f4b71Sopenharmony_cigetCellInformation\(slotId: number, callback: AsyncCallback\<Array\<CellInformation\>\>\): void 761e41f4b71Sopenharmony_ci 762e41f4b71Sopenharmony_ci获取小区信息。使用callback异步回调。 763e41f4b71Sopenharmony_ci 764e41f4b71Sopenharmony_ci**系统接口:** 此接口为系统接口。 765e41f4b71Sopenharmony_ci 766e41f4b71Sopenharmony_ci**需要权限**:ohos.permission.LOCATION 和 ohos.permission.APPROXIMATELY_LOCATION 767e41f4b71Sopenharmony_ci 768e41f4b71Sopenharmony_ci**系统能力**:SystemCapability.Telephony.CoreService 769e41f4b71Sopenharmony_ci 770e41f4b71Sopenharmony_ci**参数:** 771e41f4b71Sopenharmony_ci 772e41f4b71Sopenharmony_ci| 参数名 | 类型 | 必填 | 说明 | 773e41f4b71Sopenharmony_ci| -------- | ------------------------------------------------------------ | ---- | -------------------------------------- | 774e41f4b71Sopenharmony_ci| slotId | number | 是 | 卡槽ID。<br/>- 0:卡槽1<br/>- 1:卡槽2 | 775e41f4b71Sopenharmony_ci| callback | AsyncCallback\<Array<[CellInformation](#cellinformation8)\>\> | 是 | 回调函数。返回小区信息。 | 776e41f4b71Sopenharmony_ci 777e41f4b71Sopenharmony_ci**错误码:** 778e41f4b71Sopenharmony_ci 779e41f4b71Sopenharmony_ci以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](errorcode-telephony.md)。 780e41f4b71Sopenharmony_ci 781e41f4b71Sopenharmony_ci| 错误码ID | 错误信息 | 782e41f4b71Sopenharmony_ci| -------- | -------------------------------------------- | 783e41f4b71Sopenharmony_ci| 201 | Permission denied. | 784e41f4b71Sopenharmony_ci| 202 | Non-system applications use system APIs. | 785e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. | 786e41f4b71Sopenharmony_ci| 8300001 | Invalid parameter value. | 787e41f4b71Sopenharmony_ci| 8300002 | Service connection failed. | 788e41f4b71Sopenharmony_ci| 8300003 | System internal error. | 789e41f4b71Sopenharmony_ci| 8300999 | Unknown error. | 790e41f4b71Sopenharmony_ci 791e41f4b71Sopenharmony_ci**示例:** 792e41f4b71Sopenharmony_ci 793e41f4b71Sopenharmony_ci```ts 794e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 795e41f4b71Sopenharmony_ci 796e41f4b71Sopenharmony_cilet slotId: number = 0; 797e41f4b71Sopenharmony_ciradio.getCellInformation(slotId, (err: BusinessError, data: Array<radio.CellInformation>) => { 798e41f4b71Sopenharmony_ci if (err) { 799e41f4b71Sopenharmony_ci console.error(`getCellInformation failed, callback: err->${JSON.stringify(err)}`); 800e41f4b71Sopenharmony_ci return; 801e41f4b71Sopenharmony_ci } 802e41f4b71Sopenharmony_ci console.log(`getCellInformation success, callback: data->${JSON.stringify(data)}`); 803e41f4b71Sopenharmony_ci}); 804e41f4b71Sopenharmony_ci``` 805e41f4b71Sopenharmony_ci 806e41f4b71Sopenharmony_ci 807e41f4b71Sopenharmony_ci## radio.getCellInformation<sup>8+</sup> 808e41f4b71Sopenharmony_ci 809e41f4b71Sopenharmony_cigetCellInformation\(slotId?: number\): Promise\<Array\<CellInformation\>\> 810e41f4b71Sopenharmony_ci 811e41f4b71Sopenharmony_ci获取小区信息。使用Promise异步回调。 812e41f4b71Sopenharmony_ci 813e41f4b71Sopenharmony_ci**系统接口:** 此接口为系统接口。 814e41f4b71Sopenharmony_ci 815e41f4b71Sopenharmony_ci**需要权限**:ohos.permission.LOCATION 和 ohos.permission.APPROXIMATELY_LOCATION 816e41f4b71Sopenharmony_ci 817e41f4b71Sopenharmony_ci**系统能力**:SystemCapability.Telephony.CoreService 818e41f4b71Sopenharmony_ci 819e41f4b71Sopenharmony_ci**参数:** 820e41f4b71Sopenharmony_ci 821e41f4b71Sopenharmony_ci| 参数名 | 类型 | 必填 | 说明 | 822e41f4b71Sopenharmony_ci| ------ | ------ | ---- | -------------------------------------- | 823e41f4b71Sopenharmony_ci| slotId | number | 否 | 卡槽ID。<br/>- 0:卡槽1<br/>- 1:卡槽2 | 824e41f4b71Sopenharmony_ci 825e41f4b71Sopenharmony_ci**返回值:** 826e41f4b71Sopenharmony_ci 827e41f4b71Sopenharmony_ci| 类型 | 说明 | 828e41f4b71Sopenharmony_ci| ------------------------------------------------------- | ----------------------- | 829e41f4b71Sopenharmony_ci| Promise\<Array<[CellInformation](#cellinformation8)\>\> | 以Promise形式返回小区信息结果。 | 830e41f4b71Sopenharmony_ci 831e41f4b71Sopenharmony_ci**错误码:** 832e41f4b71Sopenharmony_ci 833e41f4b71Sopenharmony_ci以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](errorcode-telephony.md)。 834e41f4b71Sopenharmony_ci 835e41f4b71Sopenharmony_ci| 错误码ID | 错误信息 | 836e41f4b71Sopenharmony_ci| -------- | -------------------------------------------- | 837e41f4b71Sopenharmony_ci| 201 | Permission denied. | 838e41f4b71Sopenharmony_ci| 202 | Non-system applications use system APIs. | 839e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. | 840e41f4b71Sopenharmony_ci| 8300001 | Invalid parameter value. | 841e41f4b71Sopenharmony_ci| 8300002 | Service connection failed. | 842e41f4b71Sopenharmony_ci| 8300003 | System internal error. | 843e41f4b71Sopenharmony_ci| 8300999 | Unknown error. | 844e41f4b71Sopenharmony_ci 845e41f4b71Sopenharmony_ci**示例:** 846e41f4b71Sopenharmony_ci 847e41f4b71Sopenharmony_ci```ts 848e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 849e41f4b71Sopenharmony_ci 850e41f4b71Sopenharmony_cilet slotId: number = 0; 851e41f4b71Sopenharmony_ciradio.getCellInformation(slotId).then((data: Array<radio.CellInformation>) => { 852e41f4b71Sopenharmony_ci console.log(`getCellInformation success, promise: data->${JSON.stringify(data)}`); 853e41f4b71Sopenharmony_ci}).catch((err: BusinessError) => { 854e41f4b71Sopenharmony_ci console.error(`getCellInformation failed, promise: err->${JSON.stringify(err)}`); 855e41f4b71Sopenharmony_ci}); 856e41f4b71Sopenharmony_ci``` 857e41f4b71Sopenharmony_ci 858e41f4b71Sopenharmony_ci## radio.setNetworkSelectionMode 859e41f4b71Sopenharmony_ci 860e41f4b71Sopenharmony_cisetNetworkSelectionMode\(options: NetworkSelectionModeOptions, callback: AsyncCallback\<void\>\): void 861e41f4b71Sopenharmony_ci 862e41f4b71Sopenharmony_ci设置网络选择模式。使用callback异步回调。 863e41f4b71Sopenharmony_ci 864e41f4b71Sopenharmony_ci**系统接口:** 此接口为系统接口。 865e41f4b71Sopenharmony_ci 866e41f4b71Sopenharmony_ci**需要权限**:ohos.permission.SET_TELEPHONY_STATE 867e41f4b71Sopenharmony_ci 868e41f4b71Sopenharmony_ci**系统能力**:SystemCapability.Telephony.CoreService 869e41f4b71Sopenharmony_ci 870e41f4b71Sopenharmony_ci**参数:** 871e41f4b71Sopenharmony_ci 872e41f4b71Sopenharmony_ci| 参数名 | 类型 | 必填 | 说明 | 873e41f4b71Sopenharmony_ci| -------- | ----------------------------------------------------------- | ---- | ------------------ | 874e41f4b71Sopenharmony_ci| options | [NetworkSelectionModeOptions](#networkselectionmodeoptions) | 是 | 网络选择模式选项。 | 875e41f4b71Sopenharmony_ci| callback | AsyncCallback\<void\> | 是 | 回调函数。返回设置网络选择模式的结果。 | 876e41f4b71Sopenharmony_ci 877e41f4b71Sopenharmony_ci**错误码:** 878e41f4b71Sopenharmony_ci 879e41f4b71Sopenharmony_ci以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](errorcode-telephony.md)。 880e41f4b71Sopenharmony_ci 881e41f4b71Sopenharmony_ci| 错误码ID | 错误信息 | 882e41f4b71Sopenharmony_ci| -------- | -------------------------------------------- | 883e41f4b71Sopenharmony_ci| 201 | Permission denied. | 884e41f4b71Sopenharmony_ci| 202 | Non-system applications use system APIs. | 885e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. | 886e41f4b71Sopenharmony_ci| 8300001 | Invalid parameter value. | 887e41f4b71Sopenharmony_ci| 8300002 | Service connection failed. | 888e41f4b71Sopenharmony_ci| 8300003 | System internal error. | 889e41f4b71Sopenharmony_ci| 8300999 | Unknown error. | 890e41f4b71Sopenharmony_ci 891e41f4b71Sopenharmony_ci**示例:** 892e41f4b71Sopenharmony_ci 893e41f4b71Sopenharmony_ci```ts 894e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 895e41f4b71Sopenharmony_ci 896e41f4b71Sopenharmony_cilet networkInformation: radio.NetworkInformation = { 897e41f4b71Sopenharmony_ci operatorName: "中国移动", 898e41f4b71Sopenharmony_ci operatorNumeric: "898600", 899e41f4b71Sopenharmony_ci state: radio.NetworkInformationState.NETWORK_AVAILABLE, 900e41f4b71Sopenharmony_ci radioTech: "CS" 901e41f4b71Sopenharmony_ci} 902e41f4b71Sopenharmony_cilet networkSelectionModeOptions: radio.NetworkSelectionModeOptions = { 903e41f4b71Sopenharmony_ci slotId: 0, 904e41f4b71Sopenharmony_ci selectMode: radio.NetworkSelectionMode.NETWORK_SELECTION_AUTOMATIC, 905e41f4b71Sopenharmony_ci networkInformation: networkInformation, 906e41f4b71Sopenharmony_ci resumeSelection: true 907e41f4b71Sopenharmony_ci} 908e41f4b71Sopenharmony_ciradio.setNetworkSelectionMode(networkSelectionModeOptions, (err: BusinessError) => { 909e41f4b71Sopenharmony_ci if (err) { 910e41f4b71Sopenharmony_ci console.error(`setNetworkSelectionMode failed, callback: err->${JSON.stringify(err)}`); 911e41f4b71Sopenharmony_ci return; 912e41f4b71Sopenharmony_ci } 913e41f4b71Sopenharmony_ci console.log(`setNetworkSelectionMode success.`); 914e41f4b71Sopenharmony_ci}); 915e41f4b71Sopenharmony_ci``` 916e41f4b71Sopenharmony_ci 917e41f4b71Sopenharmony_ci## radio.setNetworkSelectionMode 918e41f4b71Sopenharmony_ci 919e41f4b71Sopenharmony_cisetNetworkSelectionMode\(options: NetworkSelectionModeOptions\): Promise\<void\> 920e41f4b71Sopenharmony_ci 921e41f4b71Sopenharmony_ci设置网络选择模式。使用Promise异步回调。 922e41f4b71Sopenharmony_ci 923e41f4b71Sopenharmony_ci**系统接口:** 此接口为系统接口。 924e41f4b71Sopenharmony_ci 925e41f4b71Sopenharmony_ci**需要权限**:ohos.permission.SET_TELEPHONY_STATE 926e41f4b71Sopenharmony_ci 927e41f4b71Sopenharmony_ci**系统能力**:SystemCapability.Telephony.CoreService 928e41f4b71Sopenharmony_ci 929e41f4b71Sopenharmony_ci**参数:** 930e41f4b71Sopenharmony_ci 931e41f4b71Sopenharmony_ci| 参数名 | 类型 | 必填 | 说明 | 932e41f4b71Sopenharmony_ci| ------- | ----------------------------------------------------------- | ---- | ------------------ | 933e41f4b71Sopenharmony_ci| options | [NetworkSelectionModeOptions](#networkselectionmodeoptions) | 是 | 网络选择模式选项。 | 934e41f4b71Sopenharmony_ci 935e41f4b71Sopenharmony_ci**返回值:** 936e41f4b71Sopenharmony_ci 937e41f4b71Sopenharmony_ci| 类型 | 说明 | 938e41f4b71Sopenharmony_ci| --------------- | ----------------------- | 939e41f4b71Sopenharmony_ci| Promise\<void\> | 以Promise形式返回设置网络选择模式的结果。 | 940e41f4b71Sopenharmony_ci 941e41f4b71Sopenharmony_ci**错误码:** 942e41f4b71Sopenharmony_ci 943e41f4b71Sopenharmony_ci以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](errorcode-telephony.md)。 944e41f4b71Sopenharmony_ci 945e41f4b71Sopenharmony_ci| 错误码ID | 错误信息 | 946e41f4b71Sopenharmony_ci| -------- | -------------------------------------------- | 947e41f4b71Sopenharmony_ci| 201 | Permission denied. | 948e41f4b71Sopenharmony_ci| 202 | Non-system applications use system APIs. | 949e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. | 950e41f4b71Sopenharmony_ci| 8300001 | Invalid parameter value. | 951e41f4b71Sopenharmony_ci| 8300002 | Service connection failed. | 952e41f4b71Sopenharmony_ci| 8300003 | System internal error. | 953e41f4b71Sopenharmony_ci| 8300999 | Unknown error. | 954e41f4b71Sopenharmony_ci 955e41f4b71Sopenharmony_ci**示例:** 956e41f4b71Sopenharmony_ci 957e41f4b71Sopenharmony_ci```ts 958e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 959e41f4b71Sopenharmony_ci 960e41f4b71Sopenharmony_cilet networkInformation: radio.NetworkInformation = { 961e41f4b71Sopenharmony_ci operatorName: "中国移动", 962e41f4b71Sopenharmony_ci operatorNumeric: "898600", 963e41f4b71Sopenharmony_ci state: radio.NetworkInformationState.NETWORK_AVAILABLE, 964e41f4b71Sopenharmony_ci radioTech: "CS" 965e41f4b71Sopenharmony_ci} 966e41f4b71Sopenharmony_cilet networkSelectionModeOptions: radio.NetworkSelectionModeOptions = { 967e41f4b71Sopenharmony_ci slotId: 0, 968e41f4b71Sopenharmony_ci selectMode: radio.NetworkSelectionMode.NETWORK_SELECTION_AUTOMATIC, 969e41f4b71Sopenharmony_ci networkInformation: networkInformation, 970e41f4b71Sopenharmony_ci resumeSelection: true 971e41f4b71Sopenharmony_ci} 972e41f4b71Sopenharmony_ciradio.setNetworkSelectionMode(networkSelectionModeOptions).then(() => { 973e41f4b71Sopenharmony_ci console.log(`setNetworkSelectionMode success.`); 974e41f4b71Sopenharmony_ci}).catch((err: BusinessError) => { 975e41f4b71Sopenharmony_ci console.error(`setNetworkSelectionMode failed, promise: err->${JSON.stringify(err)}`); 976e41f4b71Sopenharmony_ci}); 977e41f4b71Sopenharmony_ci``` 978e41f4b71Sopenharmony_ci 979e41f4b71Sopenharmony_ci## radio.getNetworkSearchInformation 980e41f4b71Sopenharmony_ci 981e41f4b71Sopenharmony_cigetNetworkSearchInformation\(slotId: number, callback: AsyncCallback\<NetworkSearchResult\>\): void 982e41f4b71Sopenharmony_ci 983e41f4b71Sopenharmony_ci获取网络搜索信息。使用callback异步回调。 984e41f4b71Sopenharmony_ci 985e41f4b71Sopenharmony_ci**系统接口:** 此接口为系统接口。 986e41f4b71Sopenharmony_ci 987e41f4b71Sopenharmony_ci**需要权限**:ohos.permission.GET_TELEPHONY_STATE 988e41f4b71Sopenharmony_ci 989e41f4b71Sopenharmony_ci**系统能力**:SystemCapability.Telephony.CoreService 990e41f4b71Sopenharmony_ci 991e41f4b71Sopenharmony_ci**参数:** 992e41f4b71Sopenharmony_ci 993e41f4b71Sopenharmony_ci| 参数名 | 类型 | 必填 | 说明 | 994e41f4b71Sopenharmony_ci| -------- | ------------------------------------------------------------ | ---- | -------------------------------------- | 995e41f4b71Sopenharmony_ci| slotId | number | 是 | 卡槽ID。<br/>- 0:卡槽1<br/>- 1:卡槽2 | 996e41f4b71Sopenharmony_ci| callback | AsyncCallback\<[NetworkSearchResult](#networksearchresult)\> | 是 | 回调函数。返回网络搜索信息。 | 997e41f4b71Sopenharmony_ci 998e41f4b71Sopenharmony_ci**错误码:** 999e41f4b71Sopenharmony_ci 1000e41f4b71Sopenharmony_ci以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](errorcode-telephony.md)。 1001e41f4b71Sopenharmony_ci 1002e41f4b71Sopenharmony_ci| 错误码ID | 错误信息 | 1003e41f4b71Sopenharmony_ci| -------- | -------------------------------------------- | 1004e41f4b71Sopenharmony_ci| 201 | Permission denied. | 1005e41f4b71Sopenharmony_ci| 202 | Non-system applications use system APIs. | 1006e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. | 1007e41f4b71Sopenharmony_ci| 8300001 | Invalid parameter value. | 1008e41f4b71Sopenharmony_ci| 8300002 | Service connection failed. | 1009e41f4b71Sopenharmony_ci| 8300003 | System internal error. | 1010e41f4b71Sopenharmony_ci| 8300999 | Unknown error. | 1011e41f4b71Sopenharmony_ci 1012e41f4b71Sopenharmony_ci**示例:** 1013e41f4b71Sopenharmony_ci 1014e41f4b71Sopenharmony_ci```ts 1015e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 1016e41f4b71Sopenharmony_ci 1017e41f4b71Sopenharmony_ciradio.getNetworkSearchInformation(0, (err: BusinessError, data: radio.NetworkSearchResult) => { 1018e41f4b71Sopenharmony_ci if (err) { 1019e41f4b71Sopenharmony_ci console.error(`getNetworkSearchInformation failed, callback: err->${JSON.stringify(err)}`); 1020e41f4b71Sopenharmony_ci return; 1021e41f4b71Sopenharmony_ci } 1022e41f4b71Sopenharmony_ci console.log(`getNetworkSearchInformation success, callback: data->${JSON.stringify(data)}`); 1023e41f4b71Sopenharmony_ci}); 1024e41f4b71Sopenharmony_ci``` 1025e41f4b71Sopenharmony_ci 1026e41f4b71Sopenharmony_ci## radio.getNetworkSearchInformation 1027e41f4b71Sopenharmony_ci 1028e41f4b71Sopenharmony_cigetNetworkSearchInformation\(slotId: number\): Promise\<NetworkSearchResult\> 1029e41f4b71Sopenharmony_ci 1030e41f4b71Sopenharmony_ci获取网络搜索信息。使用Promise异步回调。 1031e41f4b71Sopenharmony_ci 1032e41f4b71Sopenharmony_ci**系统接口:** 此接口为系统接口。 1033e41f4b71Sopenharmony_ci 1034e41f4b71Sopenharmony_ci**需要权限**:ohos.permission.GET_TELEPHONY_STATE 1035e41f4b71Sopenharmony_ci 1036e41f4b71Sopenharmony_ci**系统能力**:SystemCapability.Telephony.CoreService 1037e41f4b71Sopenharmony_ci 1038e41f4b71Sopenharmony_ci**参数:** 1039e41f4b71Sopenharmony_ci 1040e41f4b71Sopenharmony_ci| 参数名 | 类型 | 必填 | 说明 | 1041e41f4b71Sopenharmony_ci| ------ | ------ | ---- | -------------------------------------- | 1042e41f4b71Sopenharmony_ci| slotId | number | 是 | 卡槽ID。<br/>- 0:卡槽1<br/>- 1:卡槽2 | 1043e41f4b71Sopenharmony_ci 1044e41f4b71Sopenharmony_ci**返回值:** 1045e41f4b71Sopenharmony_ci 1046e41f4b71Sopenharmony_ci| 类型 | 说明 | 1047e41f4b71Sopenharmony_ci| ------------------------------------------------------ | ----------------------- | 1048e41f4b71Sopenharmony_ci| Promise\<[NetworkSearchResult](#networksearchresult)\> | 以Promise形式返回网络搜索信息。 | 1049e41f4b71Sopenharmony_ci 1050e41f4b71Sopenharmony_ci**错误码:** 1051e41f4b71Sopenharmony_ci 1052e41f4b71Sopenharmony_ci以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](errorcode-telephony.md)。 1053e41f4b71Sopenharmony_ci 1054e41f4b71Sopenharmony_ci| 错误码ID | 错误信息 | 1055e41f4b71Sopenharmony_ci| -------- | -------------------------------------------- | 1056e41f4b71Sopenharmony_ci| 201 | Permission denied. | 1057e41f4b71Sopenharmony_ci| 202 | Non-system applications use system APIs. | 1058e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. | 1059e41f4b71Sopenharmony_ci| 8300001 | Invalid parameter value. | 1060e41f4b71Sopenharmony_ci| 8300002 | Service connection failed. | 1061e41f4b71Sopenharmony_ci| 8300003 | System internal error. | 1062e41f4b71Sopenharmony_ci| 8300999 | Unknown error. | 1063e41f4b71Sopenharmony_ci 1064e41f4b71Sopenharmony_ci**示例:** 1065e41f4b71Sopenharmony_ci 1066e41f4b71Sopenharmony_ci```ts 1067e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 1068e41f4b71Sopenharmony_ci 1069e41f4b71Sopenharmony_ciradio.getNetworkSearchInformation(0).then((data: radio.NetworkSearchResult) => { 1070e41f4b71Sopenharmony_ci console.log(`getNetworkSearchInformation success, promise: data->${JSON.stringify(data)}`); 1071e41f4b71Sopenharmony_ci}).catch((err: BusinessError) => { 1072e41f4b71Sopenharmony_ci console.error(`getNetworkSearchInformation failed, promise: err->${JSON.stringify(err)}`); 1073e41f4b71Sopenharmony_ci}); 1074e41f4b71Sopenharmony_ci``` 1075e41f4b71Sopenharmony_ci 1076e41f4b71Sopenharmony_ci## radio.getNrOptionMode<sup>(deprecated)</sup> 1077e41f4b71Sopenharmony_ci 1078e41f4b71Sopenharmony_cigetNrOptionMode\(callback: AsyncCallback\<NrOptionMode\>\): void 1079e41f4b71Sopenharmony_ci 1080e41f4b71Sopenharmony_ci获取Nr选项模式。使用callback异步回调。 1081e41f4b71Sopenharmony_ci 1082e41f4b71Sopenharmony_ci> **说明:** 1083e41f4b71Sopenharmony_ci> 1084e41f4b71Sopenharmony_ci> 从 API version 8开始支持,从API version 10开始废弃。建议使用[getNROptionMode](#radiogetnroptionmode10)替代。 1085e41f4b71Sopenharmony_ci 1086e41f4b71Sopenharmony_ci**系统接口:** 此接口为系统接口。 1087e41f4b71Sopenharmony_ci 1088e41f4b71Sopenharmony_ci**系统能力**:SystemCapability.Telephony.CoreService 1089e41f4b71Sopenharmony_ci 1090e41f4b71Sopenharmony_ci**参数:** 1091e41f4b71Sopenharmony_ci 1092e41f4b71Sopenharmony_ci| 参数名 | 类型 | 必填 | 说明 | 1093e41f4b71Sopenharmony_ci| -------- | ----------------------------------------------- | ---- | ---------- | 1094e41f4b71Sopenharmony_ci| callback | AsyncCallback\<[NrOptionMode](#nroptionmodedeprecated)\> | 是 | 回调函数。返回Nr选项模式。 | 1095e41f4b71Sopenharmony_ci 1096e41f4b71Sopenharmony_ci**错误码:** 1097e41f4b71Sopenharmony_ci 1098e41f4b71Sopenharmony_ci以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](errorcode-telephony.md)。 1099e41f4b71Sopenharmony_ci 1100e41f4b71Sopenharmony_ci| 错误码ID | 错误信息 | 1101e41f4b71Sopenharmony_ci| -------- | -------------------------------------------- | 1102e41f4b71Sopenharmony_ci| 202 | Non-system applications use system APIs. | 1103e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. | 1104e41f4b71Sopenharmony_ci| 8300001 | Invalid parameter value. | 1105e41f4b71Sopenharmony_ci| 8300002 | Service connection failed. | 1106e41f4b71Sopenharmony_ci| 8300003 | System internal error. | 1107e41f4b71Sopenharmony_ci| 8300999 | Unknown error. | 1108e41f4b71Sopenharmony_ci 1109e41f4b71Sopenharmony_ci**示例:** 1110e41f4b71Sopenharmony_ci 1111e41f4b71Sopenharmony_ci```ts 1112e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 1113e41f4b71Sopenharmony_ci 1114e41f4b71Sopenharmony_ciradio.getNrOptionMode((err: BusinessError, data: radio.NrOptionMode) => { 1115e41f4b71Sopenharmony_ci if (err) { 1116e41f4b71Sopenharmony_ci console.error(`getNrOptionMode failed, callback: err->${JSON.stringify(err)}`); 1117e41f4b71Sopenharmony_ci return; 1118e41f4b71Sopenharmony_ci } 1119e41f4b71Sopenharmony_ci console.log(`getNrOptionMode success, callback: data->${JSON.stringify(data)}`); 1120e41f4b71Sopenharmony_ci}); 1121e41f4b71Sopenharmony_ci``` 1122e41f4b71Sopenharmony_ci 1123e41f4b71Sopenharmony_ci 1124e41f4b71Sopenharmony_ci## radio.getNrOptionMode<sup>(deprecated)</sup> 1125e41f4b71Sopenharmony_ci 1126e41f4b71Sopenharmony_cigetNrOptionMode\(slotId: number, callback: AsyncCallback\<NrOptionMode\>\): void 1127e41f4b71Sopenharmony_ci 1128e41f4b71Sopenharmony_ci获取Nr选项模式 。使用callback异步回调。 1129e41f4b71Sopenharmony_ci 1130e41f4b71Sopenharmony_ci> **说明:** 1131e41f4b71Sopenharmony_ci> 1132e41f4b71Sopenharmony_ci> 从 API version 8开始支持,从API version 10开始废弃。建议使用[getNROptionMode](#radiogetnroptionmode10)替代。 1133e41f4b71Sopenharmony_ci 1134e41f4b71Sopenharmony_ci**系统接口:** 此接口为系统接口。 1135e41f4b71Sopenharmony_ci 1136e41f4b71Sopenharmony_ci**系统能力**:SystemCapability.Telephony.CoreService 1137e41f4b71Sopenharmony_ci 1138e41f4b71Sopenharmony_ci**参数:** 1139e41f4b71Sopenharmony_ci 1140e41f4b71Sopenharmony_ci| 参数名 | 类型 | 必填 | 说明 | 1141e41f4b71Sopenharmony_ci| -------- | ----------------------------------------------- | ---- | ------------------------------------- | 1142e41f4b71Sopenharmony_ci| slotId | number | 是 | 卡槽ID。<br/>- 0:卡槽1<br/>- 1:卡槽2 | 1143e41f4b71Sopenharmony_ci| callback | AsyncCallback\<[NrOptionMode](#nroptionmodedeprecated)\> | 是 | 回调函数。返回Nr选项模式。 | 1144e41f4b71Sopenharmony_ci 1145e41f4b71Sopenharmony_ci**错误码:** 1146e41f4b71Sopenharmony_ci 1147e41f4b71Sopenharmony_ci以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](errorcode-telephony.md)。 1148e41f4b71Sopenharmony_ci 1149e41f4b71Sopenharmony_ci| 错误码ID | 错误信息 | 1150e41f4b71Sopenharmony_ci| -------- | -------------------------------------------- | 1151e41f4b71Sopenharmony_ci| 202 | Non-system applications use system APIs. | 1152e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. | 1153e41f4b71Sopenharmony_ci| 8300001 | Invalid parameter value. | 1154e41f4b71Sopenharmony_ci| 8300002 | Service connection failed. | 1155e41f4b71Sopenharmony_ci| 8300003 | System internal error. | 1156e41f4b71Sopenharmony_ci| 8300999 | Unknown error. | 1157e41f4b71Sopenharmony_ci 1158e41f4b71Sopenharmony_ci**示例:** 1159e41f4b71Sopenharmony_ci 1160e41f4b71Sopenharmony_ci```ts 1161e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 1162e41f4b71Sopenharmony_ci 1163e41f4b71Sopenharmony_cilet slotId: number = 0; 1164e41f4b71Sopenharmony_ciradio.getNrOptionMode(slotId, (err: BusinessError, data: radio.NrOptionMode) => { 1165e41f4b71Sopenharmony_ci if (err) { 1166e41f4b71Sopenharmony_ci console.error(`getNrOptionModecallback failed, callback: err->${JSON.stringify(err)}`); 1167e41f4b71Sopenharmony_ci return; 1168e41f4b71Sopenharmony_ci } 1169e41f4b71Sopenharmony_ci console.log(`getNrOptionModecallback success, callback: data->${JSON.stringify(data)}`); 1170e41f4b71Sopenharmony_ci}); 1171e41f4b71Sopenharmony_ci``` 1172e41f4b71Sopenharmony_ci 1173e41f4b71Sopenharmony_ci 1174e41f4b71Sopenharmony_ci## radio.getNrOptionMode<sup>(deprecated)</sup> 1175e41f4b71Sopenharmony_ci 1176e41f4b71Sopenharmony_cigetNrOptionMode\(slotId?: number\): Promise\<NrOptionMode\> 1177e41f4b71Sopenharmony_ci 1178e41f4b71Sopenharmony_ci获取Nr选项模式 。使用Promise异步回调。 1179e41f4b71Sopenharmony_ci 1180e41f4b71Sopenharmony_ci> **说明:** 1181e41f4b71Sopenharmony_ci> 1182e41f4b71Sopenharmony_ci> 从 API version 8开始支持,从API version 10开始废弃。建议使用[getNROptionMode](#radiogetnroptionmode10-1)替代。 1183e41f4b71Sopenharmony_ci 1184e41f4b71Sopenharmony_ci**系统接口:** 此接口为系统接口。 1185e41f4b71Sopenharmony_ci 1186e41f4b71Sopenharmony_ci**系统能力**:SystemCapability.Telephony.CoreService 1187e41f4b71Sopenharmony_ci 1188e41f4b71Sopenharmony_ci**参数:** 1189e41f4b71Sopenharmony_ci 1190e41f4b71Sopenharmony_ci| 参数名 | 类型 | 必填 | 说明 | 1191e41f4b71Sopenharmony_ci| ------ | ------ | ---- | -------------------------------------- | 1192e41f4b71Sopenharmony_ci| slotId | number | 否 | 卡槽ID。<br/>- 0:卡槽1<br/>- 1:卡槽2 | 1193e41f4b71Sopenharmony_ci 1194e41f4b71Sopenharmony_ci**返回值:** 1195e41f4b71Sopenharmony_ci 1196e41f4b71Sopenharmony_ci| 类型 | 说明 | 1197e41f4b71Sopenharmony_ci| -------------------------------------------------- | ----------------------- | 1198e41f4b71Sopenharmony_ci| Promise\<[NrOptionMode](#nroptionmodedeprecated)\> | 以Promise形式返回Nr选项模式。 | 1199e41f4b71Sopenharmony_ci 1200e41f4b71Sopenharmony_ci**错误码:** 1201e41f4b71Sopenharmony_ci 1202e41f4b71Sopenharmony_ci以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](errorcode-telephony.md)。 1203e41f4b71Sopenharmony_ci 1204e41f4b71Sopenharmony_ci| 错误码ID | 错误信息 | 1205e41f4b71Sopenharmony_ci| -------- | -------------------------------------------- | 1206e41f4b71Sopenharmony_ci| 202 | Non-system applications use system APIs. | 1207e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. | 1208e41f4b71Sopenharmony_ci| 8300001 | Invalid parameter value. | 1209e41f4b71Sopenharmony_ci| 8300002 | Service connection failed. | 1210e41f4b71Sopenharmony_ci| 8300003 | System internal error. | 1211e41f4b71Sopenharmony_ci| 8300999 | Unknown error. | 1212e41f4b71Sopenharmony_ci 1213e41f4b71Sopenharmony_ci**示例:** 1214e41f4b71Sopenharmony_ci 1215e41f4b71Sopenharmony_ci```ts 1216e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 1217e41f4b71Sopenharmony_ci 1218e41f4b71Sopenharmony_cilet slotId: number = 0; 1219e41f4b71Sopenharmony_ciradio.getNrOptionMode(slotId).then((data: radio.NrOptionMode) => { 1220e41f4b71Sopenharmony_ci console.log(`getNrOptionMode success, promise: data->${JSON.stringify(data)}`); 1221e41f4b71Sopenharmony_ci}).catch((err: BusinessError) => { 1222e41f4b71Sopenharmony_ci console.error(`getNrOptionMode failed, promise: err->${JSON.stringify(err)}`); 1223e41f4b71Sopenharmony_ci}); 1224e41f4b71Sopenharmony_ci``` 1225e41f4b71Sopenharmony_ci 1226e41f4b71Sopenharmony_ci## radio.turnOnRadio<sup>7+</sup> 1227e41f4b71Sopenharmony_ci 1228e41f4b71Sopenharmony_citurnOnRadio\(callback: AsyncCallback\<void\>\): void 1229e41f4b71Sopenharmony_ci 1230e41f4b71Sopenharmony_ci打开Radio。使用callback异步回调。 1231e41f4b71Sopenharmony_ci 1232e41f4b71Sopenharmony_ci**系统接口:** 此接口为系统接口。 1233e41f4b71Sopenharmony_ci 1234e41f4b71Sopenharmony_ci**需要权限**:ohos.permission.SET_TELEPHONY_STATE 1235e41f4b71Sopenharmony_ci 1236e41f4b71Sopenharmony_ci**系统能力**:SystemCapability.Telephony.CoreService 1237e41f4b71Sopenharmony_ci 1238e41f4b71Sopenharmony_ci**参数:** 1239e41f4b71Sopenharmony_ci 1240e41f4b71Sopenharmony_ci| 参数名 | 类型 | 必填 | 说明 | 1241e41f4b71Sopenharmony_ci| -------- | --------------------- | ---- | ---------- | 1242e41f4b71Sopenharmony_ci| callback | AsyncCallback\<void\> | 是 | 回调函数。返回打开Radio的操作结果。 | 1243e41f4b71Sopenharmony_ci 1244e41f4b71Sopenharmony_ci**错误码:** 1245e41f4b71Sopenharmony_ci 1246e41f4b71Sopenharmony_ci以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](errorcode-telephony.md)。 1247e41f4b71Sopenharmony_ci 1248e41f4b71Sopenharmony_ci| 错误码ID | 错误信息 | 1249e41f4b71Sopenharmony_ci| -------- | -------------------------------------------- | 1250e41f4b71Sopenharmony_ci| 201 | Permission denied. | 1251e41f4b71Sopenharmony_ci| 202 | Non-system applications use system APIs. | 1252e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. | 1253e41f4b71Sopenharmony_ci| 8300001 | Invalid parameter value. | 1254e41f4b71Sopenharmony_ci| 8300002 | Service connection failed. | 1255e41f4b71Sopenharmony_ci| 8300003 | System internal error. | 1256e41f4b71Sopenharmony_ci| 8300999 | Unknown error. | 1257e41f4b71Sopenharmony_ci 1258e41f4b71Sopenharmony_ci**示例:** 1259e41f4b71Sopenharmony_ci 1260e41f4b71Sopenharmony_ci```ts 1261e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 1262e41f4b71Sopenharmony_ci 1263e41f4b71Sopenharmony_ciradio.turnOnRadio((err: BusinessError) => { 1264e41f4b71Sopenharmony_ci if (err) { 1265e41f4b71Sopenharmony_ci console.error(`turnOnRadio failed, callback: err->${JSON.stringify(err)}`); 1266e41f4b71Sopenharmony_ci return; 1267e41f4b71Sopenharmony_ci } 1268e41f4b71Sopenharmony_ci console.log(`turnOnRadio success.`); 1269e41f4b71Sopenharmony_ci}); 1270e41f4b71Sopenharmony_ci``` 1271e41f4b71Sopenharmony_ci 1272e41f4b71Sopenharmony_ci 1273e41f4b71Sopenharmony_ci## radio.turnOnRadio<sup>7+</sup> 1274e41f4b71Sopenharmony_ci 1275e41f4b71Sopenharmony_citurnOnRadio\(slotId: number, callback: AsyncCallback\<void\>\): void 1276e41f4b71Sopenharmony_ci 1277e41f4b71Sopenharmony_ci打开指定卡槽的Radio。使用callback异步回调。 1278e41f4b71Sopenharmony_ci 1279e41f4b71Sopenharmony_ci**系统接口:** 此接口为系统接口。 1280e41f4b71Sopenharmony_ci 1281e41f4b71Sopenharmony_ci**需要权限**:ohos.permission.SET_TELEPHONY_STATE 1282e41f4b71Sopenharmony_ci 1283e41f4b71Sopenharmony_ci**系统能力**:SystemCapability.Telephony.CoreService 1284e41f4b71Sopenharmony_ci 1285e41f4b71Sopenharmony_ci**参数:** 1286e41f4b71Sopenharmony_ci 1287e41f4b71Sopenharmony_ci| 参数名 | 类型 | 必填 | 说明 | 1288e41f4b71Sopenharmony_ci| -------- | --------------------- | ---- | -------------------------------------- | 1289e41f4b71Sopenharmony_ci| slotId | number | 是 | 卡槽ID。<br/>- 0:卡槽1<br/>- 1:卡槽2 | 1290e41f4b71Sopenharmony_ci| callback | AsyncCallback\<void\> | 是 | 回调函数。返回打开指定卡槽的Radio的操作结果。 | 1291e41f4b71Sopenharmony_ci 1292e41f4b71Sopenharmony_ci**错误码:** 1293e41f4b71Sopenharmony_ci 1294e41f4b71Sopenharmony_ci以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](errorcode-telephony.md)。 1295e41f4b71Sopenharmony_ci 1296e41f4b71Sopenharmony_ci| 错误码ID | 错误信息 | 1297e41f4b71Sopenharmony_ci| -------- | -------------------------------------------- | 1298e41f4b71Sopenharmony_ci| 201 | Permission denied. | 1299e41f4b71Sopenharmony_ci| 202 | Non-system applications use system APIs. | 1300e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. | 1301e41f4b71Sopenharmony_ci| 8300001 | Invalid parameter value. | 1302e41f4b71Sopenharmony_ci| 8300002 | Service connection failed. | 1303e41f4b71Sopenharmony_ci| 8300003 | System internal error. | 1304e41f4b71Sopenharmony_ci| 8300999 | Unknown error. | 1305e41f4b71Sopenharmony_ci 1306e41f4b71Sopenharmony_ci**示例:** 1307e41f4b71Sopenharmony_ci 1308e41f4b71Sopenharmony_ci```ts 1309e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 1310e41f4b71Sopenharmony_ci 1311e41f4b71Sopenharmony_cilet slotId: number = 0; 1312e41f4b71Sopenharmony_ciradio.turnOnRadio(slotId, (err: BusinessError) => { 1313e41f4b71Sopenharmony_ci if (err) { 1314e41f4b71Sopenharmony_ci console.error(`turnOnRadio failed, callback: err->${JSON.stringify(err)}`); 1315e41f4b71Sopenharmony_ci return; 1316e41f4b71Sopenharmony_ci } 1317e41f4b71Sopenharmony_ci console.log(`turnOnRadio success.`); 1318e41f4b71Sopenharmony_ci}); 1319e41f4b71Sopenharmony_ci``` 1320e41f4b71Sopenharmony_ci 1321e41f4b71Sopenharmony_ci 1322e41f4b71Sopenharmony_ci## radio.turnOnRadio<sup>7+</sup> 1323e41f4b71Sopenharmony_ci 1324e41f4b71Sopenharmony_citurnOnRadio(slotId?: number): Promise\<void\> 1325e41f4b71Sopenharmony_ci 1326e41f4b71Sopenharmony_ci打开Radio。使用Promise异步回调。 1327e41f4b71Sopenharmony_ci 1328e41f4b71Sopenharmony_ci**系统接口:** 此接口为系统接口。 1329e41f4b71Sopenharmony_ci 1330e41f4b71Sopenharmony_ci**需要权限**:ohos.permission.SET_TELEPHONY_STATE 1331e41f4b71Sopenharmony_ci 1332e41f4b71Sopenharmony_ci**系统能力**:SystemCapability.Telephony.CoreService 1333e41f4b71Sopenharmony_ci 1334e41f4b71Sopenharmony_ci**参数:** 1335e41f4b71Sopenharmony_ci 1336e41f4b71Sopenharmony_ci| 参数名 | 类型 | 必填 | 说明 | 1337e41f4b71Sopenharmony_ci| ------ | ------ | ---- | -------------------------------------- | 1338e41f4b71Sopenharmony_ci| slotId | number | 否 | 卡槽ID。<br/>- 0:卡槽1<br/>- 1:卡槽2 | 1339e41f4b71Sopenharmony_ci 1340e41f4b71Sopenharmony_ci**返回值:** 1341e41f4b71Sopenharmony_ci 1342e41f4b71Sopenharmony_ci| 类型 | 说明 | 1343e41f4b71Sopenharmony_ci| --------------- | ----------------------- | 1344e41f4b71Sopenharmony_ci| Promise\<void\> | 以Promise形式返回打开Radio的操作结果。 | 1345e41f4b71Sopenharmony_ci 1346e41f4b71Sopenharmony_ci**错误码:** 1347e41f4b71Sopenharmony_ci 1348e41f4b71Sopenharmony_ci以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](errorcode-telephony.md)。 1349e41f4b71Sopenharmony_ci 1350e41f4b71Sopenharmony_ci| 错误码ID | 错误信息 | 1351e41f4b71Sopenharmony_ci| -------- | -------------------------------------------- | 1352e41f4b71Sopenharmony_ci| 201 | Permission denied. | 1353e41f4b71Sopenharmony_ci| 202 | Non-system applications use system APIs. | 1354e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. | 1355e41f4b71Sopenharmony_ci| 8300001 | Invalid parameter value. | 1356e41f4b71Sopenharmony_ci| 8300002 | Service connection failed. | 1357e41f4b71Sopenharmony_ci| 8300003 | System internal error. | 1358e41f4b71Sopenharmony_ci| 8300999 | Unknown error. | 1359e41f4b71Sopenharmony_ci 1360e41f4b71Sopenharmony_ci**示例:** 1361e41f4b71Sopenharmony_ci 1362e41f4b71Sopenharmony_ci```ts 1363e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 1364e41f4b71Sopenharmony_ci 1365e41f4b71Sopenharmony_cilet slotId: number = 0; 1366e41f4b71Sopenharmony_ciradio.turnOnRadio(slotId).then(() => { 1367e41f4b71Sopenharmony_ci console.log(`turnOnRadio success.`); 1368e41f4b71Sopenharmony_ci}).catch((err: BusinessError) => { 1369e41f4b71Sopenharmony_ci console.error(`turnOnRadio failed, promise: err->${JSON.stringify(err)}`); 1370e41f4b71Sopenharmony_ci}); 1371e41f4b71Sopenharmony_ci``` 1372e41f4b71Sopenharmony_ci 1373e41f4b71Sopenharmony_ci## radio.turnOffRadio<sup>7+</sup> 1374e41f4b71Sopenharmony_ci 1375e41f4b71Sopenharmony_citurnOffRadio\(callback: AsyncCallback\<void\>\): void 1376e41f4b71Sopenharmony_ci 1377e41f4b71Sopenharmony_ci关闭Radio。使用callback异步回调。 1378e41f4b71Sopenharmony_ci 1379e41f4b71Sopenharmony_ci**系统接口:** 此接口为系统接口。 1380e41f4b71Sopenharmony_ci 1381e41f4b71Sopenharmony_ci**需要权限**:ohos.permission.SET_TELEPHONY_STATE 1382e41f4b71Sopenharmony_ci 1383e41f4b71Sopenharmony_ci**系统能力**:SystemCapability.Telephony.CoreService 1384e41f4b71Sopenharmony_ci 1385e41f4b71Sopenharmony_ci**参数:** 1386e41f4b71Sopenharmony_ci 1387e41f4b71Sopenharmony_ci| 参数名 | 类型 | 必填 | 说明 | 1388e41f4b71Sopenharmony_ci| -------- | --------------------- | ---- | ---------- | 1389e41f4b71Sopenharmony_ci| callback | AsyncCallback\<void\> | 是 | 回调函数。返回关闭Radio的操作结果。 | 1390e41f4b71Sopenharmony_ci 1391e41f4b71Sopenharmony_ci**错误码:** 1392e41f4b71Sopenharmony_ci 1393e41f4b71Sopenharmony_ci以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](errorcode-telephony.md)。 1394e41f4b71Sopenharmony_ci 1395e41f4b71Sopenharmony_ci| 错误码ID | 错误信息 | 1396e41f4b71Sopenharmony_ci| -------- | -------------------------------------------- | 1397e41f4b71Sopenharmony_ci| 201 | Permission denied. | 1398e41f4b71Sopenharmony_ci| 202 | Non-system applications use system APIs. | 1399e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. | 1400e41f4b71Sopenharmony_ci| 8300001 | Invalid parameter value. | 1401e41f4b71Sopenharmony_ci| 8300002 | Service connection failed. | 1402e41f4b71Sopenharmony_ci| 8300003 | System internal error. | 1403e41f4b71Sopenharmony_ci| 8300999 | Unknown error. | 1404e41f4b71Sopenharmony_ci 1405e41f4b71Sopenharmony_ci**示例:** 1406e41f4b71Sopenharmony_ci 1407e41f4b71Sopenharmony_ci```ts 1408e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 1409e41f4b71Sopenharmony_ci 1410e41f4b71Sopenharmony_ciradio.turnOffRadio((err: BusinessError) => { 1411e41f4b71Sopenharmony_ci if (err) { 1412e41f4b71Sopenharmony_ci console.error(`turnOffRadio failed, callback: err->${JSON.stringify(err)}`); 1413e41f4b71Sopenharmony_ci return; 1414e41f4b71Sopenharmony_ci } 1415e41f4b71Sopenharmony_ci console.log(`turnOffRadio success.`); 1416e41f4b71Sopenharmony_ci}); 1417e41f4b71Sopenharmony_ci``` 1418e41f4b71Sopenharmony_ci 1419e41f4b71Sopenharmony_ci 1420e41f4b71Sopenharmony_ci## radio.turnOffRadio<sup>7+</sup> 1421e41f4b71Sopenharmony_ci 1422e41f4b71Sopenharmony_citurnOffRadio\(slotId: number, callback: AsyncCallback\<void\>\): void 1423e41f4b71Sopenharmony_ci 1424e41f4b71Sopenharmony_ci关闭指定卡槽的Radio。使用callback异步回调。 1425e41f4b71Sopenharmony_ci 1426e41f4b71Sopenharmony_ci**系统接口:** 此接口为系统接口。 1427e41f4b71Sopenharmony_ci 1428e41f4b71Sopenharmony_ci**需要权限**:ohos.permission.SET_TELEPHONY_STATE 1429e41f4b71Sopenharmony_ci 1430e41f4b71Sopenharmony_ci**系统能力**:SystemCapability.Telephony.CoreService 1431e41f4b71Sopenharmony_ci 1432e41f4b71Sopenharmony_ci**参数:** 1433e41f4b71Sopenharmony_ci 1434e41f4b71Sopenharmony_ci| 参数名 | 类型 | 必填 | 说明 | 1435e41f4b71Sopenharmony_ci| -------- | --------------------- | ---- | -------------------------------------- | 1436e41f4b71Sopenharmony_ci| slotId | number | 是 | 卡槽ID。<br/>- 0:卡槽1<br/>- 1:卡槽2 | 1437e41f4b71Sopenharmony_ci| callback | AsyncCallback\<void\> | 是 | 回调函数。返回关闭指定卡槽的Radio的操作结果。 | 1438e41f4b71Sopenharmony_ci 1439e41f4b71Sopenharmony_ci**错误码:** 1440e41f4b71Sopenharmony_ci 1441e41f4b71Sopenharmony_ci以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](errorcode-telephony.md)。 1442e41f4b71Sopenharmony_ci 1443e41f4b71Sopenharmony_ci| 错误码ID | 错误信息 | 1444e41f4b71Sopenharmony_ci| -------- | -------------------------------------------- | 1445e41f4b71Sopenharmony_ci| 201 | Permission denied. | 1446e41f4b71Sopenharmony_ci| 202 | Non-system applications use system APIs. | 1447e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. | 1448e41f4b71Sopenharmony_ci| 8300001 | Invalid parameter value. | 1449e41f4b71Sopenharmony_ci| 8300002 | Service connection failed. | 1450e41f4b71Sopenharmony_ci| 8300003 | System internal error. | 1451e41f4b71Sopenharmony_ci| 8300999 | Unknown error. | 1452e41f4b71Sopenharmony_ci 1453e41f4b71Sopenharmony_ci**示例:** 1454e41f4b71Sopenharmony_ci 1455e41f4b71Sopenharmony_ci```ts 1456e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 1457e41f4b71Sopenharmony_ci 1458e41f4b71Sopenharmony_cilet slotId: number = 0; 1459e41f4b71Sopenharmony_ciradio.turnOffRadio(slotId, (err: BusinessError) => { 1460e41f4b71Sopenharmony_ci if (err) { 1461e41f4b71Sopenharmony_ci console.error(`turnOffRadio failed, callback: err->${JSON.stringify(err)}`); 1462e41f4b71Sopenharmony_ci return; 1463e41f4b71Sopenharmony_ci } 1464e41f4b71Sopenharmony_ci console.log(`turnOffRadio success.`); 1465e41f4b71Sopenharmony_ci}); 1466e41f4b71Sopenharmony_ci``` 1467e41f4b71Sopenharmony_ci 1468e41f4b71Sopenharmony_ci 1469e41f4b71Sopenharmony_ci## radio.turnOffRadio<sup>7+</sup> 1470e41f4b71Sopenharmony_ci 1471e41f4b71Sopenharmony_citurnOffRadio\(slotId?: number\): Promise\<void\> 1472e41f4b71Sopenharmony_ci 1473e41f4b71Sopenharmony_ci关闭Radio。使用Promise异步回调。 1474e41f4b71Sopenharmony_ci 1475e41f4b71Sopenharmony_ci**系统接口:** 此接口为系统接口。 1476e41f4b71Sopenharmony_ci 1477e41f4b71Sopenharmony_ci**需要权限**:ohos.permission.SET_TELEPHONY_STATE 1478e41f4b71Sopenharmony_ci 1479e41f4b71Sopenharmony_ci**系统能力**:SystemCapability.Telephony.CoreService 1480e41f4b71Sopenharmony_ci 1481e41f4b71Sopenharmony_ci**参数:** 1482e41f4b71Sopenharmony_ci 1483e41f4b71Sopenharmony_ci| 参数名 | 类型 | 必填 | 说明 | 1484e41f4b71Sopenharmony_ci| ------ | ------ | ---- | -------------------------------------- | 1485e41f4b71Sopenharmony_ci| slotId | number | 否 | 卡槽ID。<br/>- 0:卡槽1<br/>- 1:卡槽2 | 1486e41f4b71Sopenharmony_ci 1487e41f4b71Sopenharmony_ci**返回值:** 1488e41f4b71Sopenharmony_ci 1489e41f4b71Sopenharmony_ci| 类型 | 说明 | 1490e41f4b71Sopenharmony_ci| --------------- | ----------------------- | 1491e41f4b71Sopenharmony_ci| Promise\<void\> | 以Promise形式返回关闭Radio的操作结果。 | 1492e41f4b71Sopenharmony_ci 1493e41f4b71Sopenharmony_ci**错误码:** 1494e41f4b71Sopenharmony_ci 1495e41f4b71Sopenharmony_ci以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](errorcode-telephony.md)。 1496e41f4b71Sopenharmony_ci 1497e41f4b71Sopenharmony_ci| 错误码ID | 错误信息 | 1498e41f4b71Sopenharmony_ci| -------- | -------------------------------------------- | 1499e41f4b71Sopenharmony_ci| 201 | Permission denied. | 1500e41f4b71Sopenharmony_ci| 202 | Non-system applications use system APIs. | 1501e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. | 1502e41f4b71Sopenharmony_ci| 8300001 | Invalid parameter value. | 1503e41f4b71Sopenharmony_ci| 8300002 | Service connection failed. | 1504e41f4b71Sopenharmony_ci| 8300003 | System internal error. | 1505e41f4b71Sopenharmony_ci| 8300999 | Unknown error. | 1506e41f4b71Sopenharmony_ci 1507e41f4b71Sopenharmony_ci**示例:** 1508e41f4b71Sopenharmony_ci 1509e41f4b71Sopenharmony_ci```ts 1510e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 1511e41f4b71Sopenharmony_ci 1512e41f4b71Sopenharmony_cilet slotId: number = 0; 1513e41f4b71Sopenharmony_ciradio.turnOffRadio(slotId).then(() => { 1514e41f4b71Sopenharmony_ci console.log(`turnOffRadio success.`); 1515e41f4b71Sopenharmony_ci}).catch((err: BusinessError) => { 1516e41f4b71Sopenharmony_ci console.error(`turnOffRadio failed, promise: err->${JSON.stringify(err)}`); 1517e41f4b71Sopenharmony_ci}); 1518e41f4b71Sopenharmony_ci``` 1519e41f4b71Sopenharmony_ci 1520e41f4b71Sopenharmony_ci## radio.setPreferredNetwork<sup>8+</sup> 1521e41f4b71Sopenharmony_ci 1522e41f4b71Sopenharmony_cisetPreferredNetwork\(slotId: number, networkMode: PreferredNetworkMode, callback: AsyncCallback\<void\>\): void 1523e41f4b71Sopenharmony_ci 1524e41f4b71Sopenharmony_ci设置首选网络。使用callback异步回调。 1525e41f4b71Sopenharmony_ci 1526e41f4b71Sopenharmony_ci**系统接口:** 此接口为系统接口。 1527e41f4b71Sopenharmony_ci 1528e41f4b71Sopenharmony_ci**需要权限**:ohos.permission.SET_TELEPHONY_STATE 1529e41f4b71Sopenharmony_ci 1530e41f4b71Sopenharmony_ci**系统能力**:SystemCapability.Telephony.CoreService 1531e41f4b71Sopenharmony_ci 1532e41f4b71Sopenharmony_ci**参数:** 1533e41f4b71Sopenharmony_ci 1534e41f4b71Sopenharmony_ci| 参数名 | 类型 | 必填 | 说明 | 1535e41f4b71Sopenharmony_ci| ----------- | ---------------------------------------------- | ---- | -------------------------------------- | 1536e41f4b71Sopenharmony_ci| slotId | number | 是 | 卡槽ID。<br/>- 0:卡槽1<br/>- 1:卡槽2 | 1537e41f4b71Sopenharmony_ci| networkMode | [PreferredNetworkMode](#preferrednetworkmode8) | 是 | 设置首选网络模式。 | 1538e41f4b71Sopenharmony_ci| callback | AsyncCallback\<void\> | 是 | 回调函数。返回设置首选网络的结果。| 1539e41f4b71Sopenharmony_ci 1540e41f4b71Sopenharmony_ci**错误码:** 1541e41f4b71Sopenharmony_ci 1542e41f4b71Sopenharmony_ci以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](errorcode-telephony.md)。 1543e41f4b71Sopenharmony_ci 1544e41f4b71Sopenharmony_ci| 错误码ID | 错误信息 | 1545e41f4b71Sopenharmony_ci| -------- | -------------------------------------------- | 1546e41f4b71Sopenharmony_ci| 201 | Permission denied. | 1547e41f4b71Sopenharmony_ci| 202 | Non-system applications use system APIs. | 1548e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. | 1549e41f4b71Sopenharmony_ci| 8300001 | Invalid parameter value. | 1550e41f4b71Sopenharmony_ci| 8300002 | Service connection failed. | 1551e41f4b71Sopenharmony_ci| 8300003 | System internal error. | 1552e41f4b71Sopenharmony_ci| 8300999 | Unknown error. | 1553e41f4b71Sopenharmony_ci 1554e41f4b71Sopenharmony_ci**示例:** 1555e41f4b71Sopenharmony_ci 1556e41f4b71Sopenharmony_ci```ts 1557e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 1558e41f4b71Sopenharmony_ci 1559e41f4b71Sopenharmony_cilet slotId: number = 0; 1560e41f4b71Sopenharmony_cilet mode: radio.PreferredNetworkMode = radio.PreferredNetworkMode.PREFERRED_NETWORK_MODE_GSM; 1561e41f4b71Sopenharmony_ciradio.setPreferredNetwork(slotId, mode, (err: BusinessError) => { 1562e41f4b71Sopenharmony_ci if (err) { 1563e41f4b71Sopenharmony_ci console.error(`setPreferredNetwork failed, callback: err->${JSON.stringify(err)}`); 1564e41f4b71Sopenharmony_ci return; 1565e41f4b71Sopenharmony_ci } 1566e41f4b71Sopenharmony_ci console.log(`setPreferredNetwork success.`); 1567e41f4b71Sopenharmony_ci}); 1568e41f4b71Sopenharmony_ci``` 1569e41f4b71Sopenharmony_ci 1570e41f4b71Sopenharmony_ci## radio.setPreferredNetwork<sup>8+</sup> 1571e41f4b71Sopenharmony_ci 1572e41f4b71Sopenharmony_cisetPreferredNetwork\(slotId: number, networkMode: PreferredNetworkMode\): Promise\<void\> 1573e41f4b71Sopenharmony_ci 1574e41f4b71Sopenharmony_ci设置首选网络。使用Promise异步回调。 1575e41f4b71Sopenharmony_ci 1576e41f4b71Sopenharmony_ci**系统接口:** 此接口为系统接口。 1577e41f4b71Sopenharmony_ci 1578e41f4b71Sopenharmony_ci**需要权限**:ohos.permission.SET_TELEPHONY_STATE 1579e41f4b71Sopenharmony_ci 1580e41f4b71Sopenharmony_ci**系统能力**:SystemCapability.Telephony.CoreService 1581e41f4b71Sopenharmony_ci 1582e41f4b71Sopenharmony_ci**参数:** 1583e41f4b71Sopenharmony_ci 1584e41f4b71Sopenharmony_ci| 参数名 | 类型 | 必填 | 说明 | 1585e41f4b71Sopenharmony_ci| ----------- | ---------------------------------------------- | ---- | -------------------------------------- | 1586e41f4b71Sopenharmony_ci| slotId | number | 是 | 卡槽ID。<br/>- 0:卡槽1<br/>- 1:卡槽2 | 1587e41f4b71Sopenharmony_ci| networkMode | [PreferredNetworkMode](#preferrednetworkmode8) | 是 | 设置首选网络模式。| 1588e41f4b71Sopenharmony_ci 1589e41f4b71Sopenharmony_ci**返回值:** 1590e41f4b71Sopenharmony_ci 1591e41f4b71Sopenharmony_ci| 类型 | 说明 | 1592e41f4b71Sopenharmony_ci| --------------- | ----------------------- | 1593e41f4b71Sopenharmony_ci| Promise\<void\> | 以Promise形式返回返回设置首选网络的结果。 | 1594e41f4b71Sopenharmony_ci 1595e41f4b71Sopenharmony_ci**错误码:** 1596e41f4b71Sopenharmony_ci 1597e41f4b71Sopenharmony_ci以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](errorcode-telephony.md)。 1598e41f4b71Sopenharmony_ci 1599e41f4b71Sopenharmony_ci| 错误码ID | 错误信息 | 1600e41f4b71Sopenharmony_ci| -------- | -------------------------------------------- | 1601e41f4b71Sopenharmony_ci| 201 | Permission denied. | 1602e41f4b71Sopenharmony_ci| 202 | Non-system applications use system APIs. | 1603e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. | 1604e41f4b71Sopenharmony_ci| 8300001 | Invalid parameter value. | 1605e41f4b71Sopenharmony_ci| 8300002 | Service connection failed. | 1606e41f4b71Sopenharmony_ci| 8300003 | System internal error. | 1607e41f4b71Sopenharmony_ci| 8300999 | Unknown error. | 1608e41f4b71Sopenharmony_ci 1609e41f4b71Sopenharmony_ci**示例:** 1610e41f4b71Sopenharmony_ci 1611e41f4b71Sopenharmony_ci```ts 1612e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 1613e41f4b71Sopenharmony_ci 1614e41f4b71Sopenharmony_cilet slotId: number = 0; 1615e41f4b71Sopenharmony_cilet mode: radio.PreferredNetworkMode = radio.PreferredNetworkMode.PREFERRED_NETWORK_MODE_GSM; 1616e41f4b71Sopenharmony_ciradio.setPreferredNetwork(slotId, mode).then(() => { 1617e41f4b71Sopenharmony_ci console.log(`setPreferredNetwork success.`); 1618e41f4b71Sopenharmony_ci}).catch((err: BusinessError) => { 1619e41f4b71Sopenharmony_ci console.error(`setPreferredNetwork failed, promise: err->${JSON.stringify(err)}`); 1620e41f4b71Sopenharmony_ci}); 1621e41f4b71Sopenharmony_ci``` 1622e41f4b71Sopenharmony_ci 1623e41f4b71Sopenharmony_ci## radio.getPreferredNetwork<sup>8+</sup> 1624e41f4b71Sopenharmony_ci 1625e41f4b71Sopenharmony_cigetPreferredNetwork\(slotId: number, callback: AsyncCallback\<PreferredNetworkMode\>\): void 1626e41f4b71Sopenharmony_ci 1627e41f4b71Sopenharmony_ci获取首选网络。使用callback异步回调。 1628e41f4b71Sopenharmony_ci 1629e41f4b71Sopenharmony_ci**系统接口:** 此接口为系统接口。 1630e41f4b71Sopenharmony_ci 1631e41f4b71Sopenharmony_ci**需要权限**:ohos.permission.GET_TELEPHONY_STATE 1632e41f4b71Sopenharmony_ci 1633e41f4b71Sopenharmony_ci**系统能力**:SystemCapability.Telephony.CoreService 1634e41f4b71Sopenharmony_ci 1635e41f4b71Sopenharmony_ci**参数:** 1636e41f4b71Sopenharmony_ci 1637e41f4b71Sopenharmony_ci| 参数名 | 类型 | 必填 | 说明 | 1638e41f4b71Sopenharmony_ci| -------- | --------------------------------------------------------------- | ---- | -------------------------------------- | 1639e41f4b71Sopenharmony_ci| slotId | number | 是 | 卡槽ID。<br/>- 0:卡槽1<br/>- 1:卡槽2 | 1640e41f4b71Sopenharmony_ci| callback | AsyncCallback\<[PreferredNetworkMode](#preferrednetworkmode8)\> | 是 | 回调函数。返回首选网络类型。| 1641e41f4b71Sopenharmony_ci 1642e41f4b71Sopenharmony_ci**错误码:** 1643e41f4b71Sopenharmony_ci 1644e41f4b71Sopenharmony_ci以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](errorcode-telephony.md)。 1645e41f4b71Sopenharmony_ci 1646e41f4b71Sopenharmony_ci| 错误码ID | 错误信息 | 1647e41f4b71Sopenharmony_ci| -------- | -------------------------------------------- | 1648e41f4b71Sopenharmony_ci| 201 | Permission denied. | 1649e41f4b71Sopenharmony_ci| 202 | Non-system applications use system APIs. | 1650e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. | 1651e41f4b71Sopenharmony_ci| 8300001 | Invalid parameter value. | 1652e41f4b71Sopenharmony_ci| 8300002 | Service connection failed. | 1653e41f4b71Sopenharmony_ci| 8300003 | System internal error. | 1654e41f4b71Sopenharmony_ci| 8300999 | Unknown error. | 1655e41f4b71Sopenharmony_ci 1656e41f4b71Sopenharmony_ci**示例:** 1657e41f4b71Sopenharmony_ci 1658e41f4b71Sopenharmony_ci```ts 1659e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 1660e41f4b71Sopenharmony_ci 1661e41f4b71Sopenharmony_cilet slotId: number = 0; 1662e41f4b71Sopenharmony_ciradio.getPreferredNetwork(slotId, (err: BusinessError, data: radio.PreferredNetworkMode) => { 1663e41f4b71Sopenharmony_ci if (err) { 1664e41f4b71Sopenharmony_ci console.error(`getPreferredNetwork failed, callback: err->${JSON.stringify(err)}`); 1665e41f4b71Sopenharmony_ci return; 1666e41f4b71Sopenharmony_ci } 1667e41f4b71Sopenharmony_ci console.log(`getPreferredNetwork success, callback: data->${JSON.stringify(data)}`); 1668e41f4b71Sopenharmony_ci}); 1669e41f4b71Sopenharmony_ci``` 1670e41f4b71Sopenharmony_ci 1671e41f4b71Sopenharmony_ci## radio.getPreferredNetwork<sup>8+</sup> 1672e41f4b71Sopenharmony_ci 1673e41f4b71Sopenharmony_cigetPreferredNetwork\(slotId: number\): Promise\<PreferredNetworkMode\> 1674e41f4b71Sopenharmony_ci 1675e41f4b71Sopenharmony_ci获取首选网络。使用Promise异步回调。 1676e41f4b71Sopenharmony_ci 1677e41f4b71Sopenharmony_ci**系统接口:** 此接口为系统接口。 1678e41f4b71Sopenharmony_ci 1679e41f4b71Sopenharmony_ci**需要权限**:ohos.permission.GET_TELEPHONY_STATE 1680e41f4b71Sopenharmony_ci 1681e41f4b71Sopenharmony_ci**系统能力**:SystemCapability.Telephony.CoreService 1682e41f4b71Sopenharmony_ci 1683e41f4b71Sopenharmony_ci**参数:** 1684e41f4b71Sopenharmony_ci 1685e41f4b71Sopenharmony_ci| 参数名 | 类型 | 必填 | 说明 | 1686e41f4b71Sopenharmony_ci| ------ | ------ | ---- | -------------------------------------- | 1687e41f4b71Sopenharmony_ci| slotId | number | 是 | 卡槽ID。<br/>- 0:卡槽1<br/>- 1:卡槽2 | 1688e41f4b71Sopenharmony_ci 1689e41f4b71Sopenharmony_ci**返回值:** 1690e41f4b71Sopenharmony_ci 1691e41f4b71Sopenharmony_ci| 类型 | 说明 | 1692e41f4b71Sopenharmony_ci| --------------- | ----------------------- | 1693e41f4b71Sopenharmony_ci| Promise\<[PreferredNetworkMode](#preferrednetworkmode8)\> | 以Promise形式返回首选网络类型。 | 1694e41f4b71Sopenharmony_ci 1695e41f4b71Sopenharmony_ci**错误码:** 1696e41f4b71Sopenharmony_ci 1697e41f4b71Sopenharmony_ci以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](errorcode-telephony.md)。 1698e41f4b71Sopenharmony_ci 1699e41f4b71Sopenharmony_ci| 错误码ID | 错误信息 | 1700e41f4b71Sopenharmony_ci| -------- | -------------------------------------------- | 1701e41f4b71Sopenharmony_ci| 201 | Permission denied. | 1702e41f4b71Sopenharmony_ci| 202 | Non-system applications use system APIs. | 1703e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. | 1704e41f4b71Sopenharmony_ci| 8300001 | Invalid parameter value. | 1705e41f4b71Sopenharmony_ci| 8300002 | Service connection failed. | 1706e41f4b71Sopenharmony_ci| 8300003 | System internal error. | 1707e41f4b71Sopenharmony_ci| 8300999 | Unknown error. | 1708e41f4b71Sopenharmony_ci 1709e41f4b71Sopenharmony_ci**示例:** 1710e41f4b71Sopenharmony_ci 1711e41f4b71Sopenharmony_ci```ts 1712e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 1713e41f4b71Sopenharmony_ci 1714e41f4b71Sopenharmony_cilet slotId: number = 0; 1715e41f4b71Sopenharmony_ciradio.getPreferredNetwork(slotId).then((data: radio.PreferredNetworkMode) => { 1716e41f4b71Sopenharmony_ci console.log(`getPreferredNetwork success, promise: data->${JSON.stringify(data)}`); 1717e41f4b71Sopenharmony_ci}).catch((err: BusinessError) => { 1718e41f4b71Sopenharmony_ci console.error(`getPreferredNetwork failed, promise: err->${JSON.stringify(err)}`); 1719e41f4b71Sopenharmony_ci}); 1720e41f4b71Sopenharmony_ci``` 1721e41f4b71Sopenharmony_ci 1722e41f4b71Sopenharmony_ci## radio.getImsRegInfo<sup>9+</sup> 1723e41f4b71Sopenharmony_ci 1724e41f4b71Sopenharmony_cigetImsRegInfo\(slotId: number, imsType: ImsServiceType, callback: AsyncCallback\<ImsRegInfo\>\): void 1725e41f4b71Sopenharmony_ci 1726e41f4b71Sopenharmony_ci获取特定IMS服务类型的IMS注册状态信息。使用callback异步回调。 1727e41f4b71Sopenharmony_ci 1728e41f4b71Sopenharmony_ci**系统接口:** 此接口为系统接口。 1729e41f4b71Sopenharmony_ci 1730e41f4b71Sopenharmony_ci**需要权限**:ohos.permission.GET_TELEPHONY_STATE 1731e41f4b71Sopenharmony_ci 1732e41f4b71Sopenharmony_ci**系统能力**:SystemCapability.Telephony.CoreService 1733e41f4b71Sopenharmony_ci 1734e41f4b71Sopenharmony_ci**参数:** 1735e41f4b71Sopenharmony_ci 1736e41f4b71Sopenharmony_ci| 参数名 | 类型 | 必填 | 说明 | 1737e41f4b71Sopenharmony_ci| -------- | ------------------------------------------ | ---- | -------------------------------------- | 1738e41f4b71Sopenharmony_ci| slotId | number | 是 | 卡槽ID。<br/>- 0:卡槽1<br/>- 1:卡槽2 | 1739e41f4b71Sopenharmony_ci| imsType | [ImsServiceType](#imsservicetype9) | 是 | IMS服务类型。 | 1740e41f4b71Sopenharmony_ci| callback | AsyncCallback<[ImsRegInfo](#imsreginfo9)\> | 是 | 回调函数。返回指定IMS服务类型的IMS注册状态信息。| 1741e41f4b71Sopenharmony_ci 1742e41f4b71Sopenharmony_ci**错误码:** 1743e41f4b71Sopenharmony_ci 1744e41f4b71Sopenharmony_ci以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](errorcode-telephony.md)。 1745e41f4b71Sopenharmony_ci 1746e41f4b71Sopenharmony_ci| 错误码ID | 错误信息 | 1747e41f4b71Sopenharmony_ci| -------- | -------------------------------------------- | 1748e41f4b71Sopenharmony_ci| 201 | Permission denied. | 1749e41f4b71Sopenharmony_ci| 202 | Non-system applications use system APIs. | 1750e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: Mandatory parameters are left unspecified. | 1751e41f4b71Sopenharmony_ci| 8300001 | Invalid parameter value. | 1752e41f4b71Sopenharmony_ci| 8300002 | Service connection failed. | 1753e41f4b71Sopenharmony_ci| 8300003 | System internal error. | 1754e41f4b71Sopenharmony_ci| 8300999 | Unknown error. | 1755e41f4b71Sopenharmony_ci 1756e41f4b71Sopenharmony_ci**示例:** 1757e41f4b71Sopenharmony_ci 1758e41f4b71Sopenharmony_ci```ts 1759e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 1760e41f4b71Sopenharmony_ci 1761e41f4b71Sopenharmony_cilet slotId: number = 0; 1762e41f4b71Sopenharmony_cilet mode: radio.ImsServiceType = radio.ImsServiceType.TYPE_VIDEO; 1763e41f4b71Sopenharmony_ciradio.getImsRegInfo(slotId, mode, (err: BusinessError, data: radio.ImsRegInfo) => { 1764e41f4b71Sopenharmony_ci if (err) { 1765e41f4b71Sopenharmony_ci console.error(`getImsRegInfo failed, callback: err->${JSON.stringify(err)}`); 1766e41f4b71Sopenharmony_ci return; 1767e41f4b71Sopenharmony_ci } 1768e41f4b71Sopenharmony_ci console.log(`getImsRegInfo success, callback: data->${JSON.stringify(data)}`); 1769e41f4b71Sopenharmony_ci}); 1770e41f4b71Sopenharmony_ci``` 1771e41f4b71Sopenharmony_ci 1772e41f4b71Sopenharmony_ci## radio.getImsRegInfo<sup>9+</sup> 1773e41f4b71Sopenharmony_ci 1774e41f4b71Sopenharmony_cigetImsRegInfo\(slotId: number, imsType: ImsServiceType\): Promise\<ImsRegInfo\> 1775e41f4b71Sopenharmony_ci 1776e41f4b71Sopenharmony_ci获取特定IMS服务类型的IMS注册状态信息。使用Promise异步回调。 1777e41f4b71Sopenharmony_ci 1778e41f4b71Sopenharmony_ci**系统接口:** 此接口为系统接口。 1779e41f4b71Sopenharmony_ci 1780e41f4b71Sopenharmony_ci**需要权限**:ohos.permission.GET_TELEPHONY_STATE 1781e41f4b71Sopenharmony_ci 1782e41f4b71Sopenharmony_ci**系统能力**:SystemCapability.Telephony.CoreService 1783e41f4b71Sopenharmony_ci 1784e41f4b71Sopenharmony_ci**参数:** 1785e41f4b71Sopenharmony_ci 1786e41f4b71Sopenharmony_ci| 参数名 | 类型 | 必填 | 说明 | 1787e41f4b71Sopenharmony_ci| ------- | ---------------------------------- | ---- | -------------------------------------- | 1788e41f4b71Sopenharmony_ci| slotId | number | 是 | 卡槽ID。<br/>- 0:卡槽1<br/>- 1:卡槽2 | 1789e41f4b71Sopenharmony_ci| imsType | [ImsServiceType](#imsservicetype9) | 是 | IMS服务类型。 | 1790e41f4b71Sopenharmony_ci 1791e41f4b71Sopenharmony_ci**返回值:** 1792e41f4b71Sopenharmony_ci 1793e41f4b71Sopenharmony_ci| 类型 | 说明 | 1794e41f4b71Sopenharmony_ci| ------------------------------------- | ----------------------- | 1795e41f4b71Sopenharmony_ci| Promise\<[ImsRegInfo](#imsreginfo9)\> | 以Promise形式返回指定IMS服务类型的IMS注册状态信息。 | 1796e41f4b71Sopenharmony_ci 1797e41f4b71Sopenharmony_ci**错误码:** 1798e41f4b71Sopenharmony_ci 1799e41f4b71Sopenharmony_ci以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](errorcode-telephony.md)。 1800e41f4b71Sopenharmony_ci 1801e41f4b71Sopenharmony_ci| 错误码ID | 错误信息 | 1802e41f4b71Sopenharmony_ci| -------- | -------------------------------------------- | 1803e41f4b71Sopenharmony_ci| 201 | Permission denied. | 1804e41f4b71Sopenharmony_ci| 202 | Non-system applications use system APIs. | 1805e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: Mandatory parameters are left unspecified. | 1806e41f4b71Sopenharmony_ci| 8300001 | Invalid parameter value. | 1807e41f4b71Sopenharmony_ci| 8300002 | Service connection failed. | 1808e41f4b71Sopenharmony_ci| 8300003 | System internal error. | 1809e41f4b71Sopenharmony_ci| 8300999 | Unknown error. | 1810e41f4b71Sopenharmony_ci 1811e41f4b71Sopenharmony_ci**示例:** 1812e41f4b71Sopenharmony_ci 1813e41f4b71Sopenharmony_ci```ts 1814e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 1815e41f4b71Sopenharmony_ci 1816e41f4b71Sopenharmony_cilet slotId: number = 0; 1817e41f4b71Sopenharmony_cilet mode: radio.ImsServiceType = radio.ImsServiceType.TYPE_VIDEO; 1818e41f4b71Sopenharmony_ciradio.getImsRegInfo(slotId, mode).then((data: radio.ImsRegInfo) => { 1819e41f4b71Sopenharmony_ci console.log(`getImsRegInfo success, promise: data->${JSON.stringify(data)}`); 1820e41f4b71Sopenharmony_ci}).catch((err: BusinessError) => { 1821e41f4b71Sopenharmony_ci console.error(`getImsRegInfo failed, promise: err->${JSON.stringify(err)}`); 1822e41f4b71Sopenharmony_ci}); 1823e41f4b71Sopenharmony_ci``` 1824e41f4b71Sopenharmony_ci 1825e41f4b71Sopenharmony_ci## radio.on('imsRegStateChange')<sup>9+</sup> 1826e41f4b71Sopenharmony_ci 1827e41f4b71Sopenharmony_cion\(type: 'imsRegStateChange', slotId: number, imsType: ImsServiceType, callback: Callback\<ImsRegInfo\>\): void 1828e41f4b71Sopenharmony_ci 1829e41f4b71Sopenharmony_ci订阅imsRegStateChange事件,使用callback异步回调。 1830e41f4b71Sopenharmony_ci 1831e41f4b71Sopenharmony_ci**系统接口:** 此接口为系统接口。 1832e41f4b71Sopenharmony_ci 1833e41f4b71Sopenharmony_ci**需要权限**:ohos.permission.GET_TELEPHONY_STATE 1834e41f4b71Sopenharmony_ci 1835e41f4b71Sopenharmony_ci**系统能力**:SystemCapability.Telephony.CoreService 1836e41f4b71Sopenharmony_ci 1837e41f4b71Sopenharmony_ci**参数:** 1838e41f4b71Sopenharmony_ci 1839e41f4b71Sopenharmony_ci| 参数名 | 类型 | 必填 | 说明 | 1840e41f4b71Sopenharmony_ci| -------- | ------------------------------------ | ---- | -------------------------------------- | 1841e41f4b71Sopenharmony_ci| type | string | 是 | 填写'imsRegStateChange',表示IMS注册状态变化事件。 | 1842e41f4b71Sopenharmony_ci| slotId | number | 是 | 卡槽ID。<br/>- 0:卡槽1<br/>- 1:卡槽2 | 1843e41f4b71Sopenharmony_ci| imsType | [ImsServiceType](#imsservicetype9) | 是 | IMS服务类型。 | 1844e41f4b71Sopenharmony_ci| callback | Callback<[ImsRegInfo](#imsreginfo9)> | 是 | 回调函数。返回IMS注册状态信息。 | 1845e41f4b71Sopenharmony_ci 1846e41f4b71Sopenharmony_ci**错误码:** 1847e41f4b71Sopenharmony_ci 1848e41f4b71Sopenharmony_ci以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](errorcode-telephony.md)。 1849e41f4b71Sopenharmony_ci 1850e41f4b71Sopenharmony_ci| 错误码ID | 错误信息 | 1851e41f4b71Sopenharmony_ci| -------- | -------------------------------------------- | 1852e41f4b71Sopenharmony_ci| 201 | Permission denied. | 1853e41f4b71Sopenharmony_ci| 202 | Non-system applications use system APIs. | 1854e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: Mandatory parameters are left unspecified. | 1855e41f4b71Sopenharmony_ci| 8300001 | Invalid parameter value. | 1856e41f4b71Sopenharmony_ci| 8300002 | Service connection failed. | 1857e41f4b71Sopenharmony_ci| 8300003 | System internal error. | 1858e41f4b71Sopenharmony_ci| 8300999 | Unknown error. | 1859e41f4b71Sopenharmony_ci 1860e41f4b71Sopenharmony_ci**示例:** 1861e41f4b71Sopenharmony_ci 1862e41f4b71Sopenharmony_ci```ts 1863e41f4b71Sopenharmony_cilet slotId: number = 0; 1864e41f4b71Sopenharmony_cilet mode: radio.ImsServiceType = radio.ImsServiceType.TYPE_VIDEO; 1865e41f4b71Sopenharmony_ciradio.on('imsRegStateChange', slotId, mode, (data: radio.ImsRegInfo) => { 1866e41f4b71Sopenharmony_ci console.log(`on imsRegStateChange success, callback: data->${JSON.stringify(data)}`); 1867e41f4b71Sopenharmony_ci}); 1868e41f4b71Sopenharmony_ci``` 1869e41f4b71Sopenharmony_ci 1870e41f4b71Sopenharmony_ci## radio.off('imsRegStateChange')<sup>9+</sup> 1871e41f4b71Sopenharmony_ci 1872e41f4b71Sopenharmony_cioff\(type: 'imsRegStateChange', slotId: number, imsType: ImsServiceType, callback?: Callback\<ImsRegInfo\>\): void 1873e41f4b71Sopenharmony_ci 1874e41f4b71Sopenharmony_ci取消订阅imsRegStateChange事件,使用callback异步回调。 1875e41f4b71Sopenharmony_ci 1876e41f4b71Sopenharmony_ci**系统接口:** 此接口为系统接口。 1877e41f4b71Sopenharmony_ci 1878e41f4b71Sopenharmony_ci**需要权限**:ohos.permission.GET_TELEPHONY_STATE 1879e41f4b71Sopenharmony_ci 1880e41f4b71Sopenharmony_ci**系统能力**:SystemCapability.Telephony.CoreService 1881e41f4b71Sopenharmony_ci 1882e41f4b71Sopenharmony_ci**参数:** 1883e41f4b71Sopenharmony_ci 1884e41f4b71Sopenharmony_ci| 参数名 | 类型 | 必填 | 说明 | 1885e41f4b71Sopenharmony_ci| -------- | ------------------------------------ | ---- | -------------------------------------- | 1886e41f4b71Sopenharmony_ci| type | string | 是 | 填写'imsRegStateChange',表示IMS注册状态变化事件。 | 1887e41f4b71Sopenharmony_ci| slotId | number | 是 | 卡槽ID。<br/>- 0:卡槽1<br/>- 1:卡槽2 | 1888e41f4b71Sopenharmony_ci| imsType | [ImsServiceType](#imsservicetype9) | 是 | IMS服务类型。 | 1889e41f4b71Sopenharmony_ci| callback | Callback<[ImsRegInfo](#imsreginfo9)> | 否 | 回调函数。返回IMS注册状态信息。缺省时,表示注销所有已注册事件回调。需与on('imsRegStateChange')的callback一致。 | 1890e41f4b71Sopenharmony_ci 1891e41f4b71Sopenharmony_ci**错误码:** 1892e41f4b71Sopenharmony_ci 1893e41f4b71Sopenharmony_ci以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](errorcode-telephony.md)。 1894e41f4b71Sopenharmony_ci 1895e41f4b71Sopenharmony_ci| 错误码ID | 错误信息 | 1896e41f4b71Sopenharmony_ci| -------- | -------------------------------------------- | 1897e41f4b71Sopenharmony_ci| 201 | Permission denied. | 1898e41f4b71Sopenharmony_ci| 202 | Non-system applications use system APIs. | 1899e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: Mandatory parameters are left unspecified. | 1900e41f4b71Sopenharmony_ci| 8300001 | Invalid parameter value. | 1901e41f4b71Sopenharmony_ci| 8300002 | Service connection failed. | 1902e41f4b71Sopenharmony_ci| 8300003 | System internal error. | 1903e41f4b71Sopenharmony_ci| 8300999 | Unknown error. | 1904e41f4b71Sopenharmony_ci 1905e41f4b71Sopenharmony_ci**示例:** 1906e41f4b71Sopenharmony_ci 1907e41f4b71Sopenharmony_ci```ts 1908e41f4b71Sopenharmony_cilet slotId: number = 0; 1909e41f4b71Sopenharmony_cilet mode: radio.ImsServiceType = radio.ImsServiceType.TYPE_VIDEO; 1910e41f4b71Sopenharmony_ciradio.off('imsRegStateChange', slotId, mode, (data: radio.ImsRegInfo) => { 1911e41f4b71Sopenharmony_ci console.log(`off imsRegStateChange success, callback: data->${JSON.stringify(data)}`); 1912e41f4b71Sopenharmony_ci}); 1913e41f4b71Sopenharmony_ci``` 1914e41f4b71Sopenharmony_ci 1915e41f4b71Sopenharmony_ci 1916e41f4b71Sopenharmony_ci## radio.getBasebandVersion<sup>10+</sup> 1917e41f4b71Sopenharmony_ci 1918e41f4b71Sopenharmony_cigetBasebandVersion\(slotId: number, callback: AsyncCallback\<string\>\): void 1919e41f4b71Sopenharmony_ci 1920e41f4b71Sopenharmony_ci获取设备的基带版本号。使用callback异步回调。 1921e41f4b71Sopenharmony_ci 1922e41f4b71Sopenharmony_ci**系统接口:** 此接口为系统接口。 1923e41f4b71Sopenharmony_ci 1924e41f4b71Sopenharmony_ci**需要权限**:ohos.permission.GET_TELEPHONY_STATE 1925e41f4b71Sopenharmony_ci 1926e41f4b71Sopenharmony_ci**系统能力**:SystemCapability.Telephony.CoreService 1927e41f4b71Sopenharmony_ci 1928e41f4b71Sopenharmony_ci**参数:** 1929e41f4b71Sopenharmony_ci 1930e41f4b71Sopenharmony_ci| 参数名 | 类型 | 必填 | 说明 | 1931e41f4b71Sopenharmony_ci| -------- | ----------------------- | ---- | ------------------------------------- | 1932e41f4b71Sopenharmony_ci| slotId | number | 是 | 卡槽ID。<br/>- 0:卡槽1<br/>- 1:卡槽2 | 1933e41f4b71Sopenharmony_ci| callback | AsyncCallback\<string\> | 是 | 回调函数。返回设备的基带版本号。 | 1934e41f4b71Sopenharmony_ci 1935e41f4b71Sopenharmony_ci**错误码:** 1936e41f4b71Sopenharmony_ci 1937e41f4b71Sopenharmony_ci以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](errorcode-telephony.md)。 1938e41f4b71Sopenharmony_ci 1939e41f4b71Sopenharmony_ci| 错误码ID | 错误信息 | 1940e41f4b71Sopenharmony_ci| -------- | -------------------------------------------- | 1941e41f4b71Sopenharmony_ci| 201 | Permission denied. | 1942e41f4b71Sopenharmony_ci| 202 | Non-system applications use system APIs. | 1943e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. | 1944e41f4b71Sopenharmony_ci| 8300001 | Invalid parameter value. | 1945e41f4b71Sopenharmony_ci| 8300002 | Service connection failed. | 1946e41f4b71Sopenharmony_ci| 8300003 | System internal error. | 1947e41f4b71Sopenharmony_ci| 8300999 | Unknown error. | 1948e41f4b71Sopenharmony_ci 1949e41f4b71Sopenharmony_ci**示例:** 1950e41f4b71Sopenharmony_ci 1951e41f4b71Sopenharmony_ci```ts 1952e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 1953e41f4b71Sopenharmony_ci 1954e41f4b71Sopenharmony_cilet slotId: number = 0; 1955e41f4b71Sopenharmony_ciradio.getBasebandVersion(slotId, (err: BusinessError, data: string) => { 1956e41f4b71Sopenharmony_ci if (err) { 1957e41f4b71Sopenharmony_ci console.error(`getBasebandVersion failed, callback: err->${JSON.stringify(err)}`); 1958e41f4b71Sopenharmony_ci return; 1959e41f4b71Sopenharmony_ci } 1960e41f4b71Sopenharmony_ci console.log(`getBasebandVersion success, callback: data->${JSON.stringify(data)}`); 1961e41f4b71Sopenharmony_ci}); 1962e41f4b71Sopenharmony_ci``` 1963e41f4b71Sopenharmony_ci 1964e41f4b71Sopenharmony_ci 1965e41f4b71Sopenharmony_ci## radio.getBasebandVersion<sup>10+</sup> 1966e41f4b71Sopenharmony_ci 1967e41f4b71Sopenharmony_cigetBasebandVersion\(slotId: number\): Promise\<string\> 1968e41f4b71Sopenharmony_ci 1969e41f4b71Sopenharmony_ci获取设备的基带版本号。使用Promise异步回调。 1970e41f4b71Sopenharmony_ci 1971e41f4b71Sopenharmony_ci**系统接口:** 此接口为系统接口。 1972e41f4b71Sopenharmony_ci 1973e41f4b71Sopenharmony_ci**需要权限**:ohos.permission.GET_TELEPHONY_STATE 1974e41f4b71Sopenharmony_ci 1975e41f4b71Sopenharmony_ci**系统能力**:SystemCapability.Telephony.CoreService 1976e41f4b71Sopenharmony_ci 1977e41f4b71Sopenharmony_ci**参数:** 1978e41f4b71Sopenharmony_ci 1979e41f4b71Sopenharmony_ci| 参数名 | 类型 | 必填 | 说明 | 1980e41f4b71Sopenharmony_ci| -------- | ----------------------- | ---- | ------------------------------------- | 1981e41f4b71Sopenharmony_ci| slotId | number | 是 | 卡槽ID。<br/>- 0:卡槽1<br/>- 1:卡槽2 | 1982e41f4b71Sopenharmony_ci 1983e41f4b71Sopenharmony_ci**返回值:** 1984e41f4b71Sopenharmony_ci 1985e41f4b71Sopenharmony_ci| 类型 | 说明 | 1986e41f4b71Sopenharmony_ci| ----------------- | -------------------------------------- | 1987e41f4b71Sopenharmony_ci| Promise\<string\> | 以Promise形式返回设备的基带版本号。 | 1988e41f4b71Sopenharmony_ci 1989e41f4b71Sopenharmony_ci**错误码:** 1990e41f4b71Sopenharmony_ci 1991e41f4b71Sopenharmony_ci以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](errorcode-telephony.md)。 1992e41f4b71Sopenharmony_ci 1993e41f4b71Sopenharmony_ci| 错误码ID | 错误信息 | 1994e41f4b71Sopenharmony_ci| -------- | -------------------------------------------- | 1995e41f4b71Sopenharmony_ci| 201 | Permission denied. | 1996e41f4b71Sopenharmony_ci| 202 | Non-system applications use system APIs. | 1997e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. | 1998e41f4b71Sopenharmony_ci| 8300001 | Invalid parameter value. | 1999e41f4b71Sopenharmony_ci| 8300002 | Service connection failed. | 2000e41f4b71Sopenharmony_ci| 8300003 | System internal error. | 2001e41f4b71Sopenharmony_ci| 8300999 | Unknown error. | 2002e41f4b71Sopenharmony_ci 2003e41f4b71Sopenharmony_ci**示例:** 2004e41f4b71Sopenharmony_ci 2005e41f4b71Sopenharmony_ci```ts 2006e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 2007e41f4b71Sopenharmony_ci 2008e41f4b71Sopenharmony_cilet slotId: number = 0; 2009e41f4b71Sopenharmony_ciradio.getBasebandVersion(slotId).then((data: string) => { 2010e41f4b71Sopenharmony_ci console.log(`getBasebandVersion success, promise: data->${JSON.stringify(data)}`); 2011e41f4b71Sopenharmony_ci}).catch((err: BusinessError) => { 2012e41f4b71Sopenharmony_ci console.error(`getBasebandVersion failed, promise: err->${JSON.stringify(err)}`); 2013e41f4b71Sopenharmony_ci}); 2014e41f4b71Sopenharmony_ci``` 2015e41f4b71Sopenharmony_ci 2016e41f4b71Sopenharmony_ci 2017e41f4b71Sopenharmony_ci## radio.setNROptionMode<sup>10+</sup> 2018e41f4b71Sopenharmony_ci 2019e41f4b71Sopenharmony_cisetNROptionMode\(slotId: number, mode: NROptionMode, callback: AsyncCallback\<void\>\): void 2020e41f4b71Sopenharmony_ci 2021e41f4b71Sopenharmony_ci设置NR选项模式。使用callback异步回调。 2022e41f4b71Sopenharmony_ci 2023e41f4b71Sopenharmony_ci**系统接口:** 此接口为系统接口。 2024e41f4b71Sopenharmony_ci 2025e41f4b71Sopenharmony_ci**需要权限**:ohos.permission.SET_TELEPHONY_STATE 2026e41f4b71Sopenharmony_ci 2027e41f4b71Sopenharmony_ci**系统能力**:SystemCapability.Telephony.CoreService 2028e41f4b71Sopenharmony_ci 2029e41f4b71Sopenharmony_ci**参数:** 2030e41f4b71Sopenharmony_ci 2031e41f4b71Sopenharmony_ci| 参数名 | 类型 | 必填 | 说明 | 2032e41f4b71Sopenharmony_ci| -------- | ------------------------------------------------ | ---- | -------------------------------------- | 2033e41f4b71Sopenharmony_ci| slotId | number | 是 | 卡槽ID。<br/>- 0:卡槽1<br/>- 1:卡槽2 | 2034e41f4b71Sopenharmony_ci| mode | [NROptionMode](#nroptionmode10) | 是 | NR的选择模式。 | 2035e41f4b71Sopenharmony_ci| callback | AsyncCallback\<void\> | 是 | 回调函数。返回设置NR选项模式的结果。 | 2036e41f4b71Sopenharmony_ci 2037e41f4b71Sopenharmony_ci**错误码:** 2038e41f4b71Sopenharmony_ci 2039e41f4b71Sopenharmony_ci以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](errorcode-telephony.md)。 2040e41f4b71Sopenharmony_ci 2041e41f4b71Sopenharmony_ci| 错误码ID | 错误信息 | 2042e41f4b71Sopenharmony_ci| -------- | -------------------------------------------- | 2043e41f4b71Sopenharmony_ci| 201 | Permission denied. | 2044e41f4b71Sopenharmony_ci| 202 | Non-system applications use system APIs. | 2045e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. | 2046e41f4b71Sopenharmony_ci| 8300001 | Invalid parameter value. | 2047e41f4b71Sopenharmony_ci| 8300002 | Service connection failed. | 2048e41f4b71Sopenharmony_ci| 8300003 | System internal error. | 2049e41f4b71Sopenharmony_ci| 8300999 | Unknown error. | 2050e41f4b71Sopenharmony_ci 2051e41f4b71Sopenharmony_ci**示例:** 2052e41f4b71Sopenharmony_ci 2053e41f4b71Sopenharmony_ci```ts 2054e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 2055e41f4b71Sopenharmony_ci 2056e41f4b71Sopenharmony_cilet slotId: number = 0; 2057e41f4b71Sopenharmony_cilet mode: radio.NROptionMode = radio.NROptionMode.NR_OPTION_NSA_ONLY; 2058e41f4b71Sopenharmony_ciradio.setNROptionMode(slotId, mode, (err: BusinessError) => { 2059e41f4b71Sopenharmony_ci if (err) { 2060e41f4b71Sopenharmony_ci console.error(`setNROptionMode failed, callback: err->${JSON.stringify(err)}`); 2061e41f4b71Sopenharmony_ci return; 2062e41f4b71Sopenharmony_ci } 2063e41f4b71Sopenharmony_ci console.log(`setNROptionMode success.`); 2064e41f4b71Sopenharmony_ci}); 2065e41f4b71Sopenharmony_ci``` 2066e41f4b71Sopenharmony_ci 2067e41f4b71Sopenharmony_ci 2068e41f4b71Sopenharmony_ci## radio.setNROptionMode<sup>10+</sup> 2069e41f4b71Sopenharmony_ci 2070e41f4b71Sopenharmony_cisetNROptionMode\(slotId: number, mode: NROptionMode\): Promise\<void\> 2071e41f4b71Sopenharmony_ci 2072e41f4b71Sopenharmony_ci设置NR选项模式 。使用Promise异步回调。 2073e41f4b71Sopenharmony_ci 2074e41f4b71Sopenharmony_ci**系统接口:** 此接口为系统接口。 2075e41f4b71Sopenharmony_ci 2076e41f4b71Sopenharmony_ci**需要权限**:ohos.permission.SET_TELEPHONY_STATE 2077e41f4b71Sopenharmony_ci 2078e41f4b71Sopenharmony_ci**系统能力**:SystemCapability.Telephony.CoreService 2079e41f4b71Sopenharmony_ci 2080e41f4b71Sopenharmony_ci**参数:** 2081e41f4b71Sopenharmony_ci 2082e41f4b71Sopenharmony_ci| 参数名 | 类型 | 必填 | 说明 | 2083e41f4b71Sopenharmony_ci| ------ | ------------------------------- | ---- | ------------------------------------- | 2084e41f4b71Sopenharmony_ci| slotId | number | 是 | 卡槽ID。<br/>- 0:卡槽1<br/>- 1:卡槽2 | 2085e41f4b71Sopenharmony_ci| mode | [NROptionMode](#nroptionmode10) | 是 | NR的选项模式。 | 2086e41f4b71Sopenharmony_ci 2087e41f4b71Sopenharmony_ci**返回值:** 2088e41f4b71Sopenharmony_ci 2089e41f4b71Sopenharmony_ci| 类型 | 说明 | 2090e41f4b71Sopenharmony_ci| ----------------- | ----------------------- | 2091e41f4b71Sopenharmony_ci| Promise\<void\> | 以Promise形式返回设置NR选项模式的结果。 | 2092e41f4b71Sopenharmony_ci 2093e41f4b71Sopenharmony_ci**错误码:** 2094e41f4b71Sopenharmony_ci 2095e41f4b71Sopenharmony_ci以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](errorcode-telephony.md)。 2096e41f4b71Sopenharmony_ci 2097e41f4b71Sopenharmony_ci| 错误码ID | 错误信息 | 2098e41f4b71Sopenharmony_ci| -------- | -------------------------------------------- | 2099e41f4b71Sopenharmony_ci| 201 | Permission denied. | 2100e41f4b71Sopenharmony_ci| 202 | Non-system applications use system APIs. | 2101e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. | 2102e41f4b71Sopenharmony_ci| 8300001 | Invalid parameter value. | 2103e41f4b71Sopenharmony_ci| 8300002 | Service connection failed. | 2104e41f4b71Sopenharmony_ci| 8300003 | System internal error. | 2105e41f4b71Sopenharmony_ci| 8300999 | Unknown error. | 2106e41f4b71Sopenharmony_ci 2107e41f4b71Sopenharmony_ci**示例:** 2108e41f4b71Sopenharmony_ci 2109e41f4b71Sopenharmony_ci```ts 2110e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 2111e41f4b71Sopenharmony_ci 2112e41f4b71Sopenharmony_cilet slotId: number = 0; 2113e41f4b71Sopenharmony_cilet mode: radio.NROptionMode = radio.NROptionMode.NR_OPTION_NSA_ONLY; 2114e41f4b71Sopenharmony_ciradio.setNROptionMode(slotId, mode).then(() => { 2115e41f4b71Sopenharmony_ci console.log(`setNROptionMode success`); 2116e41f4b71Sopenharmony_ci}).catch((err: BusinessError) => { 2117e41f4b71Sopenharmony_ci console.error(`setNROptionMode failed, promise: err->${JSON.stringify(err)}`); 2118e41f4b71Sopenharmony_ci}); 2119e41f4b71Sopenharmony_ci``` 2120e41f4b71Sopenharmony_ci 2121e41f4b71Sopenharmony_ci 2122e41f4b71Sopenharmony_ci## radio.getNROptionMode<sup>10+</sup> 2123e41f4b71Sopenharmony_ci 2124e41f4b71Sopenharmony_cigetNROptionMode\(slotId: number, callback: AsyncCallback\<NROptionMode\>\): void 2125e41f4b71Sopenharmony_ci 2126e41f4b71Sopenharmony_ci获取Nr选项模式 。使用callback异步回调。 2127e41f4b71Sopenharmony_ci 2128e41f4b71Sopenharmony_ci**系统接口:** 此接口为系统接口。 2129e41f4b71Sopenharmony_ci 2130e41f4b71Sopenharmony_ci**系统能力**:SystemCapability.Telephony.CoreService 2131e41f4b71Sopenharmony_ci 2132e41f4b71Sopenharmony_ci**参数:** 2133e41f4b71Sopenharmony_ci 2134e41f4b71Sopenharmony_ci| 参数名 | 类型 | 必填 | 说明 | 2135e41f4b71Sopenharmony_ci| -------- | ------------------------------------------------ | ---- | -------------------------------------- | 2136e41f4b71Sopenharmony_ci| slotId | number | 是 | 卡槽ID。<br/>- 0:卡槽1<br/>- 1:卡槽2 | 2137e41f4b71Sopenharmony_ci| callback | AsyncCallback\<[NROptionMode](#nroptionmode10)\> | 是 | 回调函数。返回NR选项模式。 | 2138e41f4b71Sopenharmony_ci 2139e41f4b71Sopenharmony_ci**错误码:** 2140e41f4b71Sopenharmony_ci 2141e41f4b71Sopenharmony_ci以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](errorcode-telephony.md)。 2142e41f4b71Sopenharmony_ci 2143e41f4b71Sopenharmony_ci| 错误码ID | 错误信息 | 2144e41f4b71Sopenharmony_ci| -------- | -------------------------------------------- | 2145e41f4b71Sopenharmony_ci| 202 | Non-system applications use system APIs. | 2146e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. | 2147e41f4b71Sopenharmony_ci| 8300001 | Invalid parameter value. | 2148e41f4b71Sopenharmony_ci| 8300002 | Service connection failed. | 2149e41f4b71Sopenharmony_ci| 8300003 | System internal error. | 2150e41f4b71Sopenharmony_ci| 8300999 | Unknown error. | 2151e41f4b71Sopenharmony_ci 2152e41f4b71Sopenharmony_ci**示例:** 2153e41f4b71Sopenharmony_ci 2154e41f4b71Sopenharmony_ci```ts 2155e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 2156e41f4b71Sopenharmony_ci 2157e41f4b71Sopenharmony_cilet slotId: number = 0; 2158e41f4b71Sopenharmony_ciradio.getNROptionMode(slotId, (err: BusinessError, data: radio.NROptionMode) => { 2159e41f4b71Sopenharmony_ci if (err) { 2160e41f4b71Sopenharmony_ci console.error(`getNROptionMode failed, callback: err->${JSON.stringify(err)}`); 2161e41f4b71Sopenharmony_ci return; 2162e41f4b71Sopenharmony_ci } 2163e41f4b71Sopenharmony_ci console.log(`getNROptionMode success, callback: data->${JSON.stringify(data)}`); 2164e41f4b71Sopenharmony_ci}); 2165e41f4b71Sopenharmony_ci``` 2166e41f4b71Sopenharmony_ci 2167e41f4b71Sopenharmony_ci## radio.getNROptionMode<sup>10+</sup> 2168e41f4b71Sopenharmony_ci 2169e41f4b71Sopenharmony_cigetNROptionMode\(slotId: number\): Promise\<NROptionMode\> 2170e41f4b71Sopenharmony_ci 2171e41f4b71Sopenharmony_ci获取NR选项模式 。使用Promise异步回调。 2172e41f4b71Sopenharmony_ci 2173e41f4b71Sopenharmony_ci**系统接口:** 此接口为系统接口。 2174e41f4b71Sopenharmony_ci 2175e41f4b71Sopenharmony_ci**系统能力**:SystemCapability.Telephony.CoreService 2176e41f4b71Sopenharmony_ci 2177e41f4b71Sopenharmony_ci**参数:** 2178e41f4b71Sopenharmony_ci 2179e41f4b71Sopenharmony_ci| 参数名 | 类型 | 必填 | 说明 | 2180e41f4b71Sopenharmony_ci| ------ | ------ | ---- | ------------------------------------- | 2181e41f4b71Sopenharmony_ci| slotId | number | 是 | 卡槽ID。<br/>- 0:卡槽1<br/>- 1:卡槽2 | 2182e41f4b71Sopenharmony_ci 2183e41f4b71Sopenharmony_ci**返回值:** 2184e41f4b71Sopenharmony_ci 2185e41f4b71Sopenharmony_ci| 类型 | 说明 | 2186e41f4b71Sopenharmony_ci| ----------------------------------------- | ----------------------- | 2187e41f4b71Sopenharmony_ci| Promise\<[NROptionMode](#nroptionmode10)\> | 以Promise形式返回NR选项模式。 | 2188e41f4b71Sopenharmony_ci 2189e41f4b71Sopenharmony_ci**错误码:** 2190e41f4b71Sopenharmony_ci 2191e41f4b71Sopenharmony_ci以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](errorcode-telephony.md)。 2192e41f4b71Sopenharmony_ci 2193e41f4b71Sopenharmony_ci| 错误码ID | 错误信息 | 2194e41f4b71Sopenharmony_ci| -------- | -------------------------------------------- | 2195e41f4b71Sopenharmony_ci| 202 | Non-system applications use system APIs. | 2196e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. | 2197e41f4b71Sopenharmony_ci| 8300001 | Invalid parameter value. | 2198e41f4b71Sopenharmony_ci| 8300002 | Service connection failed. | 2199e41f4b71Sopenharmony_ci| 8300003 | System internal error. | 2200e41f4b71Sopenharmony_ci| 8300999 | Unknown error. | 2201e41f4b71Sopenharmony_ci 2202e41f4b71Sopenharmony_ci**示例:** 2203e41f4b71Sopenharmony_ci 2204e41f4b71Sopenharmony_ci```ts 2205e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 2206e41f4b71Sopenharmony_ci 2207e41f4b71Sopenharmony_cilet slotId: number = 0; 2208e41f4b71Sopenharmony_ciradio.getNROptionMode(slotId).then((data: radio.NROptionMode) => { 2209e41f4b71Sopenharmony_ci console.log(`getNROptionMode success, promise: data->${JSON.stringify(data)}`); 2210e41f4b71Sopenharmony_ci}).catch((err: BusinessError) => { 2211e41f4b71Sopenharmony_ci console.error(`getNROptionMode failed, promise: err->${JSON.stringify(err)}`); 2212e41f4b71Sopenharmony_ci}); 2213e41f4b71Sopenharmony_ci``` 2214e41f4b71Sopenharmony_ci 2215e41f4b71Sopenharmony_ci 2216e41f4b71Sopenharmony_ci## radio.getNetworkCapability<sup>10+</sup> 2217e41f4b71Sopenharmony_ci 2218e41f4b71Sopenharmony_cigetNetworkCapability\(slotId: number, type: NetworkCapabilityType, callback: AsyncCallback\<NetworkCapabilityState\>\): void 2219e41f4b71Sopenharmony_ci 2220e41f4b71Sopenharmony_ci获取指定网络类型的开关状态。使用callback异步回调。 2221e41f4b71Sopenharmony_ci 2222e41f4b71Sopenharmony_ci**系统接口:** 此接口为系统接口。 2223e41f4b71Sopenharmony_ci 2224e41f4b71Sopenharmony_ci**需要权限**:ohos.permission.GET_TELEPHONY_STATE 2225e41f4b71Sopenharmony_ci 2226e41f4b71Sopenharmony_ci**系统能力**:SystemCapability.Telephony.CoreService 2227e41f4b71Sopenharmony_ci 2228e41f4b71Sopenharmony_ci**参数:** 2229e41f4b71Sopenharmony_ci 2230e41f4b71Sopenharmony_ci| 参数名 | 类型 | 必填 | 说明 | 2231e41f4b71Sopenharmony_ci| -------- | -----------------------------------------------------------------------| ---- | ----------------------------------- | 2232e41f4b71Sopenharmony_ci| slotId | number | 是 | 卡槽ID。<br/>- 0:卡槽1<br/>- 1:卡槽2 | 2233e41f4b71Sopenharmony_ci| type | [NetworkCapabilityType](#networkcapabilitytype10) | 是 | 网络能力类型。 | 2234e41f4b71Sopenharmony_ci| callback | AsyncCallback\<[NetworkCapabilityState](#networkcapabilitystate10)\> | 是 | 回调函数。返回指定网络类型的开关状态。 | 2235e41f4b71Sopenharmony_ci 2236e41f4b71Sopenharmony_ci**错误码:** 2237e41f4b71Sopenharmony_ci 2238e41f4b71Sopenharmony_ci以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](errorcode-telephony.md)。 2239e41f4b71Sopenharmony_ci 2240e41f4b71Sopenharmony_ci| 错误码ID | 错误信息 | 2241e41f4b71Sopenharmony_ci| -------- | -------------------------------------------- | 2242e41f4b71Sopenharmony_ci| 201 | Permission denied. | 2243e41f4b71Sopenharmony_ci| 202 | Non-system applications use system APIs. | 2244e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. | 2245e41f4b71Sopenharmony_ci| 8300001 | Invalid parameter value. | 2246e41f4b71Sopenharmony_ci| 8300002 | Service connection failed. | 2247e41f4b71Sopenharmony_ci| 8300003 | System internal error. | 2248e41f4b71Sopenharmony_ci| 8300999 | Unknown error. | 2249e41f4b71Sopenharmony_ci 2250e41f4b71Sopenharmony_ci**示例:** 2251e41f4b71Sopenharmony_ci 2252e41f4b71Sopenharmony_ci```ts 2253e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 2254e41f4b71Sopenharmony_ci 2255e41f4b71Sopenharmony_cilet slotId: number = 0; 2256e41f4b71Sopenharmony_cilet type: radio.NetworkCapabilityType = radio.NetworkCapabilityType.SERVICE_TYPE_NR; 2257e41f4b71Sopenharmony_ciradio.getNetworkCapability(slotId, type, (err: BusinessError, data: radio.NetworkCapabilityState) => { 2258e41f4b71Sopenharmony_ci if (err) { 2259e41f4b71Sopenharmony_ci console.error(`getNetworkCapability failed, callback: err->${JSON.stringify(err)}`); 2260e41f4b71Sopenharmony_ci return; 2261e41f4b71Sopenharmony_ci } 2262e41f4b71Sopenharmony_ci console.log(`getNetworkCapability success, callback: err->${JSON.stringify(err)}`); 2263e41f4b71Sopenharmony_ci}); 2264e41f4b71Sopenharmony_ci``` 2265e41f4b71Sopenharmony_ci 2266e41f4b71Sopenharmony_ci 2267e41f4b71Sopenharmony_ci## radio.getNetworkCapability<sup>10+</sup> 2268e41f4b71Sopenharmony_ci 2269e41f4b71Sopenharmony_cigetNetworkCapability\(slotId: number, type: NetworkCapabilityType\): Promise\<NetworkCapabilityState\> 2270e41f4b71Sopenharmony_ci 2271e41f4b71Sopenharmony_ci获取指定网络类型的开关状态。使用Promise异步回调。 2272e41f4b71Sopenharmony_ci 2273e41f4b71Sopenharmony_ci**系统接口:** 此接口为系统接口。 2274e41f4b71Sopenharmony_ci 2275e41f4b71Sopenharmony_ci**需要权限**:ohos.permission.GET_TELEPHONY_STATE 2276e41f4b71Sopenharmony_ci 2277e41f4b71Sopenharmony_ci**系统能力**:SystemCapability.Telephony.CoreService 2278e41f4b71Sopenharmony_ci 2279e41f4b71Sopenharmony_ci**参数:** 2280e41f4b71Sopenharmony_ci 2281e41f4b71Sopenharmony_ci| 参数名 | 类型 | 必填 | 说明 | 2282e41f4b71Sopenharmony_ci| -------- | --------------------------------------------------------------- | ---- | -------------------------------------- | 2283e41f4b71Sopenharmony_ci| slotId | number | 是 | 卡槽ID。<br/>- 0:卡槽1<br/>- 1:卡槽2 | 2284e41f4b71Sopenharmony_ci| type | [NetworkCapabilityType](#networkcapabilitytype10) | 是 | 网络能力类型。 | 2285e41f4b71Sopenharmony_ci 2286e41f4b71Sopenharmony_ci**返回值:** 2287e41f4b71Sopenharmony_ci 2288e41f4b71Sopenharmony_ci| 类型 | 说明 | 2289e41f4b71Sopenharmony_ci| ------------------------------------------------------------- | ----------------------- | 2290e41f4b71Sopenharmony_ci| Promise\<[NetworkCapabilityState](#networkcapabilitystate10)\> | 以Promise形式返回指定网络类型的开关状态。 | 2291e41f4b71Sopenharmony_ci 2292e41f4b71Sopenharmony_ci**错误码:** 2293e41f4b71Sopenharmony_ci 2294e41f4b71Sopenharmony_ci以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](errorcode-telephony.md)。 2295e41f4b71Sopenharmony_ci 2296e41f4b71Sopenharmony_ci| 错误码ID | 错误信息 | 2297e41f4b71Sopenharmony_ci| -------- | -------------------------------------------- | 2298e41f4b71Sopenharmony_ci| 201 | Permission denied. | 2299e41f4b71Sopenharmony_ci| 202 | Non-system applications use system APIs. | 2300e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. | 2301e41f4b71Sopenharmony_ci| 8300001 | Invalid parameter value. | 2302e41f4b71Sopenharmony_ci| 8300002 | Service connection failed. | 2303e41f4b71Sopenharmony_ci| 8300003 | System internal error. | 2304e41f4b71Sopenharmony_ci| 8300999 | Unknown error. | 2305e41f4b71Sopenharmony_ci 2306e41f4b71Sopenharmony_ci**示例:** 2307e41f4b71Sopenharmony_ci 2308e41f4b71Sopenharmony_ci```ts 2309e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 2310e41f4b71Sopenharmony_ci 2311e41f4b71Sopenharmony_cilet slotId: number = 0; 2312e41f4b71Sopenharmony_cilet type: radio.NetworkCapabilityType = radio.NetworkCapabilityType.SERVICE_TYPE_NR; 2313e41f4b71Sopenharmony_ciradio.getNetworkCapability(slotId, type).then((data: radio.NetworkCapabilityState) => { 2314e41f4b71Sopenharmony_ci console.log(`getNetworkCapability success, promise: data->${JSON.stringify(data)}`); 2315e41f4b71Sopenharmony_ci}).catch((err: BusinessError) => { 2316e41f4b71Sopenharmony_ci console.error(`getNetworkCapability failed, promise: err->${JSON.stringify(err)}`); 2317e41f4b71Sopenharmony_ci}); 2318e41f4b71Sopenharmony_ci``` 2319e41f4b71Sopenharmony_ci 2320e41f4b71Sopenharmony_ci 2321e41f4b71Sopenharmony_ci## radio.setNetworkCapability<sup>10+</sup> 2322e41f4b71Sopenharmony_ci 2323e41f4b71Sopenharmony_cisetNetworkCapability\(slotId: number, type: NetworkCapabilityType, state: NetworkCapabilityState, 2324e41f4b71Sopenharmony_ci callback: AsyncCallback\<void\>\): void 2325e41f4b71Sopenharmony_ci 2326e41f4b71Sopenharmony_ci设置指定网络类型的开关状态。使用callback异步回调。 2327e41f4b71Sopenharmony_ci 2328e41f4b71Sopenharmony_ci**系统接口:** 此接口为系统接口。 2329e41f4b71Sopenharmony_ci 2330e41f4b71Sopenharmony_ci**需要权限**:ohos.permission.SET_TELEPHONY_STATE 2331e41f4b71Sopenharmony_ci 2332e41f4b71Sopenharmony_ci**系统能力**:SystemCapability.Telephony.CoreService 2333e41f4b71Sopenharmony_ci 2334e41f4b71Sopenharmony_ci**参数:** 2335e41f4b71Sopenharmony_ci 2336e41f4b71Sopenharmony_ci| 参数名 | 类型 | 必填 | 说明 | 2337e41f4b71Sopenharmony_ci| -------- | --------------------------------------------------------------- | ---- | -------------------------------------- | 2338e41f4b71Sopenharmony_ci| slotId | number | 是 | 卡槽ID。<br/>- 0:卡槽1<br/>- 1:卡槽2 | 2339e41f4b71Sopenharmony_ci| type | [NetworkCapabilityType](#networkcapabilitytype10) | 是 | 网络能力类型。 | 2340e41f4b71Sopenharmony_ci| state | [NetworkCapabilityState](#networkcapabilitystate10) | 是 | 网络能力状态。 | 2341e41f4b71Sopenharmony_ci| callback | AsyncCallback\<void\> | 是 | 回调函数。返回设置指定网络类型的开关状态的结果。 | 2342e41f4b71Sopenharmony_ci 2343e41f4b71Sopenharmony_ci**错误码:** 2344e41f4b71Sopenharmony_ci 2345e41f4b71Sopenharmony_ci以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](errorcode-telephony.md)。 2346e41f4b71Sopenharmony_ci 2347e41f4b71Sopenharmony_ci| 错误码ID | 错误信息 | 2348e41f4b71Sopenharmony_ci| -------- | -------------------------------------------- | 2349e41f4b71Sopenharmony_ci| 201 | Permission denied. | 2350e41f4b71Sopenharmony_ci| 202 | Non-system applications use system APIs. | 2351e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. | 2352e41f4b71Sopenharmony_ci| 8300001 | Invalid parameter value. | 2353e41f4b71Sopenharmony_ci| 8300002 | Service connection failed. | 2354e41f4b71Sopenharmony_ci| 8300003 | System internal error. | 2355e41f4b71Sopenharmony_ci| 8300999 | Unknown error. | 2356e41f4b71Sopenharmony_ci 2357e41f4b71Sopenharmony_ci**示例:** 2358e41f4b71Sopenharmony_ci 2359e41f4b71Sopenharmony_ci```ts 2360e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 2361e41f4b71Sopenharmony_ci 2362e41f4b71Sopenharmony_cilet slotId: number = 0; 2363e41f4b71Sopenharmony_cilet type: radio.NetworkCapabilityType = radio.NetworkCapabilityType.SERVICE_TYPE_NR; 2364e41f4b71Sopenharmony_cilet state: radio.NetworkCapabilityState = radio.NetworkCapabilityState.SERVICE_CAPABILITY_ON; 2365e41f4b71Sopenharmony_ciradio.setNetworkCapability(slotId, type, state, (err: BusinessError) => { 2366e41f4b71Sopenharmony_ci if (err) { 2367e41f4b71Sopenharmony_ci console.error(`setNetworkCapability failed, callback: err->${JSON.stringify(err)}`); 2368e41f4b71Sopenharmony_ci return; 2369e41f4b71Sopenharmony_ci } 2370e41f4b71Sopenharmony_ci console.log(`setNetworkCapability success.`); 2371e41f4b71Sopenharmony_ci}); 2372e41f4b71Sopenharmony_ci``` 2373e41f4b71Sopenharmony_ci 2374e41f4b71Sopenharmony_ci 2375e41f4b71Sopenharmony_ci## radio.setNetworkCapability<sup>10+</sup> 2376e41f4b71Sopenharmony_ci 2377e41f4b71Sopenharmony_cisetNetworkCapability\(slotId: number, type: NetworkCapabilityType, state: NetworkCapabilityState\): Promise\<void\> 2378e41f4b71Sopenharmony_ci 2379e41f4b71Sopenharmony_ci设置指定网络类型的开关状态。使用Promise异步回调。 2380e41f4b71Sopenharmony_ci 2381e41f4b71Sopenharmony_ci**系统接口:** 此接口为系统接口。 2382e41f4b71Sopenharmony_ci 2383e41f4b71Sopenharmony_ci**需要权限**:ohos.permission.SET_TELEPHONY_STATE 2384e41f4b71Sopenharmony_ci 2385e41f4b71Sopenharmony_ci**系统能力**:SystemCapability.Telephony.CoreService 2386e41f4b71Sopenharmony_ci 2387e41f4b71Sopenharmony_ci**参数:** 2388e41f4b71Sopenharmony_ci 2389e41f4b71Sopenharmony_ci| 参数名 | 类型 | 必填 | 说明 | 2390e41f4b71Sopenharmony_ci| -------- | --------------------------------------------------------------- | ---- | -------------------------------------- | 2391e41f4b71Sopenharmony_ci| slotId | number | 是 | 卡槽ID。<br/>- 0:卡槽1<br/>- 1:卡槽2 | 2392e41f4b71Sopenharmony_ci| type | [NetworkCapabilityType](#networkcapabilitytype10) | 是 | 网络能力类型。 | 2393e41f4b71Sopenharmony_ci| state | [NetworkCapabilityState](#networkcapabilitystate10) | 是 | 网络能力状态。 | 2394e41f4b71Sopenharmony_ci 2395e41f4b71Sopenharmony_ci**返回值:** 2396e41f4b71Sopenharmony_ci 2397e41f4b71Sopenharmony_ci| 类型 | 说明 | 2398e41f4b71Sopenharmony_ci| --------------- | ----------------------- | 2399e41f4b71Sopenharmony_ci| Promise\<void\> | 以Promise形式返回设置指定网络类型的开关状态的结果。 | 2400e41f4b71Sopenharmony_ci 2401e41f4b71Sopenharmony_ci**错误码:** 2402e41f4b71Sopenharmony_ci 2403e41f4b71Sopenharmony_ci以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](errorcode-telephony.md)。 2404e41f4b71Sopenharmony_ci 2405e41f4b71Sopenharmony_ci| 错误码ID | 错误信息 | 2406e41f4b71Sopenharmony_ci| -------- | -------------------------------------------- | 2407e41f4b71Sopenharmony_ci| 201 | Permission denied. | 2408e41f4b71Sopenharmony_ci| 202 | Non-system applications use system APIs. | 2409e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. | 2410e41f4b71Sopenharmony_ci| 8300001 | Invalid parameter value. | 2411e41f4b71Sopenharmony_ci| 8300002 | Service connection failed. | 2412e41f4b71Sopenharmony_ci| 8300003 | System internal error. | 2413e41f4b71Sopenharmony_ci| 8300999 | Unknown error. | 2414e41f4b71Sopenharmony_ci 2415e41f4b71Sopenharmony_ci**示例:** 2416e41f4b71Sopenharmony_ci 2417e41f4b71Sopenharmony_ci```ts 2418e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 2419e41f4b71Sopenharmony_ci 2420e41f4b71Sopenharmony_cilet slotId: number = 0; 2421e41f4b71Sopenharmony_cilet type: radio.NetworkCapabilityType = radio.NetworkCapabilityType.SERVICE_TYPE_NR; 2422e41f4b71Sopenharmony_cilet state: radio.NetworkCapabilityState = radio.NetworkCapabilityState.SERVICE_CAPABILITY_ON; 2423e41f4b71Sopenharmony_ciradio.setNetworkCapability(slotId, type, state).then(() => { 2424e41f4b71Sopenharmony_ci console.log(`setNetworkCapability success`); 2425e41f4b71Sopenharmony_ci}).catch((err: BusinessError) => { 2426e41f4b71Sopenharmony_ci console.error(`setNetworkCapability failed, promise: err->${JSON.stringify(err)}`); 2427e41f4b71Sopenharmony_ci}); 2428e41f4b71Sopenharmony_ci``` 2429e41f4b71Sopenharmony_ci 2430e41f4b71Sopenharmony_ci## radio.factoryReset<sup>11+</sup> 2431e41f4b71Sopenharmony_ci 2432e41f4b71Sopenharmony_cifactoryReset\(slotId: number\): Promise\<void\> 2433e41f4b71Sopenharmony_ci 2434e41f4b71Sopenharmony_ci重置网络状态设置。使用Promise异步回调。 2435e41f4b71Sopenharmony_ci 2436e41f4b71Sopenharmony_ci**系统接口:** 此接口为系统接口。 2437e41f4b71Sopenharmony_ci 2438e41f4b71Sopenharmony_ci**需要权限**:ohos.permission.SET_TELEPHONY_STATE 2439e41f4b71Sopenharmony_ci 2440e41f4b71Sopenharmony_ci**系统能力**:SystemCapability.Telephony.CoreService 2441e41f4b71Sopenharmony_ci 2442e41f4b71Sopenharmony_ci**参数:** 2443e41f4b71Sopenharmony_ci 2444e41f4b71Sopenharmony_ci| 参数名 | 类型 | 必填 | 说明 | 2445e41f4b71Sopenharmony_ci| -------- | --------------------------------------------------------------- | ---- | -------------------------------------- | 2446e41f4b71Sopenharmony_ci| slotId | number | 是 | 卡槽ID。<br/>- 0:卡槽1<br/>- 1:卡槽2 | 2447e41f4b71Sopenharmony_ci 2448e41f4b71Sopenharmony_ci**返回值:** 2449e41f4b71Sopenharmony_ci 2450e41f4b71Sopenharmony_ci| 类型 | 说明 | 2451e41f4b71Sopenharmony_ci| --------------- | ----------------------- | 2452e41f4b71Sopenharmony_ci| Promise\<void\> | 以Promise形式返回重置网络状态设置的结果。 | 2453e41f4b71Sopenharmony_ci 2454e41f4b71Sopenharmony_ci**错误码:** 2455e41f4b71Sopenharmony_ci 2456e41f4b71Sopenharmony_ci以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](errorcode-telephony.md)。 2457e41f4b71Sopenharmony_ci 2458e41f4b71Sopenharmony_ci| 错误码ID | 错误信息 | 2459e41f4b71Sopenharmony_ci| -------- | -------------------------------------------- | 2460e41f4b71Sopenharmony_ci| 201 | Permission denied. | 2461e41f4b71Sopenharmony_ci| 202 | Non-system applications use system APIs. | 2462e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. | 2463e41f4b71Sopenharmony_ci| 8300001 | Invalid parameter value. | 2464e41f4b71Sopenharmony_ci| 8300002 | Service connection failed. | 2465e41f4b71Sopenharmony_ci| 8300003 | System internal error. | 2466e41f4b71Sopenharmony_ci| 8300999 | Unknown error. | 2467e41f4b71Sopenharmony_ci 2468e41f4b71Sopenharmony_ci**示例:** 2469e41f4b71Sopenharmony_ci 2470e41f4b71Sopenharmony_ci```ts 2471e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 2472e41f4b71Sopenharmony_ci 2473e41f4b71Sopenharmony_cilet slotId: number = 0; 2474e41f4b71Sopenharmony_ciradio.factoryReset(slotId).then(() => { 2475e41f4b71Sopenharmony_ci console.log(`factoryReset success`); 2476e41f4b71Sopenharmony_ci}).catch((err: BusinessError) => { 2477e41f4b71Sopenharmony_ci console.error(`factoryReset failed, promise: err->${JSON.stringify(err)}`); 2478e41f4b71Sopenharmony_ci}); 2479e41f4b71Sopenharmony_ci``` 2480e41f4b71Sopenharmony_ci 2481e41f4b71Sopenharmony_ci## radio.getIMEISV<sup>12+</sup> 2482e41f4b71Sopenharmony_ci 2483e41f4b71Sopenharmony_cigetIMEISV\(slotId: number\): string 2484e41f4b71Sopenharmony_ci 2485e41f4b71Sopenharmony_ci获取设备指定卡槽的软件版本号。 2486e41f4b71Sopenharmony_ci 2487e41f4b71Sopenharmony_ci**系统接口:** 此接口为系统接口。 2488e41f4b71Sopenharmony_ci 2489e41f4b71Sopenharmony_ci**需要权限**:ohos.permission.GET_TELEPHONY_STATE 2490e41f4b71Sopenharmony_ci 2491e41f4b71Sopenharmony_ci**系统能力**:SystemCapability.Telephony.CoreService 2492e41f4b71Sopenharmony_ci 2493e41f4b71Sopenharmony_ci**参数:** 2494e41f4b71Sopenharmony_ci 2495e41f4b71Sopenharmony_ci| 参数名 | 类型 | 必填 | 说明 | 2496e41f4b71Sopenharmony_ci| ------ | ------ | ---- | -------------------------------------- | 2497e41f4b71Sopenharmony_ci| slotId | number | 否 | 卡槽ID。<br/>- 0:卡槽1<br/>- 1:卡槽2 | 2498e41f4b71Sopenharmony_ci 2499e41f4b71Sopenharmony_ci 2500e41f4b71Sopenharmony_ci**错误码:** 2501e41f4b71Sopenharmony_ci 2502e41f4b71Sopenharmony_ci以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](errorcode-telephony.md)。 2503e41f4b71Sopenharmony_ci 2504e41f4b71Sopenharmony_ci| 错误码ID | 错误信息 | 2505e41f4b71Sopenharmony_ci| -------- | -------------------------------------------- | 2506e41f4b71Sopenharmony_ci| 201 | Permission denied. | 2507e41f4b71Sopenharmony_ci| 202 | Non-system applications use system APIs. | 2508e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. | 2509e41f4b71Sopenharmony_ci| 8300001 | Invalid parameter value. | 2510e41f4b71Sopenharmony_ci| 8300002 | Service connection failed. | 2511e41f4b71Sopenharmony_ci| 8300003 | System internal error. | 2512e41f4b71Sopenharmony_ci| 8300999 | Unknown error. | 2513e41f4b71Sopenharmony_ci 2514e41f4b71Sopenharmony_ci**示例:** 2515e41f4b71Sopenharmony_ci 2516e41f4b71Sopenharmony_ci```ts 2517e41f4b71Sopenharmony_cilet slotId: number = 0; 2518e41f4b71Sopenharmony_cilet data: string = radio.getIMEISV(slotId); 2519e41f4b71Sopenharmony_ciconsole.log(`IMEISV is:` + data); 2520e41f4b71Sopenharmony_ci``` 2521e41f4b71Sopenharmony_ci 2522e41f4b71Sopenharmony_ci## PreferredNetworkMode<sup>8+</sup> 2523e41f4b71Sopenharmony_ci 2524e41f4b71Sopenharmony_ci首选网络模式。 2525e41f4b71Sopenharmony_ci 2526e41f4b71Sopenharmony_ci**系统接口:** 此接口为系统接口。 2527e41f4b71Sopenharmony_ci 2528e41f4b71Sopenharmony_ci**系统能力**:SystemCapability.Telephony.CoreService 2529e41f4b71Sopenharmony_ci 2530e41f4b71Sopenharmony_ci| 名称 | 值 | 说明 | 2531e41f4b71Sopenharmony_ci| --------------------------------------------------------- | ---- | --------------------------------------------- | 2532e41f4b71Sopenharmony_ci| PREFERRED_NETWORK_MODE_GSM | 1 | 首选GSM网络模式。 | 2533e41f4b71Sopenharmony_ci| PREFERRED_NETWORK_MODE_WCDMA | 2 | 首选WCDMA网络模式。 | 2534e41f4b71Sopenharmony_ci| PREFERRED_NETWORK_MODE_LTE | 3 | 首选LTE网络模式。 | 2535e41f4b71Sopenharmony_ci| PREFERRED_NETWORK_MODE_LTE_WCDMA | 4 | 首选LTE WCDMA网络模式。 | 2536e41f4b71Sopenharmony_ci| PREFERRED_NETWORK_MODE_LTE_WCDMA_GSM | 5 | 首选LTE WCDMA GSM网络模式。 | 2537e41f4b71Sopenharmony_ci| PREFERRED_NETWORK_MODE_WCDMA_GSM | 6 | 首选WCDMA GSM网络模式。 | 2538e41f4b71Sopenharmony_ci| PREFERRED_NETWORK_MODE_CDMA | 7 | 首选CDMA网络模式。 | 2539e41f4b71Sopenharmony_ci| PREFERRED_NETWORK_MODE_EVDO | 8 | 首选EVDO网络模式。 | 2540e41f4b71Sopenharmony_ci| PREFERRED_NETWORK_MODE_EVDO_CDMA | 9 | 首选EVDO CDMA网络模式。 | 2541e41f4b71Sopenharmony_ci| PREFERRED_NETWORK_MODE_WCDMA_GSM_EVDO_CDMA | 10 | 首选WCDMA GSM EVDO CDMA网络模式。 | 2542e41f4b71Sopenharmony_ci| PREFERRED_NETWORK_MODE_LTE_EVDO_CDMA | 11 | 首选LTE EVDO CDMA网络模式。 | 2543e41f4b71Sopenharmony_ci| PREFERRED_NETWORK_MODE_LTE_WCDMA_GSM_EVDO_CDMA | 12 | 首选LTE WCDMA GSM EVDO CDMA网络模式。 | 2544e41f4b71Sopenharmony_ci| PREFERRED_NETWORK_MODE_TDSCDMA | 13 | 首选TDSCDMA网络模式。 | 2545e41f4b71Sopenharmony_ci| PREFERRED_NETWORK_MODE_TDSCDMA_GSM | 14 | 首选TDSCDMA GSM网络模式。 | 2546e41f4b71Sopenharmony_ci| PREFERRED_NETWORK_MODE_TDSCDMA_WCDMA | 15 | 首选TDSCDMA_WCDMA网络模式。 | 2547e41f4b71Sopenharmony_ci| PREFERRED_NETWORK_MODE_TDSCDMA_WCDMA_GSM | 16 | 首选TDSCDMA_WCDMA_GSM网络模式。 | 2548e41f4b71Sopenharmony_ci| PREFERRED_NETWORK_MODE_LTE_TDSCDMA | 17 | 首选LTE TDSCDMA网络模式。 | 2549e41f4b71Sopenharmony_ci| PREFERRED_NETWORK_MODE_LTE_TDSCDMA_GSM | 18 | 首选LTE TDSCDMA GSM网络模式。 | 2550e41f4b71Sopenharmony_ci| PREFERRED_NETWORK_MODE_LTE_TDSCDMA_WCDMA | 19 | 首选LTE TDSCDMA WCDMA网络模式。 | 2551e41f4b71Sopenharmony_ci| PREFERRED_NETWORK_MODE_LTE_TDSCDMA_WCDMA_GSM | 20 | 首选LTE TDSCDMA WCDMA GSM网络模式。 | 2552e41f4b71Sopenharmony_ci| PREFERRED_NETWORK_MODE_TDSCDMA_WCDMA_GSM_EVDO_CDMA | 21 | 首选TDSCDMA WCDMA GSM EVDO CDMA网络模式。 | 2553e41f4b71Sopenharmony_ci| PREFERRED_NETWORK_MODE_LTE_TDSCDMA_WCDMA_GSM_EVDO_CDMA | 22 | 首选LTE TDSCDMA WCDMA GSM EVDO CDMA网络模式。 | 2554e41f4b71Sopenharmony_ci| PREFERRED_NETWORK_MODE_NR | 31 | 首选NR网络模式。 | 2555e41f4b71Sopenharmony_ci| PREFERRED_NETWORK_MODE_NR_LTE | 32 | 首选NR LTE网络模式。 | 2556e41f4b71Sopenharmony_ci| PREFERRED_NETWORK_MODE_NR_LTE_WCDMA | 33 | 首选NR LTE WCDMA网络模式。 | 2557e41f4b71Sopenharmony_ci| PREFERRED_NETWORK_MODE_NR_LTE_WCDMA_GSM | 34 | 首选NR LTE WCDMA GSM网络模式。 | 2558e41f4b71Sopenharmony_ci| PREFERRED_NETWORK_MODE_NR_LTE_EVDO_CDMA | 35 | 首选NR LTE EVDO CDMA网络模式。 | 2559e41f4b71Sopenharmony_ci| PREFERRED_NETWORK_MODE_NR_LTE_WCDMA_GSM_EVDO_CDMA | 36 | 首选NR LTE WCDMA GSM EVDO CDMA网络模式。 | 2560e41f4b71Sopenharmony_ci| PREFERRED_NETWORK_MODE_NR_LTE_TDSCDMA | 37 | 首选NR LTE TDSCDMA网络模式。 | 2561e41f4b71Sopenharmony_ci| PREFERRED_NETWORK_MODE_NR_LTE_TDSCDMA_GSM | 38 | 首选NR LTE TDSCDMA GSM网络模式。 | 2562e41f4b71Sopenharmony_ci| PREFERRED_NETWORK_MODE_NR_LTE_TDSCDMA_WCDMA | 39 | 首选NR LTE TDSCDMA WCDMA网络模式。 | 2563e41f4b71Sopenharmony_ci| PREFERRED_NETWORK_MODE_NR_LTE_TDSCDMA_WCDMA_GSM | 40 | 首选NR LTE TDSCDMA WCDMA GSM网络模式。 | 2564e41f4b71Sopenharmony_ci| PREFERRED_NETWORK_MODE_NR_LTE_TDSCDMA_WCDMA_GSM_EVDO_CDMA | 41 | 首选NR LTE TDSCDMA WCDMA GSM EVDO CDMA网络模式。 | 2565e41f4b71Sopenharmony_ci| PREFERRED_NETWORK_MODE_MAX_VALUE | 99 | 首选网络模式最大值。 | 2566e41f4b71Sopenharmony_ci 2567e41f4b71Sopenharmony_ci## CellInformation<sup>8+</sup> 2568e41f4b71Sopenharmony_ci 2569e41f4b71Sopenharmony_ci小区信息。 2570e41f4b71Sopenharmony_ci 2571e41f4b71Sopenharmony_ci**系统能力**:SystemCapability.Telephony.CoreService 2572e41f4b71Sopenharmony_ci 2573e41f4b71Sopenharmony_ci| 名称 | 类型 | 必填 | 说明 | 2574e41f4b71Sopenharmony_ci| ----------------- | --------------------------------------- | ---- | ------------------------------------------------------------ | 2575e41f4b71Sopenharmony_ci| isCamped | boolean | 是 | 获取服务单元的状态。<br>**系统接口:** 此接口为系统接口。 | 2576e41f4b71Sopenharmony_ci| timeStamp | number | 是 | 获取单元格信息时获取时间戳。<br>**系统接口:** 此接口为系统接口。 | 2577e41f4b71Sopenharmony_ci| data | [CdmaCellInformation](#cdmacellinformation8) \| [GsmCellInformation](#gsmcellinformation8) \| [LteCellInformation](#ltecellinformation8) \| [NrCellInformation](#nrcellinformation8) \| [TdscdmaCellInformation](#tdscdmacellinformation8)\|[WcdmaCellInformation](#wcdmacellinformation8) | 是 | Cdma小区信息 \|Gsm小区信息\|Lte小区信息\|Nr小区信息\|Tdscdma小区信息\|Wcdma小区信息。 <br>**系统接口:** 此接口为系统接口。| 2578e41f4b71Sopenharmony_ci 2579e41f4b71Sopenharmony_ci## CdmaCellInformation<sup>8+</sup> 2580e41f4b71Sopenharmony_ci 2581e41f4b71Sopenharmony_ciCDMA小区信息。 2582e41f4b71Sopenharmony_ci 2583e41f4b71Sopenharmony_ci**系统接口:** 此接口为系统接口。 2584e41f4b71Sopenharmony_ci 2585e41f4b71Sopenharmony_ci**系统能力**:SystemCapability.Telephony.CoreService 2586e41f4b71Sopenharmony_ci 2587e41f4b71Sopenharmony_ci| 名称 | 类型 | 必填 | 说明 | 2588e41f4b71Sopenharmony_ci| --------- | ------ | ---- | ------------ | 2589e41f4b71Sopenharmony_ci| baseId | number | 是 | 基站Id。 | 2590e41f4b71Sopenharmony_ci| latitude | number | 是 | 纬度。 | 2591e41f4b71Sopenharmony_ci| longitude | number | 是 | 经度。 | 2592e41f4b71Sopenharmony_ci| nid | number | 是 | 网络识别码。 | 2593e41f4b71Sopenharmony_ci| sid | number | 是 | 系统识别码。 | 2594e41f4b71Sopenharmony_ci 2595e41f4b71Sopenharmony_ci## GsmCellInformation<sup>8+</sup> 2596e41f4b71Sopenharmony_ci 2597e41f4b71Sopenharmony_ciGSM小区信息。 2598e41f4b71Sopenharmony_ci 2599e41f4b71Sopenharmony_ci**系统接口:** 此接口为系统接口。 2600e41f4b71Sopenharmony_ci 2601e41f4b71Sopenharmony_ci**系统能力**:SystemCapability.Telephony.CoreService 2602e41f4b71Sopenharmony_ci 2603e41f4b71Sopenharmony_ci| 名称 | 类型 | 必填 | 说明 | 2604e41f4b71Sopenharmony_ci| ------ | ------ | ---- | -------------------- | 2605e41f4b71Sopenharmony_ci| lac | number | 是 | 位置区编号。 | 2606e41f4b71Sopenharmony_ci| cellId | number | 是 | 小区号。 | 2607e41f4b71Sopenharmony_ci| arfcn | number | 是 | 绝对无线频率信道号。 | 2608e41f4b71Sopenharmony_ci| bsic | number | 是 | 基站识别号。 | 2609e41f4b71Sopenharmony_ci| mcc | string | 是 | 移动国家码。 | 2610e41f4b71Sopenharmony_ci| mnc | string | 是 | 移动网号。 | 2611e41f4b71Sopenharmony_ci 2612e41f4b71Sopenharmony_ci## LteCellInformation<sup>8+</sup> 2613e41f4b71Sopenharmony_ci 2614e41f4b71Sopenharmony_ciLTE小区信息。 2615e41f4b71Sopenharmony_ci 2616e41f4b71Sopenharmony_ci**系统接口:** 此接口为系统接口。 2617e41f4b71Sopenharmony_ci 2618e41f4b71Sopenharmony_ci**系统能力**:SystemCapability.Telephony.CoreService 2619e41f4b71Sopenharmony_ci 2620e41f4b71Sopenharmony_ci| 名称 | 类型 | 必填 | 说明 | 2621e41f4b71Sopenharmony_ci| ------------- | ------- | ---- | ----------------------- | 2622e41f4b71Sopenharmony_ci| cgi | number | 是 | 小区全球标识。 | 2623e41f4b71Sopenharmony_ci| pci | number | 是 | 物理小区识别。 | 2624e41f4b71Sopenharmony_ci| tac | number | 是 | 跟踪区域代码。 | 2625e41f4b71Sopenharmony_ci| earfcn | number | 是 | 绝对无线频率信道号。 | 2626e41f4b71Sopenharmony_ci| bandwidth | number | 是 | 带宽。 | 2627e41f4b71Sopenharmony_ci| mcc | string | 是 | 移动国家码。 | 2628e41f4b71Sopenharmony_ci| mnc | string | 是 | 移动网号。 | 2629e41f4b71Sopenharmony_ci| isSupportEndc | boolean | 是 | 是否支持新无线电_双连接。 | 2630e41f4b71Sopenharmony_ci 2631e41f4b71Sopenharmony_ci## NrCellInformation<sup>8+</sup> 2632e41f4b71Sopenharmony_ci 2633e41f4b71Sopenharmony_ciNR小区信息。 2634e41f4b71Sopenharmony_ci 2635e41f4b71Sopenharmony_ci**系统接口:** 此接口为系统接口。 2636e41f4b71Sopenharmony_ci 2637e41f4b71Sopenharmony_ci**系统能力**:SystemCapability.Telephony.CoreService 2638e41f4b71Sopenharmony_ci 2639e41f4b71Sopenharmony_ci| 名称 | 类型 | 必填 | 说明 | 2640e41f4b71Sopenharmony_ci| ------- | ------ | ---- | ---------------- | 2641e41f4b71Sopenharmony_ci| nrArfcn | number | 是 | 5G频点号。 | 2642e41f4b71Sopenharmony_ci| pci | number | 是 | 物理小区识别。 | 2643e41f4b71Sopenharmony_ci| tac | number | 是 | 跟踪区域代码。 | 2644e41f4b71Sopenharmony_ci| nci | number | 是 | 5G网络小区标识。 | 2645e41f4b71Sopenharmony_ci| mcc | string | 是 | 移动国家码。 | 2646e41f4b71Sopenharmony_ci| mnc | string | 是 | 移动网号。 | 2647e41f4b71Sopenharmony_ci 2648e41f4b71Sopenharmony_ci## TdscdmaCellInformation<sup>8+</sup> 2649e41f4b71Sopenharmony_ci 2650e41f4b71Sopenharmony_ciTD-SCDMA小区信息。 2651e41f4b71Sopenharmony_ci 2652e41f4b71Sopenharmony_ci**系统接口:** 此接口为系统接口。 2653e41f4b71Sopenharmony_ci 2654e41f4b71Sopenharmony_ci**系统能力**:SystemCapability.Telephony.CoreService 2655e41f4b71Sopenharmony_ci 2656e41f4b71Sopenharmony_ci| 名称 | 类型 | 必填 | 说明 | 2657e41f4b71Sopenharmony_ci| ------ | ------ | ---- | ------------ | 2658e41f4b71Sopenharmony_ci| lac | number | 是 | 位置区编号。 | 2659e41f4b71Sopenharmony_ci| cellId | number | 是 | 小区号。 | 2660e41f4b71Sopenharmony_ci| cpid | number | 是 | 小区参数Id。 | 2661e41f4b71Sopenharmony_ci| uarfcn | number | 是 | 绝对射频号。 | 2662e41f4b71Sopenharmony_ci| mcc | string | 是 | 移动国家码。 | 2663e41f4b71Sopenharmony_ci| mnc | string | 是 | 移动网号。 | 2664e41f4b71Sopenharmony_ci 2665e41f4b71Sopenharmony_ci## WcdmaCellInformation<sup>8+</sup> 2666e41f4b71Sopenharmony_ci 2667e41f4b71Sopenharmony_ciWCDMA小区信息。 2668e41f4b71Sopenharmony_ci 2669e41f4b71Sopenharmony_ci**系统接口:** 此接口为系统接口。 2670e41f4b71Sopenharmony_ci 2671e41f4b71Sopenharmony_ci**系统能力**:SystemCapability.Telephony.CoreService 2672e41f4b71Sopenharmony_ci 2673e41f4b71Sopenharmony_ci| 名称 | 类型 | 必填 | 说明 | 2674e41f4b71Sopenharmony_ci| ------ | ------ | ---- | ------------ | 2675e41f4b71Sopenharmony_ci| lac | number | 是 | 位置区编号。 | 2676e41f4b71Sopenharmony_ci| cellId | number | 是 | 小区号。 | 2677e41f4b71Sopenharmony_ci| psc | number | 是 | 主扰码。 | 2678e41f4b71Sopenharmony_ci| uarfcn | number | 是 | 绝对射频号。 | 2679e41f4b71Sopenharmony_ci| mcc | string | 是 | 移动国家码。 | 2680e41f4b71Sopenharmony_ci| mnc | string | 是 | 移动网号。 | 2681e41f4b71Sopenharmony_ci 2682e41f4b71Sopenharmony_ci## NrOptionMode<sup>(deprecated)</sup> 2683e41f4b71Sopenharmony_ci 2684e41f4b71Sopenharmony_ciNR的选择模式。 2685e41f4b71Sopenharmony_ci 2686e41f4b71Sopenharmony_ci> **说明:** 2687e41f4b71Sopenharmony_ci> 2688e41f4b71Sopenharmony_ci> 从 API version 8开始支持,从API version 10开始废弃。建议使用[NROptionMode](#nroptionmode10)替代。 2689e41f4b71Sopenharmony_ci 2690e41f4b71Sopenharmony_ci**系统接口:** 此接口为系统接口。 2691e41f4b71Sopenharmony_ci 2692e41f4b71Sopenharmony_ci**系统能力**:SystemCapability.Telephony.CoreService 2693e41f4b71Sopenharmony_ci 2694e41f4b71Sopenharmony_ci| 名称 | 值 | 说明 | 2695e41f4b71Sopenharmony_ci| -------------------- | ---- | ---------------------------------- | 2696e41f4b71Sopenharmony_ci| NR_OPTION_UNKNOWN | 0 | 未知的NR选择模式。 | 2697e41f4b71Sopenharmony_ci| NR_OPTION_NSA_ONLY | 1 | 仅非独立组网的NR选择模式。 | 2698e41f4b71Sopenharmony_ci| NR_OPTION_SA_ONLY | 2 | 仅独立组网的NR选择模式。 | 2699e41f4b71Sopenharmony_ci| NR_OPTION_NSA_AND_SA | 3 | 非独立组网和独立组网的NR选择模式。 | 2700e41f4b71Sopenharmony_ci 2701e41f4b71Sopenharmony_ci## NROptionMode<sup>10+</sup> 2702e41f4b71Sopenharmony_ci 2703e41f4b71Sopenharmony_ciNR的选择模式。 2704e41f4b71Sopenharmony_ci 2705e41f4b71Sopenharmony_ci**系统接口:** 此接口为系统接口。 2706e41f4b71Sopenharmony_ci 2707e41f4b71Sopenharmony_ci**系统能力**:SystemCapability.Telephony.CoreService 2708e41f4b71Sopenharmony_ci 2709e41f4b71Sopenharmony_ci| 名称 | 值 | 说明 | 2710e41f4b71Sopenharmony_ci| -------------------- | ---- | --------------------------------- | 2711e41f4b71Sopenharmony_ci| NR_OPTION_UNKNOWN | 0 | 未知的NR选择模式。 | 2712e41f4b71Sopenharmony_ci| NR_OPTION_NSA_ONLY | 1 | 仅非独立组网的NR选择模式。 | 2713e41f4b71Sopenharmony_ci| NR_OPTION_SA_ONLY | 2 | 仅独立组网的NR选择模式。 | 2714e41f4b71Sopenharmony_ci| NR_OPTION_NSA_AND_SA | 3 | 非独立组网和独立组网的NR选择模式。 | 2715e41f4b71Sopenharmony_ci 2716e41f4b71Sopenharmony_ci## NetworkSearchResult 2717e41f4b71Sopenharmony_ci 2718e41f4b71Sopenharmony_ci网络搜索结果。 2719e41f4b71Sopenharmony_ci 2720e41f4b71Sopenharmony_ci**系统接口:** 此接口为系统接口。 2721e41f4b71Sopenharmony_ci 2722e41f4b71Sopenharmony_ci**系统能力**:SystemCapability.Telephony.CoreService 2723e41f4b71Sopenharmony_ci 2724e41f4b71Sopenharmony_ci| 名称 | 类型 | 必填 | 说明 | 2725e41f4b71Sopenharmony_ci| ---------------------- | ------------------------------------------------- | ---- | -------------- | 2726e41f4b71Sopenharmony_ci| isNetworkSearchSuccess | boolean | 是 | 网络搜索成功。 | 2727e41f4b71Sopenharmony_ci| networkSearchResult | Array<[NetworkInformation](#networkinformation)\> | 是 | 网络搜索结果。 | 2728e41f4b71Sopenharmony_ci 2729e41f4b71Sopenharmony_ci## NetworkInformation 2730e41f4b71Sopenharmony_ci 2731e41f4b71Sopenharmony_ci网络信息。 2732e41f4b71Sopenharmony_ci 2733e41f4b71Sopenharmony_ci**系统接口:** 此接口为系统接口。 2734e41f4b71Sopenharmony_ci 2735e41f4b71Sopenharmony_ci**系统能力**:SystemCapability.Telephony.CoreService 2736e41f4b71Sopenharmony_ci 2737e41f4b71Sopenharmony_ci| 名称 | 类型 | 必填 | 说明 | 2738e41f4b71Sopenharmony_ci| --------------- | --------------------------------------------------- | ---- | -------------- | 2739e41f4b71Sopenharmony_ci| operatorName | string | 是 | 运营商的名称。 | 2740e41f4b71Sopenharmony_ci| operatorNumeric | string | 是 | 运营商数字。 | 2741e41f4b71Sopenharmony_ci| state | [NetworkInformationState](#networkinformationstate) | 是 | 网络信息状态。 | 2742e41f4b71Sopenharmony_ci| radioTech | string | 是 | 无线电技术。 | 2743e41f4b71Sopenharmony_ci 2744e41f4b71Sopenharmony_ci## NetworkInformationState 2745e41f4b71Sopenharmony_ci 2746e41f4b71Sopenharmony_ci网络信息状态。 2747e41f4b71Sopenharmony_ci 2748e41f4b71Sopenharmony_ci**系统接口:** 此接口为系统接口。 2749e41f4b71Sopenharmony_ci 2750e41f4b71Sopenharmony_ci**系统能力**:SystemCapability.Telephony.CoreService 2751e41f4b71Sopenharmony_ci 2752e41f4b71Sopenharmony_ci| 名称 | 值 | 说明 | 2753e41f4b71Sopenharmony_ci| ----------------- | ---- | ---------------- | 2754e41f4b71Sopenharmony_ci| NETWORK_UNKNOWN | 0 | 网络状态未知。 | 2755e41f4b71Sopenharmony_ci| NETWORK_AVAILABLE | 1 | 网络可用于注册。 | 2756e41f4b71Sopenharmony_ci| NETWORK_CURRENT | 2 | 已在网络中注册。 | 2757e41f4b71Sopenharmony_ci| NETWORK_FORBIDDEN | 3 | 网络无法注册。 | 2758e41f4b71Sopenharmony_ci 2759e41f4b71Sopenharmony_ci## NetworkSelectionModeOptions 2760e41f4b71Sopenharmony_ci 2761e41f4b71Sopenharmony_ci网络选择模式选项。 2762e41f4b71Sopenharmony_ci 2763e41f4b71Sopenharmony_ci**系统接口:** 此接口为系统接口。 2764e41f4b71Sopenharmony_ci 2765e41f4b71Sopenharmony_ci**系统能力**:SystemCapability.Telephony.CoreService 2766e41f4b71Sopenharmony_ci 2767e41f4b71Sopenharmony_ci| 名称 | 类型 | 必填 | 说明 | 2768e41f4b71Sopenharmony_ci| ------------------ | --------------------------------------------- | ---- | -------------------------------------- | 2769e41f4b71Sopenharmony_ci| slotId | number | 是 | 卡槽ID。<br/>- 0:卡槽1<br/>- 1:卡槽2 | 2770e41f4b71Sopenharmony_ci| selectMode | [NetworkSelectionMode](js-apis-radio.md#networkselectionmode) | 是 | 网络选择模式。 | 2771e41f4b71Sopenharmony_ci| networkInformation | [NetworkInformation](#networkinformation) | 是 | 网络信息。 | 2772e41f4b71Sopenharmony_ci| resumeSelection | boolean | 是 | 继续选择。 | 2773e41f4b71Sopenharmony_ci 2774e41f4b71Sopenharmony_ci## ImsRegState<sup>9+</sup> 2775e41f4b71Sopenharmony_ci 2776e41f4b71Sopenharmony_ciIMS注册状态。 2777e41f4b71Sopenharmony_ci 2778e41f4b71Sopenharmony_ci**系统接口:** 此接口为系统接口。 2779e41f4b71Sopenharmony_ci 2780e41f4b71Sopenharmony_ci**系统能力**:SystemCapability.Telephony.CoreService 2781e41f4b71Sopenharmony_ci 2782e41f4b71Sopenharmony_ci| 名称 | 值 | 说明 | 2783e41f4b71Sopenharmony_ci| ---------------- | ---- | -------- | 2784e41f4b71Sopenharmony_ci| IMS_UNREGISTERED | 0 | 未注册。 | 2785e41f4b71Sopenharmony_ci| IMS_REGISTERED | 1 | 已注册。 | 2786e41f4b71Sopenharmony_ci 2787e41f4b71Sopenharmony_ci## ImsRegTech<sup>9+</sup> 2788e41f4b71Sopenharmony_ci 2789e41f4b71Sopenharmony_ciIMS注册技术。 2790e41f4b71Sopenharmony_ci 2791e41f4b71Sopenharmony_ci**系统接口:** 此接口为系统接口。 2792e41f4b71Sopenharmony_ci 2793e41f4b71Sopenharmony_ci**系统能力**:SystemCapability.Telephony.CoreService 2794e41f4b71Sopenharmony_ci 2795e41f4b71Sopenharmony_ci| 名称 | 值 | 说明 | 2796e41f4b71Sopenharmony_ci| ----------------------- | ---- | --------------- | 2797e41f4b71Sopenharmony_ci| REGISTRATION_TECH_NONE | 0 | 无注册技术。 | 2798e41f4b71Sopenharmony_ci| REGISTRATION_TECH_LTE | 1 | LTE注册技术。 | 2799e41f4b71Sopenharmony_ci| REGISTRATION_TECH_IWLAN | 2 | IWLAN注册技术。 | 2800e41f4b71Sopenharmony_ci| REGISTRATION_TECH_NR | 3 | NR注册技术。 | 2801e41f4b71Sopenharmony_ci 2802e41f4b71Sopenharmony_ci## ImsRegInfo<sup>9+</sup> 2803e41f4b71Sopenharmony_ci 2804e41f4b71Sopenharmony_ciIMS注册信息。 2805e41f4b71Sopenharmony_ci 2806e41f4b71Sopenharmony_ci**系统接口:** 此接口为系统接口。 2807e41f4b71Sopenharmony_ci 2808e41f4b71Sopenharmony_ci**系统能力**:SystemCapability.Telephony.CoreService 2809e41f4b71Sopenharmony_ci 2810e41f4b71Sopenharmony_ci| 名称 | 类型 | 必填 | 说明 | 2811e41f4b71Sopenharmony_ci| ----------- | ---------------------------- | ---- | ------------- | 2812e41f4b71Sopenharmony_ci| imsRegState | [ImsRegState](#imsregstate9) | 是 | IMS注册状态。 | 2813e41f4b71Sopenharmony_ci| imsRegTech | [ImsRegTech](#imsregtech9) | 是 | IMS注册技术。 | 2814e41f4b71Sopenharmony_ci 2815e41f4b71Sopenharmony_ci## ImsServiceType<sup>9+</sup> 2816e41f4b71Sopenharmony_ci 2817e41f4b71Sopenharmony_ciIMS服务类型。 2818e41f4b71Sopenharmony_ci 2819e41f4b71Sopenharmony_ci**系统接口:** 此接口为系统接口。 2820e41f4b71Sopenharmony_ci 2821e41f4b71Sopenharmony_ci**系统能力**:SystemCapability.Telephony.CoreService 2822e41f4b71Sopenharmony_ci 2823e41f4b71Sopenharmony_ci| 名称 | 值 | 说明 | 2824e41f4b71Sopenharmony_ci| ---------- | ---- | ---------- | 2825e41f4b71Sopenharmony_ci| TYPE_VOICE | 0 | 语音服务。 | 2826e41f4b71Sopenharmony_ci| TYPE_VIDEO | 1 | 视频服务。 | 2827e41f4b71Sopenharmony_ci| TYPE_UT | 2 | UT服务。 | 2828e41f4b71Sopenharmony_ci| TYPE_SMS | 3 | 短讯服务。 | 2829e41f4b71Sopenharmony_ci 2830e41f4b71Sopenharmony_ci## NetworkCapabilityType<sup>10+</sup> 2831e41f4b71Sopenharmony_ci 2832e41f4b71Sopenharmony_ci网络能力类型。 2833e41f4b71Sopenharmony_ci 2834e41f4b71Sopenharmony_ci**系统接口:** 此接口为系统接口。 2835e41f4b71Sopenharmony_ci 2836e41f4b71Sopenharmony_ci**系统能力**:SystemCapability.Telephony.CoreService 2837e41f4b71Sopenharmony_ci 2838e41f4b71Sopenharmony_ci| 名称 | 值 | 说明 | 2839e41f4b71Sopenharmony_ci| -----------------| ---- | ---------- | 2840e41f4b71Sopenharmony_ci| SERVICE_TYPE_LTE | 0 | LTE服务类型。 | 2841e41f4b71Sopenharmony_ci| SERVICE_TYPE_NR | 1 | NR服务类型。 | 2842e41f4b71Sopenharmony_ci 2843e41f4b71Sopenharmony_ci## NetworkCapabilityState<sup>10+</sup> 2844e41f4b71Sopenharmony_ci 2845e41f4b71Sopenharmony_ci网络能力开关状态。 2846e41f4b71Sopenharmony_ci 2847e41f4b71Sopenharmony_ci**系统接口:** 此接口为系统接口。 2848e41f4b71Sopenharmony_ci 2849e41f4b71Sopenharmony_ci**系统能力**:SystemCapability.Telephony.CoreService 2850e41f4b71Sopenharmony_ci 2851e41f4b71Sopenharmony_ci| 名称 | 值 | 说明 | 2852e41f4b71Sopenharmony_ci| -----------------------| ---- | ---------- | 2853e41f4b71Sopenharmony_ci| SERVICE_CAPABILITY_OFF | 0 | 网络能力关闭。 | 2854e41f4b71Sopenharmony_ci| SERVICE_CAPABILITY_ON | 1 | 网络能力打开。 | 2855