提交 2053c18b 编写于 作者: S shawn_he

update doc

Signed-off-by: Nshawn_he <shawn.he@huawei.com>
上级 89e30845
...@@ -12,6 +12,8 @@ debug(message: string, ...arguments: any[]): void ...@@ -12,6 +12,8 @@ debug(message: string, ...arguments: any[]): void
Prints debugging information in formatted output mode. Prints debugging information in formatted output mode.
Since API version 9, this API is supported in ArkTS widgets.
**System capability**: SystemCapability.ArkUI.ArkUI.Full **System capability**: SystemCapability.ArkUI.ArkUI.Full
**Parameters** **Parameters**
...@@ -39,6 +41,8 @@ log(message: string, ...arguments: any[]): void ...@@ -39,6 +41,8 @@ log(message: string, ...arguments: any[]): void
Prints log information in formatted output mode. Prints log information in formatted output mode.
Since API version 9, this API is supported in ArkTS widgets.
**System capability**: SystemCapability.ArkUI.ArkUI.Full **System capability**: SystemCapability.ArkUI.ArkUI.Full
**Parameters** **Parameters**
...@@ -66,6 +70,8 @@ info(message: string, ...arguments: any[]): void ...@@ -66,6 +70,8 @@ info(message: string, ...arguments: any[]): void
Prints log information in formatted output mode. This API is the alias of **console.log ()**. Prints log information in formatted output mode. This API is the alias of **console.log ()**.
Since API version 9, this API is supported in ArkTS widgets.
**System capability**: SystemCapability.ArkUI.ArkUI.Full **System capability**: SystemCapability.ArkUI.ArkUI.Full
**Parameters** **Parameters**
...@@ -93,6 +99,8 @@ warn(message: string, ...arguments: any[]): void ...@@ -93,6 +99,8 @@ warn(message: string, ...arguments: any[]): void
Prints warning information in formatted output mode. Prints warning information in formatted output mode.
Since API version 9, this API is supported in ArkTS widgets.
**System capability**: SystemCapability.ArkUI.ArkUI.Full **System capability**: SystemCapability.ArkUI.ArkUI.Full
**Parameters** **Parameters**
...@@ -120,6 +128,8 @@ error(message: string, ...arguments: any[]): void ...@@ -120,6 +128,8 @@ error(message: string, ...arguments: any[]): void
Prints error information in formatted output mode. Prints error information in formatted output mode.
Since API version 9, this API is supported in ArkTS widgets.
**System capability**: SystemCapability.ArkUI.ArkUI.Full **System capability**: SystemCapability.ArkUI.ArkUI.Full
**Parameters** **Parameters**
......
...@@ -550,7 +550,7 @@ Checks whether the current device supports 5G \(NR\). ...@@ -550,7 +550,7 @@ Checks whether the current device supports 5G \(NR\).
> **NOTE** > **NOTE**
> >
> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [isNRSupported](#radioisnrsupported9) instead. > This API is supported since API version 7 and deprecated since API version 9. You are advised to use [isNRSupported](#radioisnrsupported9).
**System capability**: SystemCapability.Telephony.CoreService **System capability**: SystemCapability.Telephony.CoreService
...@@ -575,7 +575,7 @@ Checks whether the current device supports 5G \(NR\). ...@@ -575,7 +575,7 @@ Checks whether the current device supports 5G \(NR\).
> **NOTE** > **NOTE**
> >
> This API is supported since API version 8 and deprecated since API version 9. You are advised to use [isNRSupported](#radioisnrsupported9-1) instead. > This API is supported since API version 8 and deprecated since API version 9. You are advised to use [isNRSupported](#radioisnrsupported9-1).
**System capability**: SystemCapability.Telephony.CoreService **System capability**: SystemCapability.Telephony.CoreService
...@@ -998,7 +998,7 @@ radio.getIMEI((err, data) => { ...@@ -998,7 +998,7 @@ radio.getIMEI((err, data) => {
getIMEI\(slotId: number, callback: AsyncCallback\<string\>\): void getIMEI\(slotId: number, callback: AsyncCallback\<string\>\): void
Obtains the IMEI of the SIM card in a card slot. This API uses an asynchronous callback to return the result. Obtains the IMEI of the SIM card in the specified slot. This API uses an asynchronous callback to return the result.
**System API**: This is a system API. **System API**: This is a system API.
...@@ -1041,7 +1041,7 @@ radio.getIMEI(slotId, (err, data) => { ...@@ -1041,7 +1041,7 @@ radio.getIMEI(slotId, (err, data) => {
getIMEI\(slotId?: number\): Promise\<string\> getIMEI\(slotId?: number\): Promise\<string\>
Obtains the IMEI of the SIM card in the specified card slot. This API uses a promise to return the result. Obtains the IMEI of the SIM card in the specified slot. This API uses a promise to return the result.
**System API**: This is a system API. **System API**: This is a system API.
...@@ -1132,7 +1132,7 @@ radio.getMEID((err, data) => { ...@@ -1132,7 +1132,7 @@ radio.getMEID((err, data) => {
getMEID\(slotId: number, callback: AsyncCallback\<string\>\): void getMEID\(slotId: number, callback: AsyncCallback\<string\>\): void
Obtains the MEID of the SIM card in a card slot. This API uses an asynchronous callback to return the result. Obtains the MEID of the SIM card in the specified slot. This API uses an asynchronous callback to return the result.
**System API**: This is a system API. **System API**: This is a system API.
...@@ -1175,7 +1175,7 @@ radio.getMEID(slotId, (err, data) => { ...@@ -1175,7 +1175,7 @@ radio.getMEID(slotId, (err, data) => {
getMEID\(slotId?: number\): Promise\<string\> getMEID\(slotId?: number\): Promise\<string\>
Obtains the MEID of the SIM card in the specified card slot. This API uses a promise to return the result. Obtains the MEID of the SIM card in the specified slot. This API uses a promise to return the result.
**System API**: This is a system API. **System API**: This is a system API.
...@@ -1266,7 +1266,7 @@ radio.getUniqueDeviceId((err, data) => { ...@@ -1266,7 +1266,7 @@ radio.getUniqueDeviceId((err, data) => {
getUniqueDeviceId\(slotId: number, callback: AsyncCallback\<string\>\): void getUniqueDeviceId\(slotId: number, callback: AsyncCallback\<string\>\): void
Obtains the unique device ID of the SIM card in a card slot. This API uses an asynchronous callback to return the result. Obtains the unique device ID of the SIM card in the specified slot. This API uses an asynchronous callback to return the result.
**System API**: This is a system API. **System API**: This is a system API.
...@@ -1309,7 +1309,7 @@ radio.getUniqueDeviceId(slotId, (err, data) => { ...@@ -1309,7 +1309,7 @@ radio.getUniqueDeviceId(slotId, (err, data) => {
getUniqueDeviceId\(slotId?: number\): Promise\<string\> getUniqueDeviceId\(slotId?: number\): Promise\<string\>
Obtains the unique device ID of the SIM card in the specified card slot. This API uses a promise to return the result. Obtains the unique device ID of the SIM card in the specified slot. This API uses a promise to return the result.
**System API**: This is a system API. **System API**: This is a system API.
...@@ -1824,12 +1824,16 @@ promise.then(data => { ...@@ -1824,12 +1824,16 @@ promise.then(data => {
}); });
``` ```
## radio.getNrOptionMode<sup>8+</sup> ## radio.getNrOptionMode<sup>(deprecated)</sup>
getNrOptionMode\(callback: AsyncCallback\<NrOptionMode\>\): void getNrOptionMode\(callback: AsyncCallback\<NrOptionMode\>\): void
Obtains the NR option mode. This API uses an asynchronous callback to return the result. Obtains the NR option mode. This API uses an asynchronous callback to return the result.
> **NOTE**
>
> This API is supported since API version 8 and deprecated since API version 10. You are advised to use [getNROptionMode](#radiogetnroptionmode10).
**System API**: This is a system API. **System API**: This is a system API.
**System capability**: SystemCapability.Telephony.CoreService **System capability**: SystemCapability.Telephony.CoreService
...@@ -1838,7 +1842,7 @@ Obtains the NR option mode. This API uses an asynchronous callback to return the ...@@ -1838,7 +1842,7 @@ Obtains the NR option mode. This API uses an asynchronous callback to return the
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------- | ----------------------------------------------- | ---- | ---------- | | -------- | ----------------------------------------------- | ---- | ---------- |
| callback | AsyncCallback\<[NrOptionMode](#nroptionmode8)\> | Yes | Callback used to return the result.| | callback | AsyncCallback\<[NrOptionMode](#nroptionmodedeprecated)\> | Yes | Callback used to return the result.|
**Error codes** **Error codes**
...@@ -1862,11 +1866,15 @@ radio.getNrOptionMode((err, data) => { ...@@ -1862,11 +1866,15 @@ radio.getNrOptionMode((err, data) => {
``` ```
## radio.getNrOptionMode<sup>8+</sup> ## radio.getNrOptionMode<sup>(deprecated)</sup>
getNrOptionMode\(slotId: number, callback: AsyncCallback\<NrOptionMode\>\): void getNrOptionMode\(slotId: number, callback: AsyncCallback\<NrOptionMode\>\): void
Obtains the NR option mode for the SIM card in the specified slot. This API uses an asynchronous callback to return the result. Obtains the NR option mode. This API uses an asynchronous callback to return the result.
> **NOTE**
>
> This API is supported since API version 8 and deprecated since API version 10. You are advised to use [getNROptionMode](#radiogetnroptionmode10).
**System API**: This is a system API. **System API**: This is a system API.
...@@ -1875,9 +1883,9 @@ Obtains the NR option mode for the SIM card in the specified slot. This API uses ...@@ -1875,9 +1883,9 @@ Obtains the NR option mode for the SIM card in the specified slot. This API uses
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------- | ----------------------------------------------- | ---- | -------------------------------------- | | -------- | ----------------------------------------------- | ---- | ------------------------------------- |
| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| | slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|
| callback | AsyncCallback\<[NrOptionMode](#nroptionmode8)\> | Yes | Callback used to return the result. | | callback | AsyncCallback\<[NrOptionMode](#nroptionmodedeprecated)\> | Yes | Callback used to return the result. |
**Error codes** **Error codes**
...@@ -1902,12 +1910,16 @@ radio.getNrOptionMode(slotId, (err, data) => { ...@@ -1902,12 +1910,16 @@ radio.getNrOptionMode(slotId, (err, data) => {
``` ```
## radio.getNrOptionMode<sup>8+</sup> ## radio.getNrOptionMode<sup>(deprecated)</sup>
getNrOptionMode\(slotId?: number\): Promise\<NrOptionMode\> getNrOptionMode\(slotId?: number\): Promise\<NrOptionMode\>
Obtains the NR option mode for the SIM card in the specified slot. This API uses a promise to return the result. Obtains the NR option mode for the SIM card in the specified slot. This API uses a promise to return the result.
> **NOTE**
>
> This API is supported since API version 8 and deprecated since API version 10. You are advised to use [getNROptionMode](#radiogetnroptionmode10).
**System API**: This is a system API. **System API**: This is a system API.
**System capability**: SystemCapability.Telephony.CoreService **System capability**: SystemCapability.Telephony.CoreService
...@@ -1921,8 +1933,8 @@ Obtains the NR option mode for the SIM card in the specified slot. This API uses ...@@ -1921,8 +1933,8 @@ Obtains the NR option mode for the SIM card in the specified slot. This API uses
**Return value** **Return value**
| Type | Description | | Type | Description |
| ----------------------------------------- | ----------------------- | | -------------------------------------------------- | ----------------------- |
| Promise\<[NrOptionMode](#nroptionmode8)\> | Promise used to return the result.| | Promise\<[NrOptionMode](#nroptionmodedeprecated)\> | Promise used to return the result. |
**Error codes** **Error codes**
...@@ -2581,7 +2593,7 @@ radio.off('imsRegStateChange', 0, radio.ImsServiceType.TYPE_VIDEO, data => { ...@@ -2581,7 +2593,7 @@ radio.off('imsRegStateChange', 0, radio.ImsServiceType.TYPE_VIDEO, data => {
getBasebandVersion\(slotId: number, callback: AsyncCallback\<string\>\): void getBasebandVersion\(slotId: number, callback: AsyncCallback\<string\>\): void
Obtains the baseband version of the device. This API uses an asynchronous callback to return the result. Obtains the baseband version of the device for the SIM card in the specified slot. This API uses an asynchronous callback to return the result.
**System API**: This is a system API. **System API**: This is a system API.
...@@ -2624,7 +2636,7 @@ radio.getBasebandVersion(slotId, (err, data) => { ...@@ -2624,7 +2636,7 @@ radio.getBasebandVersion(slotId, (err, data) => {
getBasebandVersion\(slotId: number\): Promise\<string\> getBasebandVersion\(slotId: number\): Promise\<string\>
Obtains the baseband version of the device. This API uses a promise to return the result. Obtains the baseband version of the device for the SIM card in the specified slot. This API uses a promise to return the result.
**System API**: This is a system API. **System API**: This is a system API.
...@@ -2671,9 +2683,193 @@ promise.then(data => { ...@@ -2671,9 +2683,193 @@ promise.then(data => {
``` ```
## radio.setNROptionMode<sup>10+</sup>
setNROptionMode\(slotId: number, mode: NROptionMode, callback: AsyncCallback\<void\>\): void
Sets the NR mode for the SIM card in the specified slot. This API uses an asynchronous callback to return the result.
**System API**: This is a system API.
**Required permission**: ohos.permission.SET_TELEPHONY_STATE
**System capability**: SystemCapability.Telephony.CoreService
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | ------------------------------------------------ | ---- | -------------------------------------- |
| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2 |
| mode | [NROptionMode](#nroptionmode10) | Yes | Enumerates NR selection modes. |
| callback | AsyncCallback\<void\> | Yes | Callback used to return the result. |
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 202 | Non-system applications use system APIs. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example**
```js
let slotId = 0;
radio.setNROptionMode(slotId, 1, (err, data) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
```
## radio.setNROptionMode<sup>10+</sup>
setNROptionMode\(slotId: number, mode: NROptionMode\): Promise\<void\>
Sets the NR mode for the SIM card in the specified slot. This API uses a promise to return the result.
**System API**: This is a system API.
**Required permission**: ohos.permission.SET_TELEPHONY_STATE
**System capability**: SystemCapability.Telephony.CoreService
**Parameters**
| Name| Type | Mandatory| Description |
| ------ | ------------------------------- | ---- | ------------------------------------- |
| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|
| mode | [NROptionMode](#nroptionmode10) | Yes | Enumerates NR selection modes. |
**Return value**
| Type | Description |
| ----------------- | ----------------------- |
| Promise\<void\> | Promise used to return the result. |
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 202 | Non-system applications use system APIs. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example**
```js
let slotId = 0;
let promise = radio.setNROptionMode(slotId, 1);
promise.then(data => {
console.log(`setNROptionMode success, promise: data->${JSON.stringify(data)}`);
}).catch(err => {
console.error(`setNROptionMode failed, promise: err->${JSON.stringify(err)}`);
});
```
## radio.getNROptionMode<sup>10+</sup>
getNROptionMode\(slotId: number, callback: AsyncCallback\<NROptionMode\>\): void
Obtains the NR option mode for the SIM card in the specified slot. This API uses an asynchronous callback to return the result.
**System API**: This is a system API.
**System capability**: SystemCapability.Telephony.CoreService
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | ------------------------------------------------ | ---- | -------------------------------------- |
| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2 |
| callback | AsyncCallback\<[NROptionMode](#nroptionmode10)\> | Yes | Callback used to return the result. |
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 202 | Non-system applications use system APIs. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example**
```js
let slotId = 0;
radio.getNROptionMode(slotId, (err, data) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
```
## radio.getNROptionMode<sup>10+</sup>
getNROptionMode\(slotId: number\): Promise\<NROptionMode\>
Obtains the NR option mode for the SIM card in the specified slot. This API uses a promise to return the result.
**System API**: This is a system API.
**System capability**: SystemCapability.Telephony.CoreService
**Parameters**
| Name| Type | Mandatory| Description |
| ------ | ------ | ---- | ------------------------------------- |
| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|
**Return value**
| Type | Description |
| ----------------------------------------- | ----------------------- |
| Promise\<[NROptionMode](#nroptionmode10)\> | Promise used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 202 | Non-system applications use system APIs. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example**
```js
let slotId = 0;
let promise = radio.getNROptionMode(slotId);
promise.then(data => {
console.log(`getNROptionMode success, promise: data->${JSON.stringify(data)}`);
}).catch(err => {
console.error(`getNROptionMode failed, promise: err->${JSON.stringify(err)}`);
});
```
## RadioTechnology ## RadioTechnology
Enumerates radio access technologies. Enumerates radio access technologies.
**System capability**: SystemCapability.Telephony.CoreService **System capability**: SystemCapability.Telephony.CoreService
...@@ -2947,10 +3143,14 @@ Defines the WCDMA cell information. ...@@ -2947,10 +3143,14 @@ Defines the WCDMA cell information.
| mcc | string | Yes | Mobile country code.| | mcc | string | Yes | Mobile country code.|
| mnc | string | Yes | Mobile network code. | | mnc | string | Yes | Mobile network code. |
## NrOptionMode<sup>8+</sup> ## NrOptionMode<sup>(deprecated)</sup>
Enumerates NR selection modes. Enumerates NR selection modes.
> **NOTE**
>
> This API is supported since API version 8 and deprecated since API version 10. You are advised to use [NROptionMode](#nroptionmode10).
**System API**: This is a system API. **System API**: This is a system API.
**System capability**: SystemCapability.Telephony.CoreService **System capability**: SystemCapability.Telephony.CoreService
...@@ -2962,6 +3162,21 @@ Enumerates NR selection modes. ...@@ -2962,6 +3162,21 @@ Enumerates NR selection modes.
| NR_OPTION_SA_ONLY | 2 | NR selection mode in 5G non-standalone networking. | | NR_OPTION_SA_ONLY | 2 | NR selection mode in 5G non-standalone networking. |
| NR_OPTION_NSA_AND_SA | 3 | NR selection mode in non-standalone and standalone networking.| | NR_OPTION_NSA_AND_SA | 3 | NR selection mode in non-standalone and standalone networking.|
## NROptionMode<sup>10+</sup>
Enumerates NR selection modes.
**System API**: This is a system API.
**System capability**: SystemCapability.Telephony.CoreService
| Name | Value | Description |
| -------------------- | ---- | --------------------------------- |
| NR_OPTION_UNKNOWN | 0 | Unknown NR selection mode. |
| NR_OPTION_NSA_ONLY | 1 | NR selection mode in 5G non-standalone networking. |
| NR_OPTION_SA_ONLY | 2 | NR selection mode in 5G non-standalone networking. |
| NR_OPTION_NSA_AND_SA | 3 | NR selection mode in non-standalone and standalone networking. |
## NetworkSearchResult ## NetworkSearchResult
Defines the network search result. Defines the network search result.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册