js-apis-radio.md 24.8 KB
Newer Older
S
shawn_he 已提交
1 2
# Radio

S
shawn_he 已提交
3
>**NOTE**
S
shawn_he 已提交
4
>
Z
zengyawen 已提交
5
>The initial APIs of this module are supported since API version 6. Newly added APIs will be marked with a superscript to indicate their earliest API version.
S
shawn_he 已提交
6 7 8 9 10 11 12 13 14 15 16 17


## Modules to Import

```
import radio from '@ohos.telephony.radio'
```

## radio.getRadioTech<a name=radio.getRadioTech-callback></a>

getRadioTech\(slotId: number, callback: AsyncCallback<\{psRadioTech: RadioTechnology, csRadioTech: RadioTechnology\}\>\): void

S
shawn_he 已提交
18
Obtains the radio access technology (RAT) used by the CS and PS domains. This function uses an asynchronous callback to return the result.
S
shawn_he 已提交
19

S
shawn_he 已提交
20 21 22
**Required permission**: ohos.permission.GET_NETWORK_INFO

**System capability**: SystemCapability.Telephony.CoreService
S
shawn_he 已提交
23

S
shawn_he 已提交
24
**Parameters**
S
shawn_he 已提交
25

S
shawn_he 已提交
26 27 28 29
| 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.|
S
shawn_he 已提交
30

S
shawn_he 已提交
31
**Example**
S
shawn_he 已提交
32

S
shawn_he 已提交
33 34 35 36 37 38
```
let slotId = 0;
radio.getRadioTech(slotId, (err, data) =>{ 
    console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
```
S
shawn_he 已提交
39 40 41 42 43 44 45 46


## radio.getRadioTech<a name=radio.getRadioTech-promise></a>

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. 

S
shawn_he 已提交
47 48 49
**Required permission**: ohos.permission.GET_NETWORK_INFO

**System capability**: SystemCapability.Telephony.CoreService
S
shawn_he 已提交
50

S
shawn_he 已提交
51
**Parameters**
S
shawn_he 已提交
52

S
shawn_he 已提交
53 54 55
| Name| Type| Mandatory| Description|
| ------ | ------ | ---- | -------------------------------------- |
| slotId | number | Yes| Card slot ID. The options are as follows: <br/> - **0**: slot 1 <br/> - **1**: slot 2|
S
shawn_he 已提交
56

S
shawn_he 已提交
57
**Return value**
S
shawn_he 已提交
58

