diff --git a/en/application-dev/reference/apis/js-apis-observer.md b/en/application-dev/reference/apis/js-apis-observer.md index bb658c1fbd35dcf714092ef915d9c6792a432dcc..cc75cd19bc78261d14039bfb813abb6f3d85f3e3 100644 --- a/en/application-dev/reference/apis/js-apis-observer.md +++ b/en/application-dev/reference/apis/js-apis-observer.md @@ -11,11 +11,11 @@ import observer from '@ohos.telephony.observer' ``` -## observer.on('networkStateChange') +## observer.on('networkStateChange') on\(type: \'networkStateChange\', callback: Callback\): 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') +## observer.on('networkStateChange') on\(type: \'networkStateChange\', options: { slotId: number }, callback: Callback\): 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:
- **0**: slot 1
- **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.
- **0**: card slot 1
- **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') +## observer.off('networkStateChange') off\(type: \'networkStateChange\', callback?: Callback\): 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') +## observer.on('signalInfoChange') on\(type: \'signalInfoChange\', callback: Callback\>): 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\> | 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\> | 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') +## observer.on('signalInfoChange') on\(type: \'signalInfoChange\', options: { slotId: number }, callback: Callback\>): 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:
- **0**: slot 1
- **1**: slot 2| -| callback | Callback\> | 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.
- **0**: card slot 1
- **1**: card slot 2| +| callback | Callback\> | 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') +## observer.off('signalInfoChange') off\(type: \'signalInfoChange\', callback?: Callback\>): 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\> | 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\> | 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') +## 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)
**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.
**number**: phone number.| **Example** @@ -204,11 +204,11 @@ observer.on('callStateChange', value =>{ ``` -## observer.on('callStateChange') +## 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:
- **0**: slot 1
- **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)
**number**: phone number.| +| type | string | Yes | Call status change event. | +| slotId | number | Yes | Card slot ID.
- **0**: card slot 1
- **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.
**number**: phone number.| **Example** @@ -231,11 +231,11 @@ observer.on('callStateChange', {slotId: 0}, value =>{ ``` -## observer.off('callStateChange') +## 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)
**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.
**number**: phone number.| **Example** @@ -263,3 +263,282 @@ observer.on('callStateChange', callback); observer.off('callStateChange', callback); observer.off('callStateChange'); ``` + + +## observer.on('cellularDataConnectionStateChange')7+ + +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')7+ + +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.
- **0**: card slot 1
- **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')7+ + +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')7+ + +on\(type: 'cellularDataFlowChange', callback: Callback\\): 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')7+ + +on\(type: 'cellularDataFlowChange', options: { slotId: number }, callback: Callback\\): 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.
- **0**: card slot 1
- **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')7+ + +off\(type: 'cellularDataFlowChange', callback?: Callback\\): 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')7+ + +on\(type: 'simStateChange', callback: Callback\\): 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')7+ + +on\(type: 'simStateChange', options: { slotId: number }, callback: Callback\\): 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.
- **0**: card slot 1
- **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')7+ + +off\(type: 'simStateChange', callback?: Callback\\): 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'); +``` + + +## LockReason8+ + +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. | + + +## SimStateData7+ + +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).| +| reason8+ | [LockReason](#lockreason8) | SIM card lock type.| diff --git a/en/application-dev/reference/apis/js-apis-radio.md b/en/application-dev/reference/apis/js-apis-radio.md index 2ced67717197ec4576aa69c5424deca6c734c312..f8f768ecc656722305f32f6f5c1e568e8cc37777 100644 --- a/en/application-dev/reference/apis/js-apis-radio.md +++ b/en/application-dev/reference/apis/js-apis-radio.md @@ -11,11 +11,11 @@ import radio from '@ohos.telephony.radio' ``` -## radio.getRadioTech +## 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:
- **0**: slot 1
- **1**: slot 2| -| callback | AsyncCallback\<{psRadioTech: [RadioTechnology](#RadioTechnology), csRadioTech:[RadioTechnology](#RadioTechnology)}\> | Yes| Callback used to return the result.| +| slotId | number | Yes | Card slot ID.
- **0**: card slot 1
- **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 +## 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:
- **0**: slot 1
- **1**: slot 2| +| slotId | number | Yes | Card slot ID.
- **0**: card slot 1
- **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 +## radio.getNetworkState getNetworkState\(callback: AsyncCallback\): 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 +## radio.getNetworkState getNetworkState\(slotId: number, callback: AsyncCallback\): 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:
- **0**: slot 1
- **1**: slot 2| -| callback | AsyncCallback\<[NetworkState](#NetworkState)\> | Yes| Callback used to return the result.| +| slotId | number | Yes | Card slot ID.
- **0**: card slot 1
- **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 +## radio.getNetworkState getNetworkState\(slotId?: number\): Promise -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:
- **0**: slot 1
- **1**: slot 2| +| slotId | number | No | Card slot ID.
- **0**: card slot 1
- **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 +## radio.getNetworkSelectionMode getNetworkSelectionMode\(slotId: number, callback: AsyncCallback\): 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:
- **0**: slot 1
- **1**: slot 2| -| callback | AsyncCallback\<[NetworkSelectionMode](#NetworkSelectionMode)\> | Yes| Callback used to return the result.| +| slotId | number | Yes | Card slot ID.
- **0**: card slot 1
- **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 +## radio.getNetworkSelectionMode getNetworkSelectionMode\(slotId: number\): Promise -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:
- **0**: slot 1
- **1**: slot 2| +| slotId | number | Yes | Card slot ID.
- **0**: card slot 1
- **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.getISOCountryCodeForNetwork7+ +## radio.getISOCountryCodeForNetwork7+ getISOCountryCodeForNetwork\(slotId: number, callback: AsyncCallback\): 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:
- **0**: slot 1
- **1**: slot 2| -| callback | AsyncCallback\ | Yes| Callback used to return the result. which is a country code, for example, **CN** (China).| +| slotId | number | Yes | Card slot ID.
- **0**: card slot 1
- **1**: card slot 2 | +| callback | AsyncCallback\ | 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.getISOCountryCodeForNetwork7+ +## radio.getISOCountryCodeForNetwork7+ getISOCountryCodeForNetwork\(slotId: number\): Promise -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:
- **0**: slot 1
- **1**: slot 2| +| slotId | number | Yes | Card slot ID.
- **0**: card slot 1
- **1**: card slot 2| **Return value** -| Type| Description| +| Type | Description | | ----------------- | ------------------------------------------------------------ | | Promise\ | 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 +## radio.getPrimarySlotId7+ + +getPrimarySlotId\(callback: AsyncCallback\\): 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\ | Yes | Callback used to return the result.| + +**Example** + +``` +radio.getPrimarySlotId((err, data) => { + console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); +}); +``` + + +## radio.getPrimarySlotId7+ + +getPrimarySlotId\(\): Promise\ + +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\ | 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.getSignalInformation7+ getSignalInformation\(slotId: number, callback: AsyncCallback\>\): 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:
- **0**: slot 1
- **1**: slot 2| -| callback | AsyncCallback\\> | Yes| Callback used to return the result, which is a list of [SignalInformation](#SignalInformation) objects.| +| slotId | number | Yes | Card slot ID.
- **0**: card slot 1
- **1**: card slot 2 | +| callback | AsyncCallback\\> | 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 +## radio.getSignalInformation7+ getSignalInformation\(slotId: number\): Promise\> -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:
- **0**: slot 1
- **1**: slot 2| +| slotId | number | Yes | Card slot ID.
- **0**: card slot 1
- **1**: card slot 2| **Return value** -| Type| Description| +| Type | Description | | ----------------------------------------------------------- | ------------------------------------------------------------ | -| Promise\\> | Promise used to return the result, which is a list of [SignalInformation](#SignalInformation) objects.| +| Promise\\> | Promise used to return the result, which is a list of [SignalInformation](#signalinformation) objects.| **Example** @@ -334,11 +383,40 @@ promise.then(data => { ``` -## radio.isRadioOn7+ +## radio.isNrSupported8+ + +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.
- **0**: card slot 1
- **1**: card slot 2| + +**Return value** + +| Type | Description | +| ------------------ | ------------------------------------------------------------ | +| boolean | - **true**: The current device supports 5G \(NR\).
- **false**: The current device does not support 5G \(NR\).| + +**Example** + +``` +let slotId = 0; +let result = radio.isNrSupported(slotId); +console.log(result); +``` + + +## radio.isRadioOn7+ isRadioOn\(callback: AsyncCallback\): 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\ | Yes| Callback used to return the result.
- **true**: The radio service is enabled.
- **false**: The radio service is disabled.| +| callback | AsyncCallback\ | Yes | Callback used to return the result.
- **true**: The radio service is enabled.
- **false**: The radio service is disabled.| **Example** @@ -359,11 +437,11 @@ radio.isRadioOn((err, data) => { ``` -## radio.isRadioOn7+ +## radio.isRadioOn7+ isRadioOn\(slotId: number, callback: AsyncCallback\): 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:
- **0**: slot 1
- **1**: slot 2| -| callback | AsyncCallback\ | Yes| Callback used to return the result.
- **true**: The radio service is enabled.
- **false**: The radio service is disabled.| +| slotId | number | Yes | Card slot ID.
- **0**: card slot 1
- **1**: card slot 2 | +| callback | AsyncCallback\ | Yes | Callback used to return the result.
- **true**: The radio service is enabled.
- **false**: The radio service is disabled.| **Example** @@ -386,11 +464,11 @@ radio.isRadioOn(slotId, (err, data) => { ``` -## radio.isRadioOn7+ +## radio.isRadioOn7+ isRadioOn\(slotId?: number\): Promise -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:
- **0**: slot 1
- **1**: slot 2
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.
- **0**: card slot 1
- **1**: card slot 2
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\ | Promise used to return the result.
- **true**: The radio service is enabled.
- **false**: The radio service is disabled.| +| Promise\ | Promise used to return the result.
- **true**: The radio service is enabled.
- **false**: The radio service is disabled.| **Example** @@ -421,20 +499,20 @@ promise.then(data => { ``` -## radio.getOperatorName7+ +## radio.getOperatorName7+ getOperatorName\(slotId: number, callback: AsyncCallback\): 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:
- **0**: slot 1
- **1**: slot 2| -| callback | AsyncCallback\ | Yes| Callback used to return the result, which is the carrier name, for example, China Mobile.| +| slotId | number | Yes | Card slot ID.
- **0**: card slot 1
- **1**: card slot 2 | +| callback | AsyncCallback\ | 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.getOperatorName7+ +## radio.getOperatorName7+ getOperatorName\(slotId: number\): Promise -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:
- **0**: slot 1
- **1**: slot 2| +| slotId | number | Yes | Card slot ID.
- **0**: card slot 1
- **1**: card slot 2| **Return value** -| Type| Description| +| Type | Description | | ----------------- | ------------------------------------------------------------ | -| Promise\ | Promise used t return the result, which is the carrier name, for example, China Mobile.| +| Promise\ | Promise used t return the result, which is the carrier name, for example, China Mobile. | **Example** @@ -479,100 +557,114 @@ promise.then(data => { ``` -## RadioTechnology +## RadioTechnology Enumerates the RATs. -| Variable| Value| Description| +**System capability**: SystemCapability.Telephony.CoreService + +| Name | Value | Description | | ------------------------- | ---- | ------------------------------------------------------------ | -| RADIO_TECHNOLOGY_UNKNOWN | 0 | Unknown RAT
**System capability**: SystemCapability.Telephony.CoreService| -| RADIO_TECHNOLOGY_GSM | 1 | Global System for Mobile Communication (GSM)
**System capability**: SystemCapability.Telephony.CoreService| -| RADIO_TECHNOLOGY_1XRTT | 2 | Single-Carrier Radio Transmission Technology (1XRTT)
**System capability**: SystemCapability.Telephony.CoreService| -| RADIO_TECHNOLOGY_WCDMA | 3 | Wideband Code Division Multiple Access (WCDMA)
**System capability**: SystemCapability.Telephony.CoreService| -| RADIO_TECHNOLOGY_HSPA | 4 | High Speed Packet Access (HSPA)
**System capability**: SystemCapability.Telephony.CoreService| -| RADIO_TECHNOLOGY_HSPAP | 5 | Evolved High Speed Packet Access (HSPA+)
**System capability**: SystemCapability.Telephony.CoreService| -| RADIO_TECHNOLOGY_TD_SCDMA | 6 | Time Division Synchronous Code Division Multiple Access (TD-SCDMA)
**System capability**: SystemCapability.Telephony.CoreService| -| RADIO_TECHNOLOGY_EVDO | 7 | Evolution-Data Optimized (EVDO)
**System capability**: SystemCapability.Telephony.CoreService| -| RADIO_TECHNOLOGY_EHRPD | 8 | Evolved High Rate Package Data (EHRPD)
**System capability**: SystemCapability.Telephony.CoreService| -| RADIO_TECHNOLOGY_LTE | 9 | Long Term Evolution (LTE)
**System capability**: SystemCapability.Telephony.CoreService| -| RADIO_TECHNOLOGY_LTE_CA | 10 | Long Term Evolution_Carrier Aggregation (LTE_CA)
**System capability**: SystemCapability.Telephony.CoreService| -| RADIO_TECHNOLOGY_IWLAN | 11 | Industrial Wireless LAN (IWLAN)
**System capability**: SystemCapability.Telephony.CoreService| -| RADIO_TECHNOLOGY_NR | 12 | New Radio (NR)
**System capability**: SystemCapability.Telephony.CoreService| - - -## SignalInformation +| 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.
**System capability**: SystemCapability.Telephony.CoreService| -| signalLevel | number | Signal strength level.
**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 +## NetworkType Defines the network type. -| Variable| Value| Description| +**System capability**: SystemCapability.Telephony.CoreService + +| Name | Value | Description | | -------------------- | ---- | ------------------------------------------------------------ | -| NETWORK_TYPE_UNKNOWN | 0 | Unknown network
**System capability**: SystemCapability.Telephony.CoreService| -| NETWORK_TYPE_GSM | 1 | GSM network
**System capability**: SystemCapability.Telephony.CoreService| -| NETWORK_TYPE_CDMA | 2 | CDMA network
**System capability**: SystemCapability.Telephony.CoreService| -| NETWORK_TYPE_WCDMA | 3 | WCDMA network
**System capability**: SystemCapability.Telephony.CoreService| -| NETWORK_TYPE_TDSCDMA | 4 | TD-SCDMA network
**System capability**: SystemCapability.Telephony.CoreService| -| NETWORK_TYPE_LTE | 5 | LTE network
**System capability**: SystemCapability.Telephony.CoreService| -| NETWORK_TYPE_NR | 6 | 5G NR network
**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 +## 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.
**System capability**: SystemCapability.Telephony.CoreService| -| shortOperatorName | string | Short carrier name of the registered network.
**System capability**: SystemCapability.Telephony.CoreService| -| plmnNumeric | string | PLMN code of the registered network.
**System capability**: SystemCapability.Telephony.CoreService| -| isRoaming | boolean | Whether the user is roaming.
**System capability**: SystemCapability.Telephony.CoreService| -| regState | [RegState](#RegState) | Network registration status of the device.
**System capability**: SystemCapability.Telephony.CoreService| -| cfgTech8+ | [RadioTechnology](#RadioTechnology) | RAT of the device.
**System capability**: SystemCapability.Telephony.CoreService| -| nsaState | [NsaState](#NsaState) | NSA network registration status of the device.
**System capability**: SystemCapability.Telephony.CoreService| -| isCaActive | boolean | CA status.
**System capability**: SystemCapability.Telephony.CoreService| -| isEmergency | boolean | Whether only emergency calls are allowed.
**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.| +| cfgTech8+ | [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 +## RegState Defines the network registration status. -| Variable| Value| Description| -| ----------------------------- | ---- | ------------------------------------------------------------ | -| REG_STATE_NO_SERVICE | 0 | The device cannot use any service.
**System capability**: SystemCapability.Telephony.CoreService| -| REG_STATE_IN_SERVICE | 1 | The device can use services normally.
**System capability**: SystemCapability.Telephony.CoreService| -| REG_STATE_EMERGENCY_CALL_ONLY | 2 | The device can use only the emergency call service.
**System capability**: SystemCapability.Telephony.CoreService| -| REG_STATE_POWER_OFF | 3 | The cellular radio service is disabled.
**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 +## 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.
**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.
**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.
**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.
**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.
**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.
**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 +## NetworkSelectionMode Enumerates network selection modes. -| Variable| Value| Description| -| --------------------------- | ---- | ------------------------------------------------------------ | -| NETWORK_SELECTION_UNKNOWN | 0 | Unknown network selection mode.
**System capability**: SystemCapability.Telephony.CoreService| -| NETWORK_SELECTION_AUTOMATIC | 1 | Automatic network selection mode.
**System capability**: SystemCapability.Telephony.CoreService| -| NETWORK_SELECTION_MANUAL | 2 | Manual network selection mode.
**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.|