未验证 提交 98af4af0 编写于 作者: O openharmony_ci 提交者: Gitee

!2100 翻译已完成 1818#I4WQK1

Merge pull request !2100 from shawn_he/tel-1
......@@ -11,11 +11,11 @@
import observer from '@ohos.telephony.observer'
```
## observer.on('networkStateChange')<a name=observer.on.networkStateChange-callback></a>
## observer.on('networkStateChange')
on\(type: \'networkStateChange\', callback: Callback<NetworkState\>\): void;
Registers an observer for network status change events. This function uses an asynchronous callback to return the execution result.
Registers an observer for network status change events. This API uses an asynchronous callback to return the execution result.
**Required permission**: ohos.permission.GET_NETWORK_INFO
......@@ -23,10 +23,10 @@ Registers an observer for network status change events. This function uses an as
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | ----------------------------------------- | ---- | --------------------------------- |
| type | string | Yes| Network status change event.|
| callback | Callback\<[NetworkState](js-apis-radio.md#NetworkState)\> | Yes| Callback used to return the result. For details, see [NetworkState](js-apis-radio.md#NetworkState).|
| Name | Type | Mandatory| Description |
| -------- | --------------------------------------------------------- | ---- | ------------------------------------------------------------ |
| type | string | Yes | Network status change event. |
| callback | Callback\<[NetworkState](js-apis-radio.md#networkstate)\> | Yes | Callback used to return the result. For details, see [NetworkState](js-apis-radio.md#networkstate).|
**Example**
......@@ -37,11 +37,11 @@ observer.on('networkStateChange', data =>{
```
## observer.on('networkStateChange')<a name=observer.on.networkStateChange.options-callback></a>
## observer.on('networkStateChange')
on\(type: \'networkStateChange\', options: { slotId: number }, callback: Callback<NetworkState\>\): void;
Registers an observer for network status change events of the SIM card in the specified slot. This function uses an asynchronous callback to return the execution result.
Registers an observer for network status change events of the SIM card in the specified slot. This API uses an asynchronous callback to return the execution result.
**Required permission**: ohos.permission.GET_NETWORK_INFO
......@@ -49,11 +49,11 @@ Registers an observer for network status change events of the SIM card in the sp
**Parameters**
| Name| Type| Mandatory| Description|
| Name| Type | Mandatory| Description |
| ------ | ------ | ---- | -------------------------------------- |
| type | string | Yes| Network status change event.|
| slotId | number | Yes| Card slot ID. The options are as follows: <br/> - **0**: slot 1 <br/> - **1**: slot 2|
| callback | Callback\<[NetworkState](js-apis-radio.md#NetworkState)\> | Yes| Callback used to return the result. For details, see [NetworkState](js-apis-radio.md#NetworkState).|
| type | string | Yes | Network status change event. |
| slotId | number | Yes | Card slot ID. <br>- **0**: card slot 1<br>- **1**: card slot 2|
| callback | Callback\<[NetworkState](js-apis-radio.md#networkstate)\> | Yes | Callback used to return the result. For details, see [NetworkState](js-apis-radio.md#networkstate).|
**Example**
......@@ -64,11 +64,11 @@ observer.on('networkStateChange', {slotId: 0}, data =>{
```
## observer.off('networkStateChange')<a name=observer.off.networkStateChange-callback></a>
## observer.off('networkStateChange')
off\(type: \'networkStateChange\', callback?: Callback<NetworkState\>\): void;
Unregisters the observer for network status change events. This function uses an asynchronous callback to return the execution result.
Unregisters the observer for network status change events. This API uses an asynchronous callback to return the execution result.
**Required permission**: ohos.permission.GET_NETWORK_INFO
......@@ -80,10 +80,10 @@ Unregisters the observer for network status change events. This function uses an
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | ------------------------ | ---- | --------------------------------- |
| type | string | Yes| Network status change event.|
| callback | Callback\<[NetworkState](js-apis-radio.md#NetworkState)\> | No| Callback used to return the result. For details, see [NetworkState](js-apis-radio.md#NetworkState).|
| Name | Type | Mandatory| Description |
| -------- | --------------------------------------------------------- | ---- | ------------------------------------------------------------ |
| type | string | Yes | Network status change event. |
| callback | Callback\<[NetworkState](js-apis-radio.md#networkstate)\> | No | Callback used to return the result. For details, see [NetworkState](js-apis-radio.md#networkstate).|
**Example**
......@@ -97,20 +97,20 @@ observer.off('networkStateChange', callback);
observer.off('networkStateChange');
```
## observer.on('signalInfoChange')<a name=observer.on.signalInfoChange-callback></a>
## observer.on('signalInfoChange')
on\(type: \'signalInfoChange\', callback: Callback<Array<SignalInformation\>\>): void;
Registers an observer for signal status change events. This function uses an asynchronous callback to return the execution result.
Registers an observer for signal status change events. This API uses an asynchronous callback to return the execution result.
**System capability**: SystemCapability.Telephony.StateRegistry
**Parameters**
| Name| Type| Mandatory| Description|
| Name | Type | Mandatory| Description |
| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
| type | string | Yes| Signal status change event.|
| callback | Callback<Array<[SignalInformation](js-apis-radio.md#SignalInformation)\>\> | Yes| Callback used to return the result. For details, see [SignalInformation](js-apis-radio.md#SignalInformation).|
| type | string | Yes | Signal status change event. |
| callback | Callback<Array<[SignalInformation](js-apis-radio.md#signalinformation)\>\> | Yes | Callback used to return the result. For details, see [SignalInformation](js-apis-radio.md#signalinformation).|
**Example**
......@@ -121,21 +121,21 @@ observer.on('signalInfoChange', data =>{
```
## observer.on('signalInfoChange')<a name=observer.on.signalInfoChange.options-callback></a>
## observer.on('signalInfoChange')
on\(type: \'signalInfoChange\', options: { slotId: number }, callback: Callback<Array<SignalInformation\>\>): void;
Registers an observer for signal status change events of the SIM card in the specified slot. This function uses an asynchronous callback to return the execution result.
Registers an observer for signal status change events of the SIM card in the specified slot. This API uses an asynchronous callback to return the execution result.
**System capability**: SystemCapability.Telephony.StateRegistry
**Parameters**
| Name| Type| Mandatory| Description|
| Name| Type | Mandatory| Description |
| ------ | ------ | ---- | -------------------------------------- |
| type | string | Yes| Signal status change event.|
| slotId | number | Yes| Card slot ID. The options are as follows: <br/> - **0**: slot 1 <br/> - **1**: slot 2|
| callback | Callback<Array<[SignalInformation](js-apis-radio.md#SignalInformation)\>\> | Yes| Callback used to return the result. For details, see [SignalInformation](js-apis-radio.md#SignalInformation).|
| type | string | Yes | Signal status change event. |
| slotId | number | Yes | Card slot ID. <br>- **0**: card slot 1<br>- **1**: card slot 2|
| callback | Callback<Array<[SignalInformation](js-apis-radio.md#signalinformation)\>\> | Yes | Callback used to return the result. For details, see [SignalInformation](js-apis-radio.md#signalinformation).|
**Example**
......@@ -146,11 +146,11 @@ observer.on('signalInfoChange', {slotId: 0}, data =>{
```
## observer.off('signalInfoChange')<a name=observer.off.signalInfoChange-callback></a>
## observer.off('signalInfoChange')
off\(type: \'signalInfoChange\', callback?: Callback<Array<SignalInformation\>\>): void;
Unregisters the observer for signal status change events. This function uses an asynchronous callback to return the execution result.
Unregisters the observer for signal status change events. This API uses an asynchronous callback to return the execution result.
>**NOTE**
>
......@@ -160,10 +160,10 @@ Unregisters the observer for signal status change events. This function uses an
**Parameters**
| Name| Type| Mandatory| Description|
| Name | Type | Mandatory| Description |
| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
| type | string | Yes| Signal status change event.|
| callback | Callback<Array<[SignalInformation](js-apis-radio.md#SignalInformation)\>\> | No| Callback used to return the result. For details, see [SignalInformation](js-apis-radio.md#SignalInformation).|
| type | string | Yes | Signal status change event. |
| callback | Callback<Array<[SignalInformation](js-apis-radio.md#signalinformation)\>\> | No | Callback used to return the result. For details, see [SignalInformation](js-apis-radio.md#signalinformation).|
**Example**
......@@ -178,11 +178,11 @@ observer.off('signalInfoChange');
```
## observer.on('callStateChange')<a name=observer.on.callStateChange-callback></a>
## observer.on('callStateChange')
on(type: 'callStateChange', callback: Callback\<{ state: [CallState](js-apis-call.md#CallState), number: string }\>): void;
on(type: 'callStateChange', callback: Callback\<{ state: CallState, number: string }\>): void;
Registers an observer for call status change events. This function uses an asynchronous callback to return the execution result.
Registers an observer for call status change events. This API uses an asynchronous callback to return the execution result.
**Required permission**: ohos.permission.READ_CALL_LOG
......@@ -190,10 +190,10 @@ Registers an observer for call status change events. This function uses an async
**Parameters**
| Name| Type| Mandatory| Description|
| Name | Type | Mandatory| Description |
| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
| type | string | Yes| Call status change event.|
| callback | Callback\<{ state: [CallState](js-apis-call.md#CallState), number: string }\> | Yes| Callback used to return the result. For details, see [CallState](js-apis-call.md#CallState)<br />**number**: phone number.|
| type | string | Yes | Call status change event. |
| callback | Callback\<{ state: [CallState](js-apis-call.md#callstate), number: string }\> | Yes | Callback function. For details, see [CallState](js-apis-call.md#callstate) in call.<br>**number**: phone number.|
**Example**
......@@ -204,11 +204,11 @@ observer.on('callStateChange', value =>{
```
## observer.on('callStateChange')<a name=observer.on.callStateChange.options-callback></a>
## observer.on('callStateChange')
on(type: 'callStateChange', options: { slotId: number }, callback: Callback<{ state: [CallState](js-apis-call.md#CallState), number: string }>): void;
on(type: 'callStateChange', options: { slotId: number }, callback: Callback<{ state:CallState, number: string }>): void;
Registers an observer for call status change events. This function uses an asynchronous callback to return the execution result.
Registers an observer for call status change events. This API uses an asynchronous callback to return the execution result.
**Required permission**: ohos.permission.READ_CALL_LOG
......@@ -216,11 +216,11 @@ Registers an observer for call status change events. This function uses an async
**Parameters**
| Name| Type| Mandatory| Description|
| Name | Type | Mandatory| Description |
| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
| type | string | Yes| Call status change event.|
| slotId | number | Yes| Card slot ID. The options are as follows: <br/> - **0**: slot 1<br/> - **1**: slot 2|
| callback | Callback\<{ state: [CallState](js-apis-call.md#CallState), number: string }\> | Yes| Callback used to return the result. For details, see [CallState](js-apis-call.md#CallState)<br />**number**: phone number.|
| type | string | Yes | Call status change event. |
| slotId | number | Yes | Card slot ID. <br>- **0**: card slot 1<br>- **1**: card slot 2 |
| callback | Callback\<{ state: [CallState](js-apis-call.md#callstate), number: string }\> | Yes | Callback function. For details, see [CallState](js-apis-call.md#callstate) in call.<br>**number**: phone number.|
**Example**
......@@ -231,11 +231,11 @@ observer.on('callStateChange', {slotId: 0}, value =>{
```
## observer.off('callStateChange')<a name=observer.off.callStateChange-callback></a>
## observer.off('callStateChange')
off(type: 'callStateChange', callback?: Callback<{ state: [CallState](js-apis-call.md#CallState), number: string }>): void;
off(type: 'callStateChange', callback?: Callback<{ state: CallState, number: string }>): void;
Unregisters the observer for call status change events. This function uses an asynchronous callback to return the execution result.
Unregisters the observer for call status change events. This API uses an asynchronous callback to return the execution result.
**Required permission**: ohos.permission.READ_CALL_LOG
......@@ -247,10 +247,10 @@ Unregisters the observer for call status change events. This function uses an as
**Parameters**
| Name| Type| Mandatory| Description|
| Name | Type | Mandatory| Description |
| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
| type | string | Yes| Call status change event.|
| callback | Callback\<{ state: [CallState](js-apis-call.md#CallState), number: string }\> | No| Callback used to return the result. For details, see [CallState](js-apis-call.md#CallState)<br />**number**: phone number.|
| type | string | Yes | Call status change event. |
| callback | Callback\<{ state: [CallState](js-apis-call.md#callstate), number: string }\> | No | Callback function. For details, see [CallState](js-apis-call.md#callstate) in call.<br>**number**: phone number.|
**Example**
......@@ -263,3 +263,282 @@ observer.on('callStateChange', callback);
observer.off('callStateChange', callback);
observer.off('callStateChange');
```
## observer.on('cellularDataConnectionStateChange')<sup>7+</sup>
on\(type: 'cellularDataConnectionStateChange', callback: Callback\<{ state: DataConnectState, network: RatType}\>\): void;
Registers an observer for connection status change events of the cellular data link. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Telephony.StateRegistry
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
| type | string | Yes | Connection status change event of the cellular data link. |
| callback | Callback\<{ state: [DataConnectState](js-apis-telephony-data.md#dataconnectState), network: [RatType](js-apis-radio.md#radiotechnology) }\> | Yes | Callback used to return the result. For details, see [DataConnectState](js-apis-telephony-data.md#dataconnectstate) and [RadioTechnology](js-apis-radio.md#radiotechnology).|
**Example**
```
observer.on('cellularDataConnectionStateChange', value =>{
console.log("on cellularDataConnectionStateChange, state:" + value.state + ", network:" + value.network);
});
```
## observer.on('cellularDataConnectionStateChange')<sup>7+</sup>
on\(type: 'cellularDataConnectionStateChange', options: { slotId: number }, callback: Callback\<{ state: DataConnectState, network: RatType }\>\): void;
Registers an observer for connection status change events of the cellular data link over the SIM card in the specified slot. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Telephony.StateRegistry
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
| type | string | Yes | Connection status change event of the cellular data link. |
| slotId | number | Yes | Card slot ID. <br>- **0**: card slot 1<br>- **1**: card slot 2 |
| callback | Callback\<{ state: [DataConnectState](js-apis-telephony-data.md#dataconnectState), network: [RatType](js-apis-radio.md#radiotechnology) }\> | Yes | Callback used to return the result. For details, see [DataConnectState](js-apis-telephony-data.md#dataconnectstate) and [RadioTechnology](js-apis-radio.md#radiotechnology).|
**Example**
```
observer.on('cellularDataConnectionStateChange', {slotId: 0}, value =>{
console.log("on cellularDataConnectionStateChange, state:" + value.state + ", network:" + value.network);
});
```
## observer.off('cellularDataConnectionStateChange')<sup>7+</sup>
off\(type: 'cellularDataConnectionStateChange', callback?: Callback\<{ state: DataConnectState, network: RatType}\>\): void;
Unregisters the observer for connection status change events of the cellular data link. This API uses an asynchronous callback to return the result.
>**NOTE**
>
>You can pass the callback of the **on** function if you want to cancel listening for a certain type of event. If you do not pass the callback, you will cancel listening for all events.
**System capability**: SystemCapability.Telephony.StateRegistry
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
| type | string | Yes | Connection status change event of the cellular data link. |
| callback | Callback\<{ state: [DataConnectState](js-apis-telephony-data.md#dataconnectState), network: [RatType](js-apis-radio.md#radiotechnology) }\> | No | Callback used to return the result. For details, see [DataConnectState](js-apis-telephony-data.md#dataconnectstate) and [RadioTechnology](js-apis-radio.md#radiotechnology).|
**Example**
```
let callback = value => {
console.log("on cellularDataConnectionStateChange, state:" + value.state + ", network:" + value.network);
}
observer.on('cellularDataConnectionStateChange', callback);
// You can pass the callback of the on method to cancel listening for a certain type of callback. If you do not pass the callback, you will cancel listening for all callbacks.
observer.off('cellularDataConnectionStateChange', callback);
observer.off('cellularDataConnectionStateChange');
```
## observer.on('cellularDataFlowChange')<sup>7+</sup>
on\(type: 'cellularDataFlowChange', callback: Callback\<DataFlowType\>\): void;
Registers an observer for the uplink and downlink data flow status change events of the cellular data service. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Telephony.StateRegistry
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
| type | string | Yes | Uplink and downlink data flow status change event of the cellular data service. |
| callback | Callback\<[DataFlowType](js-apis-telephony-data.md#dataflowtype)\> | Yes | Callback used to return the result. For details, see [DataFlowType](js-apis-telephony-data.md#dataflowtype).|
**Example**
```
observer.on('cellularDataFlowChange', data =>{
console.log("on networkStateChange, data:" + JSON.stringify(data));
});
```
## observer.on('cellularDataFlowChange')<sup>7+</sup>
on\(type: 'cellularDataFlowChange', options: { slotId: number }, callback: Callback\<DataFlowType\>\): void;
Registers an observer for the uplink and downlink data flow status change events of the cellular data service on the SIM card in the specified slot. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Telephony.StateRegistry
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
| type | string | Yes | Uplink and downlink data flow status change event of the cellular data service. |
| slotId | number | Yes | Card slot ID. <br>- **0**: card slot 1<br>- **1**: card slot 2 |
| callback | Callback\<[DataFlowType](js-apis-telephony-data.md#dataflowtype)\> | Yes | Callback used to return the result. For details, see [DataFlowType](js-apis-telephony-data.md#dataflowtype).|
**Example**
```
observer.on('cellularDataFlowChange', {slotId: 0}, data =>{
console.log("on cellularDataFlowChange, data:" + JSON.stringify(data));
});
```
## observer.off('cellularDataFlowChange')<sup>7+</sup>
off\(type: 'cellularDataFlowChange', callback?: Callback\<DataFlowType\>\): void;
Unregisters the observer for the uplink and downlink data flow status change events of the cellular data service. This API uses an asynchronous callback to return the result.
>**NOTE**
>
>You can pass the callback of the **on** function if you want to cancel listening for a certain type of event. If you do not pass the callback, you will cancel listening for all events.
**System capability**: SystemCapability.Telephony.StateRegistry
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
| type | string | Yes | Uplink and downlink data flow status change event of the cellular data service. |
| callback | Callback\<[DataFlowType](js-apis-telephony-data.md#dataflowtype)\> | No | Callback used to return the result. For details, see [DataFlowType](js-apis-telephony-data.md#dataflowtype).|
**Example**
```
let callback = data => {
console.log("on cellularDataFlowChange, data:" + JSON.stringify(data));
}
observer.on('cellularDataFlowChange', callback);
// You can pass the callback of the on method to cancel listening for a certain type of callback. If you do not pass the callback, you will cancel listening for all callbacks.
observer.off('cellularDataFlowChange', callback);
observer.off('cellularDataFlowChange');
```
## observer.on('simStateChange')<sup>7+</sup>
on\(type: 'simStateChange', callback: Callback\<SimStateData\>\): void;
Registers an observer for SIM card status change events. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Telephony.StateRegistry
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
| type | string | Yes | SIM card status change event. |
| callback | Callback\<[SimStateData](#simstatedata7)\> | Yes | Callback used to return the result.|
**Example**
```
observer.on('simStateChange', data =>{
console.log("on simStateChange, data:" + JSON.stringify(data));
});
```
## observer.on('simStateChange')<sup>7+</sup>
on\(type: 'simStateChange', options: { slotId: number }, callback: Callback\<SimStateData\>\): void;
Registers an observer for status change events of the SIM card in the specified slot. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Telephony.StateRegistry
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
| type | string | Yes | SIM card status change event. |
| slotId | number | Yes | Card slot ID. <br>- **0**: card slot 1<br>- **1**: card slot 2 |
| callback | Callback\<[SimStateData](#simstatedata7)\> | Yes | Callback used to return the result.|
**Example**
```
observer.on('simStateChange', {slotId: 0}, data =>{
console.log("on simStateChange, data:" + JSON.stringify(data));
});
```
## observer.off('simStateChange')<sup>7+</sup>
off\(type: 'simStateChange', callback?: Callback\<SimStateData\>\): void;
Unregisters the observer for SIM card status change events. This API uses an asynchronous callback to return the result.
>**NOTE**
>
>You can pass the callback of the **on** function if you want to cancel listening for a certain type of event. If you do not pass the callback, you will cancel listening for all events.
**System capability**: SystemCapability.Telephony.StateRegistry
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
| type | string | Yes | SIM card status change event. |
| callback | Callback\<[SimStateData](#simstatedata7)\> | No | Callback used to return the result.|
**Example**
```
let callback = data => {
console.log("on simStateChange, data:" + JSON.stringify(data));
}
observer.on('simStateChange', callback);
// You can pass the callback of the on method to cancel listening for a certain type of callback. If you do not pass the callback, you will cancel listening for all callbacks.
observer.off('simStateChange', callback);
observer.off('simStateChange');
```
## LockReason<sup>8+</sup>
Enumerates SIM card lock types.
**System capability**: SystemCapability.Telephony.StateRegistry
| Name | Value | Description |
| ----------- | ---- | ----------------- |
| SIM_NONE | 0 | No lock. |
| SIM_PIN | 1 | PIN lock. |
| SIM_PUK | 2 | PUK lock. |
| SIM_PN_PIN | 3 | Network PIN lock. |
| SIM_PN_PUK | 4 | Network PUK lock. |
| SIM_PU_PIN | 5 | Subnet PIN lock. |
| SIM_PU_PUK | 6 | Subnet PUK lock. |
| SIM_PP_PIN | 7 | Service provider PIN lock.|
| SIM_PP_PUK | 8 | Service provider PUK lock.|
| SIM_PC_PIN | 9 | Organization PIN lock. |
| SIM_PC_PUK | 10 | Organization PUK lock. |
| SIM_SIM_PIN | 11 | SIM PIN lock. |
| SIM_SIM_PUK | 12 | SIM PUK lock. |
## SimStateData<sup>7+</sup>
Enumerates SIM card types and states.
**System capability**: SystemCapability.Telephony.StateRegistry
| Name | Type | Description |
| ----------------- | --------------------- | ------------------------------------------------------------ |
| type | [CardType](js-apis-sim.md#cardtype) | SIM card type. For details, see [CardType](js-apis-sim.md#cardtype).|
| state | [SimState](js-apis-sim.md#simstate) | SIM card status. For details, see [SimState](js-apis-sim.md#simstate).|
| reason<sup>8+</sup> | [LockReason](#lockreason8) | SIM card lock type.|
......@@ -11,11 +11,11 @@
import radio from '@ohos.telephony.radio'
```
## radio.getRadioTech<a name=radio.getRadioTech-callback></a>
## radio.getRadioTech
getRadioTech\(slotId: number, callback: AsyncCallback<\{psRadioTech: RadioTechnology, csRadioTech: RadioTechnology\}\>\): void
Obtains the radio access technology (RAT) used by the CS and PS domains. This function uses an asynchronous callback to return the result.
Obtains the radio access technology (RAT) used by the CS and PS domains. This API uses an asynchronous callback to return the result.
**Required permission**: ohos.permission.GET_NETWORK_INFO
......@@ -23,10 +23,10 @@ Obtains the radio access technology (RAT) used by the CS and PS domains. This fu
**Parameters**
| Name| Type| Mandatory| Description|
| Name | Type | Mandatory| Description |
| -------- | ------------------------------------------------------------ | ---- | -------------------------------------- |
| slotId | number | Yes| Card slot ID. The options are as follows: <br/> - **0**: slot 1 <br/> - **1**: slot 2|
| callback | AsyncCallback\<{psRadioTech: [RadioTechnology](#RadioTechnology), csRadioTech:[RadioTechnology](#RadioTechnology)}\> | Yes| Callback used to return the result.|
| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|
| callback | AsyncCallback\<{psRadioTech: [RadioTechnology](#radiotechnology), csRadioTech:[RadioTechnology](#radiotechnology)}\> | Yes | Callback used to return the result. |
**Example**
......@@ -38,11 +38,11 @@ radio.getRadioTech(slotId, (err, data) =>{
```
## radio.getRadioTech<a name=radio.getRadioTech-promise></a>
## radio.getRadioTech
getRadioTech\(slotId: number\): Promise<\{psRadioTech: RadioTechnology, csRadioTech: RadioTechnology\}\>
Obtains the RAT used by the CS and PS domains. This function uses a promise to return the result.
Obtains the RAT used by the CS and PS domains. This API uses a promise to return the result.
**Required permission**: ohos.permission.GET_NETWORK_INFO
......@@ -50,15 +50,15 @@ Obtains the RAT used by the CS and PS domains. This function uses a promise to r
**Parameters**
| Name| Type| Mandatory| Description|
| Name| Type | Mandatory| Description |
| ------ | ------ | ---- | -------------------------------------- |
| slotId | number | Yes| Card slot ID. The options are as follows: <br/> - **0**: slot 1 <br/> - **1**: slot 2|
| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|
**Return value**
| Type| Description|
| Type | Description |
| ------------------------------------------------------------ | ----------------------------------------------- |
| Promise<{psRadioTech: [RadioTechnology](#RadioTechnology), csRadioTech: [RadioTechnology](#RadioTechnology)}> | Promise used to return the result.|
| Promise<{psRadioTech: [RadioTechnology](#radiotechnology), csRadioTech: [RadioTechnology](#radiotechnology)}> | Promise used to return the result.|
**Example**
......@@ -73,11 +73,11 @@ promise.then(data => {
```
## radio.getNetworkState<a name=radio.getNetworkState-callback1></a>
## radio.getNetworkState
getNetworkState\(callback: AsyncCallback<NetworkState\>\): void
Obtains the network status. This function uses an asynchronous callback to return the result.
Obtains the network status. This API uses an asynchronous callback to return the result.
**Required permission**: ohos.permission.GET_NETWORK_INFO
......@@ -85,9 +85,9 @@ Obtains the network status. This function uses an asynchronous callback to retur
**Parameters**
| Name| Type| Mandatory| Description|
| Name | Type | Mandatory| Description |
| -------- | ---------------------------------------------- | ---- | ---------- |
| callback | AsyncCallback\<[NetworkState](#NetworkState)\> | Yes| Callback used to return the result.|
| callback | AsyncCallback\<[NetworkState](#networkstate)\> | Yes | Callback used to return the result.|
**Example**
......@@ -98,11 +98,11 @@ radio.getNetworkState((err, data) =>{
```
## radio.getNetworkState<a name=radio.getNetworkState-callback2></a>
## radio.getNetworkState
getNetworkState\(slotId: number, callback: AsyncCallback<NetworkState\>\): void
Obtains the network status of the SIM card in the specified slot. This function uses an asynchronous callback to return the result.
Obtains the network status. This API uses an asynchronous callback to return the result.
**Required permission**: ohos.permission.GET_NETWORK_INFO
......@@ -110,10 +110,10 @@ Obtains the network status of the SIM card in the specified slot. This function
**Parameters**
| Name| Type| Mandatory| Description|
| Name | Type | Mandatory| Description |
| -------- | ---------------------------------------------- | ---- | -------------------------------------- |
| slotId | number | Yes| Card slot ID. The options are as follows: <br/> - **0**: slot 1 <br/> - **1**: slot 2|
| callback | AsyncCallback\<[NetworkState](#NetworkState)\> | Yes| Callback used to return the result.|
| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|
| callback | AsyncCallback\<[NetworkState](#networkstate)\> | Yes | Callback used to return the result. |
**Example**
......@@ -125,11 +125,11 @@ radio.getNetworkState(slotId, (err, data) => {
```
## radio.getNetworkState<a name=radio.getNetworkState-promise></a>
## radio.getNetworkState
getNetworkState\(slotId?: number\): Promise<NetworkState\>
Obtains the network status of the SIM card in the specified slot. This function uses a promise to return the result.
Obtains the network status of the SIM card in the specified slot. This API uses a promise to return the result.
**Required permission**: ohos.permission.GET_NETWORK_INFO
......@@ -137,15 +137,15 @@ Obtains the network status of the SIM card in the specified slot. This function
**Parameters**
| Name| Type| Mandatory| Description|
| Name| Type | Mandatory| Description |
| ------ | ------ | ---- | -------------------------------------- |
| slotId | number | No| Card slot ID. The options are as follows: <br/> - **0**: slot 1 <br/> - **1**: slot 2|
| slotId | number | No | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|
**Return value**
| Type| Description|
| Type | Description |
| ---------------------------------------- | --------------------------- |
| Promise\<[NetworkState](#NetworkState)\> | Promise used to return the result.|
| Promise\<[NetworkState](#networkstate)\> | Promise used to return the result.|
**Example**
......@@ -160,20 +160,20 @@ promise.then(data => {
```
## radio.getNetworkSelectionMode<a name=radio.getNetworkSelectionMode-callback></a>
## radio.getNetworkSelectionMode
getNetworkSelectionMode\(slotId: number, callback: AsyncCallback<NetworkSelectionMode\>\): void
Obtains the network selection mode of the SIM card in the specified slot. This function uses an asynchronous callback to return the result.
Obtains the network selection mode of the SIM card in the specified slot. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Telephony.CoreService
**Parameters**
| Name| Type| Mandatory| Description|
| Name | Type | Mandatory| Description |
| -------- | ------------------------------------------------------------ | ---- | -------------------------------------- |
| slotId | number | Yes| Card slot ID. The options are as follows: <br/> - **0**: slot 1 <br/> - **1**: slot 2|
| callback | AsyncCallback\<[NetworkSelectionMode](#NetworkSelectionMode)\> | Yes| Callback used to return the result.|
| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|
| callback | AsyncCallback\<[NetworkSelectionMode](#networkselectionMode)\> | Yes | Callback used to return the result. |
**Example**
......@@ -185,25 +185,25 @@ radio.getNetworkSelectionMode(slotId, (err, data) => {
```
## radio.getNetworkSelectionMode<a name=radio.getNetworkSelectionMode-promise></a>
## radio.getNetworkSelectionMode
getNetworkSelectionMode\(slotId: number\): Promise<NetworkSelectionMode\>
Obtains the network selection mode of the SIM card in the specified slot. This function uses a promise to return the result.
Obtains the network selection mode of the SIM card in the specified slot. This API uses a promise to return the result.
**System capability**: SystemCapability.Telephony.CoreService
**Parameters**
| Name| Type| Mandatory| Description|
| Name| Type | Mandatory| Description |
| ------ | ------ | ---- | -------------------------------------- |
| slotId | number | Yes| Card slot ID. The options are as follows: <br/> - **0**: slot 1 <br/> - **1**: slot 2|
| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|
**Return value**
| Type| Description|
| Type | Description |
| -------------------------------------------------------- | ------------------------------- |
| Promise\<[NetworkSelectionMode](#NetworkSelectionMode)\> | Promise used to return the result.|
| Promise\<[NetworkSelectionMode](#networkselectionmode)\> | Promise used to return the result.|
**Example**
......@@ -218,20 +218,20 @@ promise.then(data => {
```
## radio.getISOCountryCodeForNetwork<sup>7+</sup><a name=radio.getISOCountryCodeForNetwork-callback></a>
## radio.getISOCountryCodeForNetwork<sup>7+</sup>
getISOCountryCodeForNetwork\(slotId: number, callback: AsyncCallback<string\>\): void
Obtains the ISO country code of the network with which the SIM card in the specified slot is registered. This function uses an asynchronous callback to return the result.
Obtains the ISO country code of the network with which the SIM card in the specified slot is registered. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Telephony.CoreService
**Parameters**
| Name| Type| Mandatory| Description|
| Name | Type | Mandatory| Description |
| -------- | ----------------------- | ---- | ---------------------------------------- |
| slotId | number | Yes| Card slot ID. The options are as follows: <br/> - **0**: slot 1 <br/> - **1**: slot 2|
| callback | AsyncCallback\<string\> | Yes| Callback used to return the result. which is a country code, for example, **CN** (China).|
| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2 |
| callback | AsyncCallback\<string\> | Yes | Callback used to return the result. which is a country code, for example, **CN** (China).|
**Example**
......@@ -243,23 +243,23 @@ radio.getISOCountryCodeForNetwork(slotId, (err, data) => {
```
## radio.getISOCountryCodeForNetwork<sup>7+</sup><a name=radio.getISOCountryCodeForNetwork-promise></a>
## radio.getISOCountryCodeForNetwork<sup>7+</sup>
getISOCountryCodeForNetwork\(slotId: number\): Promise<string\>
Obtains the ISO country code of the network with which the SIM card in the specified slot is registered. This function uses a promise to return the result.
Obtains the ISO country code of the network with which the SIM card in the specified slot is registered. This API uses a promise to return the result.
**System capability**: SystemCapability.Telephony.CoreService
**Parameters**
| Name| Type| Mandatory| Description|
| Name| Type | Mandatory| Description |
| ------ | ------ | ---- | -------------------------------------- |
| slotId | number | Yes| Card slot ID. The options are as follows: <br/> - **0**: slot 1 <br/> - **1**: slot 2|
| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|
**Return value**
| Type| Description|
| Type | Description |
| ----------------- | ------------------------------------------------------------ |
| Promise\<string\> | Promise used to return the result, which is an ISO country code, for example, **CN** (China).|
......@@ -276,20 +276,69 @@ promise.then(data => {
```
## radio.getSignalInformation<a name=radio.getSignalInformation-callback></a>
## radio.getPrimarySlotId<sup>7+</sup>
getPrimarySlotId\(callback: AsyncCallback\<number\>\): void
Obtains the ID of the slot in which the primary card is located. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Telephony.CoreService
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
| callback | AsyncCallback\<number\> | Yes | Callback used to return the result.|
**Example**
```
radio.getPrimarySlotId((err, data) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
```
## radio.getPrimarySlotId<sup>7+</sup>
getPrimarySlotId\(\): Promise\<number\>
Obtains the ID of the slot in which the primary card is located. This API uses a promise to return the result.
**System capability**: SystemCapability.Telephony.CoreService
**Return value**
| Type | Description |
| ----------------------------------------------------------- | ------------------------------------------------------------ |
| Promise\<number\> | Promise used to return the result.|
**Example**
```
let promise = radio.getPrimarySlotId();
promise.then(data => {
console.log(`getPrimarySlotId success, promise: data->${JSON.stringify(data)}`);
}).catch(err => {
console.error(`getPrimarySlotId fail, promise: err->${JSON.stringify(err)}`);
});
```
## radio.getSignalInformation<sup>7+</sup>
getSignalInformation\(slotId: number, callback: AsyncCallback<Array<SignalInformation\>\>\): void
Obtains a list of signal strengths of the network with which the SIM card in the specified slot is registered. This function uses an asynchronous callback to return the result.
Obtains a list of signal strengths of the network with which the SIM card in the specified slot is registered. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Telephony.CoreService
**Parameters**
| Name| Type| Mandatory| Description|
| Name | Type | Mandatory| Description |
| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
| slotId | number | Yes| Card slot ID. The options are as follows: <br/> - **0**: slot 1<br/> - **1**: slot 2|
| callback | AsyncCallback\<Array\<[SignalInformation](#SignalInformation)\>\> | Yes| Callback used to return the result, which is a list of [SignalInformation](#SignalInformation) objects.|
| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2 |
| callback | AsyncCallback\<Array\<[SignalInformation](#signalinformation)\>\> | Yes | Callback used to return the result, which is a list of [SignalInformation](#signalinformation) objects.|
**Example**
......@@ -301,25 +350,25 @@ radio.getSignalInformation(slotId, (err, data) => {
```
## radio.getSignalInformation<a name=radio.getSignalInformation-promise></a>
## radio.getSignalInformation<sup>7+</sup>
getSignalInformation\(slotId: number\): Promise<Array<SignalInformation\>\>
Obtains a list of signal strengths of the network with which the SIM card in the specified slot is registered. This function uses a promise to return the result.
Obtains a list of signal strengths of the network with which the SIM card in the specified slot is registered. This API uses a promise to return the result.
**System capability**: SystemCapability.Telephony.CoreService
**Parameters**
| Name| Type| Mandatory| Description|
| Name| Type | Mandatory| Description |
| ------ | ------ | ---- | -------------------------------------- |
| slotId | number | Yes| Card slot ID. The options are as follows: <br/> - **0**: slot 1 <br/> - **1**: slot 2|
| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|
**Return value**
| Type| Description|
| Type | Description |
| ----------------------------------------------------------- | ------------------------------------------------------------ |
| Promise\<Array\<[SignalInformation](#SignalInformation)\>\> | Promise used to return the result, which is a list of [SignalInformation](#SignalInformation) objects.|
| Promise\<Array\<[SignalInformation](#signalinformation)\>\> | Promise used to return the result, which is a list of [SignalInformation](#signalinformation) objects.|
**Example**
......@@ -334,11 +383,40 @@ promise.then(data => {
```
## radio.isRadioOn<sup>7+</sup><a name=radio.isRadioOn-callback></a>
## radio.isNrSupported<sup>8+</sup>
isNrSupported\(slotId: number\): boolean
Checks whether the current device supports 5G \(NR\).
**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 |
| ------------------ | ------------------------------------------------------------ |
| boolean | - **true**: The current device supports 5G \(NR\).<br>- **false**: The current device does not support 5G \(NR\).|
**Example**
```
let slotId = 0;
let result = radio.isNrSupported(slotId);
console.log(result);
```
## radio.isRadioOn<sup>7+</sup>
isRadioOn\(callback: AsyncCallback<boolean\>\): void
Checks whether the radio service is enabled on the primary SIM card. This function uses an asynchronous callback to return the result.
Checks whether the radio service is enabled on the primary SIM card. This API uses an asynchronous callback to return the result.
**Required permission**: ohos.permission.GET_NETWORK_INFO
......@@ -346,9 +424,9 @@ Checks whether the radio service is enabled on the primary SIM card. This functi
**Parameters**
| Name| Type| Mandatory| Description|
| Name | Type | Mandatory| Description |
| -------- | ------------------------ | ---- | ------------------------------------------------------- |
| callback | AsyncCallback\<boolean\> | Yes| Callback used to return the result. <br/> - **true**: The radio service is enabled.<br/> - **false**: The radio service is disabled.|
| callback | AsyncCallback\<boolean\> | Yes | Callback used to return the result.<br>- **true**: The radio service is enabled.<br>- **false**: The radio service is disabled.|
**Example**
......@@ -359,11 +437,11 @@ radio.isRadioOn((err, data) => {
```
## radio.isRadioOn<sup>7+</sup><a name=radio.isRadioOn.slot-callback></a>
## radio.isRadioOn<sup>7+</sup>
isRadioOn\(slotId: number, callback: AsyncCallback<boolean\>\): void
Checks whether the radio service is enabled on the SIM card in the specified slot. This function uses an asynchronous callback to return the result.
Checks whether the radio service is enabled on the SIM card in the specified slot. This API uses an asynchronous callback to return the result.
**Required permission**: ohos.permission.GET_NETWORK_INFO
......@@ -371,10 +449,10 @@ Checks whether the radio service is enabled on the SIM card in the specified slo
**Parameters**
| Name| Type| Mandatory| Description|
| Name | Type | Mandatory| Description |
| -------- | ------------------------ | ---- | ------------------------------------------------------- |
| slotId | number | Yes| Card slot ID. The options are as follows: <br/> - **0**: slot 1<br/> - **1**: slot 2|
| callback | AsyncCallback\<boolean\> | Yes| Callback used to return the result. <br/> - **true**: The radio service is enabled.<br/> - **false**: The radio service is disabled.|
| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2 |
| callback | AsyncCallback\<boolean\> | Yes | Callback used to return the result.<br>- **true**: The radio service is enabled.<br>- **false**: The radio service is disabled.|
**Example**
......@@ -386,11 +464,11 @@ radio.isRadioOn(slotId, (err, data) => {
```
## radio.isRadioOn<sup>7+</sup><a name=radio.isRadioOn.slot-promise></a>
## radio.isRadioOn<sup>7+</sup>
isRadioOn\(slotId?: number\): Promise<boolean\>
Checks whether the radio service is enabled. This function uses a promise to return the result.
Checks whether the radio service is enabled. This API uses a promise to return the result.
**Required permission**: ohos.permission.GET_NETWORK_INFO
......@@ -398,15 +476,15 @@ Checks whether the radio service is enabled. This function uses a promise to ret
**Parameters**
| Name| Type| Mandatory| Description|
| Name| Type | Mandatory| Description |
| ------ | ------ | ---- | -------------------------------------- |
| slotId | number | No| Card slot ID. The options are as follows: <br/> - **0**: slot 1<br/> - **1**: slot 2<br/>If the slot ID is not specified, this function is defaulted to check whether the radio service is enabled on the primary SIM card.|
| slotId | number | No | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2<br>If the slot ID is not specified, this API is defaulted to check whether the radio service is enabled on the primary SIM card.|
**Return value**
| Type| Description|
| Type | Description |
| ------------------ | ------------------------------------------------------------ |
| Promise\<boolean\> | Promise used to return the result. <br/> - **true**: The radio service is enabled.<br/> - **false**: The radio service is disabled.|
| Promise\<boolean\> | Promise used to return the result.<br>- **true**: The radio service is enabled.<br>- **false**: The radio service is disabled.|
**Example**
......@@ -421,20 +499,20 @@ promise.then(data => {
```
## radio.getOperatorName<sup>7+</sup><a name=radio.getOperatorName-callback></a>
## radio.getOperatorName<sup>7+</sup>
getOperatorName\(slotId: number, callback: AsyncCallback<string\>\): void
Obtains the carrier name. This function uses an asynchronous callback to return the result.
Obtains the carrier name. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Telephony.CoreService
**Parameters**
| Name| Type| Mandatory| Description|
| Name | Type | Mandatory| Description |
| -------- | ----------------------- | ---- | ------------------------------------------ |
| slotId | number | Yes| Card slot ID. The options are as follows: <br/> - **0**: slot 1 <br/> - **1**: slot 2|
| callback | AsyncCallback\<string\> | Yes| Callback used to return the result, which is the carrier name, for example, China Mobile.|
| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2 |
| callback | AsyncCallback\<string\> | Yes | Callback used to return the result, which is the carrier name, for example, China Mobile.|
**Example**
......@@ -446,25 +524,25 @@ radio.getOperatorName(slotId, (err, data) => {
```
## radio.getOperatorName<sup>7+</sup><a name=radio.getOperatorName-promise></a>
## radio.getOperatorName<sup>7+</sup>
getOperatorName\(slotId: number\): Promise<string\>
Obtains the carrier name. This function uses a promise to return the result.
Obtains the carrier name. This API uses a promise to return the result.
**System capability**: SystemCapability.Telephony.CoreService
**Parameters**
| Name| Type| Mandatory| Description|
| Name| Type | Mandatory| Description |
| ------ | ------ | ---- | -------------------------------------- |
| slotId | number | Yes| Card slot ID. The options are as follows: <br/> - **0**: slot 1 <br/> - **1**: slot 2|
| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|
**Return value**
| Type| Description|
| Type | Description |
| ----------------- | ------------------------------------------------------------ |
| Promise\<string\> | Promise used t return the result, which is the carrier name, for example, China Mobile.|
| Promise\<string\> | Promise used t return the result, which is the carrier name, for example, China Mobile. |
**Example**
......@@ -479,100 +557,114 @@ promise.then(data => {
```
## RadioTechnology<a name=RadioTechnology></a>
## RadioTechnology
Enumerates the RATs.
| Variable| Value| Description|
**System capability**: SystemCapability.Telephony.CoreService
| Name | Value | Description |
| ------------------------- | ---- | ------------------------------------------------------------ |
| RADIO_TECHNOLOGY_UNKNOWN | 0 | Unknown RAT <br>**System capability**: SystemCapability.Telephony.CoreService|
| RADIO_TECHNOLOGY_GSM | 1 | Global System for Mobile Communication (GSM) <br/>**System capability**: SystemCapability.Telephony.CoreService|
| RADIO_TECHNOLOGY_1XRTT | 2 | Single-Carrier Radio Transmission Technology (1XRTT) <br/>**System capability**: SystemCapability.Telephony.CoreService|
| RADIO_TECHNOLOGY_WCDMA | 3 | Wideband Code Division Multiple Access (WCDMA) <br/>**System capability**: SystemCapability.Telephony.CoreService|
| RADIO_TECHNOLOGY_HSPA | 4 | High Speed Packet Access (HSPA) <br/>**System capability**: SystemCapability.Telephony.CoreService|
| RADIO_TECHNOLOGY_HSPAP | 5 | Evolved High Speed Packet Access (HSPA+) <br/>**System capability**: SystemCapability.Telephony.CoreService|
| RADIO_TECHNOLOGY_TD_SCDMA | 6 | Time Division Synchronous Code Division Multiple Access (TD-SCDMA) <br/>**System capability**: SystemCapability.Telephony.CoreService|
| RADIO_TECHNOLOGY_EVDO | 7 | Evolution-Data Optimized (EVDO) <br/>**System capability**: SystemCapability.Telephony.CoreService|
| RADIO_TECHNOLOGY_EHRPD | 8 | Evolved High Rate Package Data (EHRPD) <br/>**System capability**: SystemCapability.Telephony.CoreService|
| RADIO_TECHNOLOGY_LTE | 9 | Long Term Evolution (LTE) <br/>**System capability**: SystemCapability.Telephony.CoreService|
| RADIO_TECHNOLOGY_LTE_CA | 10 | Long Term Evolution_Carrier Aggregation (LTE_CA) <br/>**System capability**: SystemCapability.Telephony.CoreService|
| RADIO_TECHNOLOGY_IWLAN | 11 | Industrial Wireless LAN (IWLAN) <br/>**System capability**: SystemCapability.Telephony.CoreService|
| RADIO_TECHNOLOGY_NR | 12 | New Radio (NR) <br/>**System capability**: SystemCapability.Telephony.CoreService|
## SignalInformation<a name=SignalInformation></a>
| RADIO_TECHNOLOGY_UNKNOWN | 0 | Unknown RAT |
| RADIO_TECHNOLOGY_GSM | 1 | Global System for Mobile Communication (GSM) |
| RADIO_TECHNOLOGY_1XRTT | 2 | Single-Carrier Radio Transmission Technology (1XRTT)|
| RADIO_TECHNOLOGY_WCDMA | 3 | Wideband Code Division Multiple Access (WCDMA)|
| RADIO_TECHNOLOGY_HSPA | 4 | High Speed Packet Access (HSPA) |
| RADIO_TECHNOLOGY_HSPAP | 5 | Evolved High Speed Packet Access (HSPA+) |
| RADIO_TECHNOLOGY_TD_SCDMA | 6 | Time Division Synchronous Code Division Multiple Access (TD-SCDMA)|
| RADIO_TECHNOLOGY_EVDO | 7 | Evolution-Data Optimized (EVDO) |
| RADIO_TECHNOLOGY_EHRPD | 8 | Evolved High Rate Package Data (EHRPD) |
| RADIO_TECHNOLOGY_LTE | 9 | Long Term Evolution (LTE) |
| RADIO_TECHNOLOGY_LTE_CA | 10 | Long Term Evolution_Carrier Aggregation (LTE_CA)|
| RADIO_TECHNOLOGY_IWLAN | 11 | Industrial Wireless LAN (IWLAN) |
| RADIO_TECHNOLOGY_NR | 12 | New Radio (NR) |
## SignalInformation
Defines the signal strength.
| Attribute| Type| Description|
| ----------- | --------------------------- | ------------------------------------------------------------ |
| signalType | [NetworkType](#NetworkType) | Signal strength type. <br/>**System capability**: SystemCapability.Telephony.CoreService|
| signalLevel | number | Signal strength level. <br/>**System capability**: SystemCapability.Telephony.CoreService|
**System capability**: SystemCapability.Telephony.CoreService
| Name | Type | Description |
| ----------- | --------------------------- | ------------------ |
| signalType | [NetworkType](#networktype) | Signal strength type.|
| signalLevel | number | Signal strength level.|
## NetworkType<a name=NetworkType></a>
## NetworkType
Defines the network type.
| Variable| Value| Description|
**System capability**: SystemCapability.Telephony.CoreService
| Name | Value | Description |
| -------------------- | ---- | ------------------------------------------------------------ |
| NETWORK_TYPE_UNKNOWN | 0 | Unknown network <br/>**System capability**: SystemCapability.Telephony.CoreService|
| NETWORK_TYPE_GSM | 1 | GSM network <br/>**System capability**: SystemCapability.Telephony.CoreService|
| NETWORK_TYPE_CDMA | 2 | CDMA network <br/>**System capability**: SystemCapability.Telephony.CoreService|
| NETWORK_TYPE_WCDMA | 3 | WCDMA network <br/>**System capability**: SystemCapability.Telephony.CoreService|
| NETWORK_TYPE_TDSCDMA | 4 | TD-SCDMA network <br/>**System capability**: SystemCapability.Telephony.CoreService|
| NETWORK_TYPE_LTE | 5 | LTE network <br/>**System capability**: SystemCapability.Telephony.CoreService|
| NETWORK_TYPE_NR | 6 | 5G NR network <br/>**System capability**: SystemCapability.Telephony.CoreService|
| NETWORK_TYPE_UNKNOWN | 0 | Unknown network |
| NETWORK_TYPE_GSM | 1 | GSM network |
| NETWORK_TYPE_CDMA | 2 | CDMA network |
| NETWORK_TYPE_WCDMA | 3 | WCDMA network |
| NETWORK_TYPE_TDSCDMA | 4 | TD-SCDMA network|
| NETWORK_TYPE_LTE | 5 | LTE network |
| NETWORK_TYPE_NR | 6 | 5G NR network |
## NetworkState<a name=NetworkState></a>
## NetworkState
Defines the network registration status.
| Variable| Type| Description|
**System capability**: SystemCapability.Telephony.CoreService
| Name | Type | Description |
| ----------------- | --------------------- | ------------------------------------------------------------ |
| longOperatorName | string | Long carrier name of the registered network. <br/>**System capability**: SystemCapability.Telephony.CoreService|
| shortOperatorName | string | Short carrier name of the registered network. <br/>**System capability**: SystemCapability.Telephony.CoreService|
| plmnNumeric | string | PLMN code of the registered network. <br/>**System capability**: SystemCapability.Telephony.CoreService|
| isRoaming | boolean | Whether the user is roaming. <br/>**System capability**: SystemCapability.Telephony.CoreService|
| regState | [RegState](#RegState) | Network registration status of the device. <br/>**System capability**: SystemCapability.Telephony.CoreService|
| cfgTech<sup>8+</sup> | [RadioTechnology](#RadioTechnology) | RAT of the device. <br/>**System capability**: SystemCapability.Telephony.CoreService|
| nsaState | [NsaState](#NsaState) | NSA network registration status of the device. <br/>**System capability**: SystemCapability.Telephony.CoreService|
| isCaActive | boolean | CA status. <br/>**System capability**: SystemCapability.Telephony.CoreService|
| isEmergency | boolean | Whether only emergency calls are allowed. <br/>**System capability**: SystemCapability.Telephony.CoreService|
| longOperatorName | string | Long carrier name of the registered network.|
| shortOperatorName | string | Short carrier name of the registered network.|
| plmnNumeric | string | PLMN code of the registered network.|
| isRoaming | boolean | Whether the user is roaming.|
| regState | [RegState](#regstate) | Network registration status of the device.|
| cfgTech<sup>8+</sup> | [RadioTechnology](#radiotechnology) | RAT of the device.|
| nsaState | [NsaState](#nsaState) | NSA network registration status of the device.|
| isCaActive | boolean | CA status.|
| isEmergency | boolean | Whether only emergency calls are allowed.|
## RegState<a name=RegState></a>
## RegState
Defines the network registration status.
| Variable| Value| Description|
| ----------------------------- | ---- | ------------------------------------------------------------ |
| REG_STATE_NO_SERVICE | 0 | The device cannot use any service. <br/>**System capability**: SystemCapability.Telephony.CoreService|
| REG_STATE_IN_SERVICE | 1 | The device can use services normally. <br/>**System capability**: SystemCapability.Telephony.CoreService|
| REG_STATE_EMERGENCY_CALL_ONLY | 2 | The device can use only the emergency call service. <br/>**System capability**: SystemCapability.Telephony.CoreService|
| REG_STATE_POWER_OFF | 3 | The cellular radio service is disabled. <br/>**System capability**: SystemCapability.Telephony.CoreService|
**System capability**: SystemCapability.Telephony.CoreService
| Name | Value | Description |
| ----------------------------- | ---- | -------------------------- |
| REG_STATE_NO_SERVICE | 0 | The device cannot use any service. |
| REG_STATE_IN_SERVICE | 1 | The device can use services normally. |
| REG_STATE_EMERGENCY_CALL_ONLY | 2 | The device can use only the emergency call service.|
| REG_STATE_POWER_OFF | 3 | The cellular radio service is disabled. |
## NsaState<a name=NsaState></a>
## NsaState
Enumerates NSA network states.
| Variable| Value| Description|
| -------------------------- | ---- | ------------------------------------------------------------ |
| NSA_STATE_NOT_SUPPORT | 1 | The device is in idle or connected state in an LTE cell that does not support NSA. <br/>**System capability**: SystemCapability.Telephony.CoreService|
| NSA_STATE_NO_DETECT | 2 | The device is in the idle state in an LTE cell that supports NSA but does not support NR coverage detection. <br/>**System capability**: SystemCapability.Telephony.CoreService|
| NSA_STATE_CONNECTED_DETECT | 3 | The device is connected to the LTE network in an LTE cell that supports NSA and NR coverage detection. <br/>**System capability**: SystemCapability.Telephony.CoreService|
| NSA_STATE_IDLE_DETECT | 4 | The device is in the idle state in an LTE cell that supports NSA and NR coverage detection. <br/>**System capability**: SystemCapability.Telephony.CoreService|
| NSA_STATE_DUAL_CONNECTED | 5 | The device is connected to the LTE/NR network in an LTE cell that supports NSA. <br/>**System capability**: SystemCapability.Telephony.CoreService|
| NSA_STATE_SA_ATTACHED | 6 | The device is idle or connected to the NG-RAN cell when being attached to the 5G Core. <br/>**System capability**: SystemCapability.Telephony.CoreService|
**System capability**: SystemCapability.Telephony.CoreService
| Name | Value | Description |
| -------------------------- | ---- | ---------------------------------------------------------- |
| NSA_STATE_NOT_SUPPORT | 1 | The device is in idle or connected state in an LTE cell that does not support NSA. |
| NSA_STATE_NO_DETECT | 2 | The device is in the idle state in an LTE cell that supports NSA but not NR coverage detection.|
| NSA_STATE_CONNECTED_DETECT | 3 | The device is connected to the LTE network in an LTE cell that supports NSA and NR coverage detection. |
| NSA_STATE_IDLE_DETECT | 4 | The device is in the idle state in an LTE cell that supports NSA and NR coverage detection. |
| NSA_STATE_DUAL_CONNECTED | 5 | The device is connected to the LTE/NR network in an LTE cell that supports NSA. |
| NSA_STATE_SA_ATTACHED | 6 | The device is idle or connected to the NG-RAN cell when being attached to the 5G Core. |
## NetworkSelectionMode<a name=NetworkSelectionMode></a>
## NetworkSelectionMode
Enumerates network selection modes.
| Variable| Value| Description|
| --------------------------- | ---- | ------------------------------------------------------------ |
| NETWORK_SELECTION_UNKNOWN | 0 | Unknown network selection mode. <br/>**System capability**: SystemCapability.Telephony.CoreService|
| NETWORK_SELECTION_AUTOMATIC | 1 | Automatic network selection mode. <br/>**System capability**: SystemCapability.Telephony.CoreService|
| NETWORK_SELECTION_MANUAL | 2 | Manual network selection mode. <br/>**System capability**: SystemCapability.Telephony.CoreService|
**System capability**: SystemCapability.Telephony.CoreService
| Name | Value | Description |
| --------------------------- | ---- | -------------- |
| NETWORK_SELECTION_UNKNOWN | 0 | Unknown network selection mode.|
| NETWORK_SELECTION_AUTOMATIC | 1 | Automatic network selection mode.|
| NETWORK_SELECTION_MANUAL | 2 | Manual network selection mode.|
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册