S
shawn_he 已提交
59 60 61
| Type| Description|
| ------------------------------------------------------------ | ----------------------------------------------- |
| Promise<{psRadioTech: [RadioTechnology](#RadioTechnology), csRadioTech: [RadioTechnology](#RadioTechnology)}> | Promise used to return the result.|
S
shawn_he 已提交
62

S
shawn_he 已提交
63
**Example**
S
shawn_he 已提交
64

S
shawn_he 已提交
65 66 67 68 69 70 71 72 73
```
let slotId = 0;
let promise = radio.getRadioTech(slotId);
promise.then(data => {
    console.log(`getRadioTech success, data->${JSON.stringify(data)}`);
}).catch(err => {
    console.log(`getRadioTech fail, err->${JSON.stringify(err)}`);
});
```
S
shawn_he 已提交
74 75 76 77 78 79


## radio.getNetworkState<a name=radio.getNetworkState-callback1></a>

getNetworkState\(callback: AsyncCallback<NetworkState\>\): void

S
shawn_he 已提交
80
Obtains the network status. This function uses an asynchronous callback to return the result.
S
shawn_he 已提交
81

S
shawn_he 已提交
82 83 84
**Required permission**: ohos.permission.GET_NETWORK_INFO

**System capability**: SystemCapability.Telephony.CoreService
S
shawn_he 已提交
85

S
shawn_he 已提交
86
**Parameters**
S
shawn_he 已提交
87

S
shawn_he 已提交
88 89
| Name| Type| Mandatory| Description|
| -------- | ---------------------------------------------- | ---- | ---------- |
S
shawn_he 已提交
90
| callback | AsyncCallback\<[NetworkState](#NetworkState)\> | Yes| Callback used to return the result.|
S
shawn_he 已提交
91

S
shawn_he 已提交
92
**Example**
S
shawn_he 已提交
93

S
shawn_he 已提交
94 95 96 97 98
```
radio.getNetworkState((err, data) =>{
    console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
```
S
shawn_he 已提交
99 100 101 102 103 104 105 106


## radio.getNetworkState<a name=radio.getNetworkState-callback2></a>

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.

S
shawn_he 已提交
107 108 109
**Required permission**: ohos.permission.GET_NETWORK_INFO

**System capability**: SystemCapability.Telephony.CoreService
S
shawn_he 已提交
110

S
shawn_he 已提交
111
**Parameters**
S
shawn_he 已提交
112

S
shawn_he 已提交
113 114 115 116
| 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.|
S
shawn_he 已提交
117

S
shawn_he 已提交
118
**Example**
S
shawn_he 已提交
119

S
shawn_he 已提交
120 121 122 123 124 125
```
let slotId = 0;
radio.getNetworkState(slotId, (err, data) => {
    console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
```
S
shawn_he 已提交
126 127 128 129 130 131 132 133


## radio.getNetworkState<a name=radio.getNetworkState-promise></a>

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.

S
shawn_he 已提交
134 135 136
**Required permission**: ohos.permission.GET_NETWORK_INFO

**System capability**: SystemCapability.Telephony.CoreService
S
shawn_he 已提交
137

S
shawn_he 已提交
138
**Parameters**
S
shawn_he 已提交
139

S
shawn_he 已提交
140 141 142
| Name| Type| Mandatory| Description|
| ------ | ------ | ---- | -------------------------------------- |
| slotId | number | No| Card slot ID. The options are as follows: <br/> - **0**: slot 1 <br/> - **1**: slot 2|
S
shawn_he 已提交
143

S
shawn_he 已提交
144
**Return value**
S
shawn_he 已提交
145

S
shawn_he 已提交
146 147 148
| Type| Description|
| ---------------------------------------- | --------------------------- |
| Promise\<[NetworkState](#NetworkState)\> | Promise used to return the result.|
S
shawn_he 已提交
149

S
shawn_he 已提交
150
**Example**
S
shawn_he 已提交
151

S
shawn_he 已提交
152 153 154 155 156 157 158 159 160
```
let slotId = 0;
let promise = radio.getNetworkState(slotId);
promise.then(data => {
    console.log(`getNetworkState success, promise: data->${JSON.stringify(data)}`);
}).catch(err => {
    console.log(`getNetworkState fail, promise: err->${JSON.stringify(err)}`);
});
```
S
shawn_he 已提交
161 162 163 164 165 166 167 168


## radio.getNetworkSelectionMode<a name=radio.getNetworkSelectionMode-callback></a>

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.

S
shawn_he 已提交
169 170
**System capability**: SystemCapability.Telephony.CoreService

S
shawn_he 已提交
171
**Parameters**
S
shawn_he 已提交
172

S
shawn_he 已提交
173 174 175 176
| 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.|
S
shawn_he 已提交
177

S
shawn_he 已提交
178
**Example**
S
shawn_he 已提交
179

S
shawn_he 已提交
180 181 182 183 184 185
```
let slotId = 0;
radio.getNetworkSelectionMode(slotId, (err, data) => {
    console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
```
S
shawn_he 已提交
186 187 188 189 190 191 192 193


## radio.getNetworkSelectionMode<a name=radio.getNetworkSelectionMode-promise></a>

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.

S
shawn_he 已提交
194 195
**System capability**: SystemCapability.Telephony.CoreService

S
shawn_he 已提交
196
**Parameters**
S
shawn_he 已提交
197

S
shawn_he 已提交
198 199 200
| Name| Type| Mandatory| Description|
| ------ | ------ | ---- | -------------------------------------- |
| slotId | number | Yes| Card slot ID. The options are as follows: <br/> - **0**: slot 1 <br/> - **1**: slot 2|
S
shawn_he 已提交
201

S
shawn_he 已提交
202
**Return value**
S
shawn_he 已提交
203

S
shawn_he 已提交
204 205 206
| Type| Description|
| -------------------------------------------------------- | ------------------------------- |
| Promise\<[NetworkSelectionMode](#NetworkSelectionMode)\> | Promise used to return the result.|
S
shawn_he 已提交
207

S
shawn_he 已提交
208
**Example**
S
shawn_he 已提交
209

S
shawn_he 已提交
210 211 212 213 214 215 216 217 218
```
let slotId = 0;
let promise = radio.getNetworkSelectionMode(slotId);
promise.then(data => {
    console.log(`getNetworkSelectionMode success, promise: data->${JSON.stringify(data)}`);
}).catch(err => {
    console.log(`getNetworkSelectionMode fail, promise: err->${JSON.stringify(err)}`);
});
```
S
shawn_he 已提交
219 220 221 222 223 224 225 226


## radio.getISOCountryCodeForNetwork<sup>7+</sup><a name=radio.getISOCountryCodeForNetwork-callback></a>

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.

S
shawn_he 已提交
227 228
**System capability**: SystemCapability.Telephony.CoreService

S
shawn_he 已提交
229
**Parameters**
S
shawn_he 已提交
230

S
shawn_he 已提交
231 232 233
| Name| Type| Mandatory| Description|
| -------- | ----------------------- | ---- | ---------------------------------------- |
| slotId   | number                  | Yes| Card slot ID. The options are as follows: <br/> - **0**: slot 1 <br/> - **1**: slot 2|
S
shawn_he 已提交
234
| callback | AsyncCallback\<string\> | Yes| Callback used to return the result. which is a country code, for example, **CN** (China).|
S
shawn_he 已提交
235

S
shawn_he 已提交
236
**Example**
S
shawn_he 已提交
237

S
shawn_he 已提交
238 239 240 241 242 243
```
let slotId = 0;
radio.getISOCountryCodeForNetwork(slotId, (err, data) => {
    console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
```
S
shawn_he 已提交
244 245 246 247 248 249 250 251


## radio.getISOCountryCodeForNetwork<sup>7+</sup><a name=radio.getISOCountryCodeForNetwork-promise></a>

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.

S
shawn_he 已提交
252 253
**System capability**: SystemCapability.Telephony.CoreService

S
shawn_he 已提交
254
**Parameters**
S
shawn_he 已提交
255

S
shawn_he 已提交
256 257 258
| Name| Type| Mandatory| Description|
| ------ | ------ | ---- | -------------------------------------- |
| slotId | number | Yes| Card slot ID. The options are as follows: <br/> - **0**: slot 1 <br/> - **1**: slot 2|
S
shawn_he 已提交
259

S
shawn_he 已提交
260
**Return value**
S
shawn_he 已提交
261

S
shawn_he 已提交
262 263 264
| Type| Description|
| ----------------- | ------------------------------------------------------------ |
| Promise\<string\> | Promise used to return the result, which is an ISO country code, for example, **CN** (China).|
S
shawn_he 已提交
265

S
shawn_he 已提交
266
**Example**
S
shawn_he 已提交
267

S
shawn_he 已提交
268 269 270 271 272 273 274 275 276
```
let slotId = 0;
let promise = radio.getISOCountryCodeForNetwork(slotId);
promise.then(data => {
    console.log(`getISOCountryCodeForNetwork success, promise: data->${JSON.stringify(data)}`);
}).catch(err => {
    console.log(`getISOCountryCodeForNetwork fail, promise: err->${JSON.stringify(err)}`);
});
```
S
shawn_he 已提交
277 278 279 280 281 282 283 284


## radio.getSignalInformation<a name=radio.getSignalInformation-callback></a>

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. 

S
shawn_he 已提交
285 286
**System capability**: SystemCapability.Telephony.CoreService

S
shawn_he 已提交
287
**Parameters**
S
shawn_he 已提交
288

S
shawn_he 已提交
289 290 291 292
| 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.|
S
shawn_he 已提交
293

S
shawn_he 已提交
294
**Example**
S
shawn_he 已提交
295

S
shawn_he 已提交
296 297 298 299 300 301
```
let slotId = 0;
radio.getSignalInformation(slotId, (err, data) => {
   console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
```
S
shawn_he 已提交
302 303 304 305 306 307 308 309


## radio.getSignalInformation<a name=radio.getSignalInformation-promise></a>

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. 

S
shawn_he 已提交
310 311
**System capability**: SystemCapability.Telephony.CoreService

S
shawn_he 已提交
312
**Parameters**
S
shawn_he 已提交
313

S
shawn_he 已提交
314 315 316
| Name| Type| Mandatory| Description|
| ------ | ------ | ---- | -------------------------------------- |
| slotId | number | Yes| Card slot ID. The options are as follows: <br/> - **0**: slot 1 <br/> - **1**: slot 2|
S
shawn_he 已提交
317

S
shawn_he 已提交
318
**Return value**
S
shawn_he 已提交
319

S
shawn_he 已提交
320 321 322
| Type| Description|
| ----------------------------------------------------------- | ------------------------------------------------------------ |
| Promise\<Array\<[SignalInformation](#SignalInformation)\>\> | Promise used to return the result, which is a list of [SignalInformation](#SignalInformation) objects.|
S
shawn_he 已提交
323

S
shawn_he 已提交
324
**Example**
S
shawn_he 已提交
325

S
shawn_he 已提交
326 327 328 329 330 331 332 333 334
```
let slotId = 0;
let promise = radio.getSignalInformation(slotId);
promise.then(data => {
    console.log(`getSignalInformation success, promise: data->${JSON.stringify(data)}`);
}).catch(err => {
    console.error(`getSignalInformation fail, promise: err->${JSON.stringify(err)}`);
});
```
S
shawn_he 已提交
335 336 337 338 339 340


## radio.isRadioOn<sup>7+</sup><a name=radio.isRadioOn-callback></a>

isRadioOn\(callback: AsyncCallback<boolean\>\): void

S
shawn_he 已提交
341 342 343
Checks whether the radio service is enabled on the primary SIM card. This function uses an asynchronous callback to return the result.

**Required permission**: ohos.permission.GET_NETWORK_INFO
S
shawn_he 已提交
344

S
shawn_he 已提交
345
**System capability**: SystemCapability.Telephony.CoreService
S
shawn_he 已提交
346

S
shawn_he 已提交
347
**Parameters**
S
shawn_he 已提交
348

S
shawn_he 已提交
349 350 351
| 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.|
S
shawn_he 已提交
352

S
shawn_he 已提交
353
**Example**
S
shawn_he 已提交
354

S
shawn_he 已提交
355 356 357 358 359
```
radio.isRadioOn((err, data) => {
    console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
```
S
shawn_he 已提交
360 361


S
shawn_he 已提交
362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389
## radio.isRadioOn<sup>7+</sup><a name=radio.isRadioOn.slot-callback></a>

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.

**Required permission**: ohos.permission.GET_NETWORK_INFO

**System capability**: SystemCapability.Telephony.CoreService

**Parameters**

| 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.|

**Example**

```
let slotId = 0;
radio.isRadioOn(slotId, (err, data) => {
    console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
```


## radio.isRadioOn<sup>7+</sup><a name=radio.isRadioOn.slot-promise></a>
S
shawn_he 已提交
390

S
shawn_he 已提交
391
isRadioOn\(slotId?: number\): Promise<boolean\>
S
shawn_he 已提交
392

S
shawn_he 已提交
393
Checks whether the radio service is enabled. This function uses a promise to return the result.
S
shawn_he 已提交
394

S
shawn_he 已提交
395 396 397 398 399 400 401 402 403
**Required permission**: ohos.permission.GET_NETWORK_INFO

**System capability**: SystemCapability.Telephony.CoreService

**Parameters**

| 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.|
S
shawn_he 已提交
404

S
shawn_he 已提交
405
**Return value**
S
shawn_he 已提交
406

S
shawn_he 已提交
407 408 409
| Type| Description|
| ------------------ | ------------------------------------------------------------ |
| Promise\<boolean\> | Promise used to return the result. <br/> - **true**: The radio service is enabled.<br/> - **false**: The radio service is disabled.|
S
shawn_he 已提交
410

S
shawn_he 已提交
411
**Example**
S
shawn_he 已提交
412

S
shawn_he 已提交
413
```
S
shawn_he 已提交
414 415
let slotId = 0;
let promise = radio.isRadioOn(slotId);
S
shawn_he 已提交
416 417 418 419 420 421
promise.then(data => {
    console.log(`isRadioOn success, promise: data->${JSON.stringify(data)}`);
}).catch(err => {
    console.error(`isRadioOn fail, promise: err->${JSON.stringify(err)}`);
});
```
S
shawn_he 已提交
422 423


S
shawn_he 已提交
424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481
## radio.getOperatorName<sup>7+</sup><a name=radio.getOperatorName-callback></a>

getOperatorName\(slotId: number, callback: AsyncCallback<string\>\): void

Obtains the carrier name. This function uses an asynchronous callback to return the result.

**System capability**: SystemCapability.Telephony.CoreService

**Parameters**

| 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.|

**Example**

```
let slotId = 0;
radio.getOperatorName(slotId, (err, data) => {
    console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
```


## radio.getOperatorName<sup>7+</sup><a name=radio.getOperatorName-promise></a>

getOperatorName\(slotId: number\): Promise<string\>

Obtains the carrier name. This function uses a promise to return the result.

**System capability**: SystemCapability.Telephony.CoreService

**Parameters**

| Name| Type| Mandatory| Description|
| ------ | ------ | ---- | -------------------------------------- |
| slotId | number | Yes| Card slot ID. The options are as follows: <br/> - **0**: slot 1 <br/> - **1**: slot 2|

**Return value**

| Type| Description|
| ----------------- | ------------------------------------------------------------ |
| Promise\<string\> | Promise used t return the result, which is the carrier name, for example, China Mobile.|

**Example**

```
let slotId = 0;
let promise = radio.getOperatorName(slotId);
promise.then(data => {
    console.log(`getOperatorName success, promise: data->${JSON.stringify(data)}`);
}).catch(err => {
    console.log(`getOperatorName fail, promise: err->${JSON.stringify(err)}`);
});
```


S
shawn_he 已提交
482 483 484 485 486 487
## RadioTechnology<a name=RadioTechnology></a>

Enumerates the RATs.

| Variable| Value| Description|
| ------------------------- | ---- | ------------------------------------------------------------ |
S
shawn_he 已提交
488 489 490 491 492 493 494 495 496 497 498 499 500
| 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|
S
shawn_he 已提交
501 502 503 504 505 506 507


## SignalInformation<a name=SignalInformation></a>

Defines the signal strength.

| Attribute| Type| Description|
S
shawn_he 已提交
508 509 510
| ----------- | --------------------------- | ------------------------------------------------------------ |
| signalType  | [NetworkType](#NetworkType) | Signal strength type. <br/>**System capability**: SystemCapability.Telephony.CoreService|
| signalLevel | number                      | Signal strength level. <br/>**System capability**: SystemCapability.Telephony.CoreService|
S
shawn_he 已提交
511 512 513 514


## NetworkType<a name=NetworkType></a>

S
shawn_he 已提交
515
Defines the network type.
S
shawn_he 已提交
516 517 518

| Variable| Value| Description|
| -------------------- | ---- | ------------------------------------------------------------ |
S
shawn_he 已提交
519 520 521 522 523 524 525
| 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|
S
shawn_he 已提交
526 527 528 529 530 531

## NetworkState<a name=NetworkState></a>

Defines the network registration status.

| Variable| Type| Description|
S
shawn_he 已提交
532 533 534 535 536 537 538 539 540 541
| ----------------- | --------------------- | ------------------------------------------------------------ |
| 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|
S
shawn_he 已提交
542 543 544 545


## RegState<a name=RegState></a>

S
shawn_he 已提交
546
Defines the network registration status.
S
shawn_he 已提交
547 548

| Variable| Value| Description|
S
shawn_he 已提交
549 550 551 552 553
| ----------------------------- | ---- | ------------------------------------------------------------ |
| 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|
S
shawn_he 已提交
554 555 556 557 558 559 560


## NsaState<a name=NsaState></a>

Enumerates NSA network states.

| Variable| Value| Description|
S
shawn_he 已提交
561 562 563 564 565 566 567
| -------------------------- | ---- | ------------------------------------------------------------ |
| 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|
S
shawn_he 已提交
568 569 570 571 572 573 574


## NetworkSelectionMode<a name=NetworkSelectionMode></a>

Enumerates network selection modes.

| Variable| Value| Description|
S
shawn_he 已提交
575 576 577 578
| --------------------------- | ---- | ------------------------------------------------------------ |
| 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|