1/* 2 * Copyright (C) 2021-2022 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16import {AsyncCallback} from "./basic"; 17 18/** 19 * Provides interfaces for applications to obtain the network state, cell information, signal information, 20 * and device ID of the wireless cellular network (WCN), and provides a callback registration mechanism to 21 * listen for changes of the network, cell, and signal status of the WCN. 22 * 23 * @since 6 24 * @syscap SystemCapability.Telephony.CoreService 25 */ 26declare namespace radio { 27 /** 28 * Obtains radio access technology (RAT) of the registered network. The system 29 * returns RAT of the packet service (PS) and circuit service (CS) domain. 30 * 31 * @param slotId Indicates the card slot index number, 32 * ranging from 0 to the maximum card slot index number supported by the device. 33 * @param callback Returns an integer indicating the RAT in use. The values are as follows: 34 * <ul> 35 * <li>{@code RadioTechnology#RADIO_TECHNOLOGY_UNKNOWN} 36 * <li>{@code RadioTechnology#RADIO_TECHNOLOGY_GSM} 37 * <li>{@code RadioTechnology#RADIO_TECHNOLOGY_1XRTT} 38 * <li>{@code RadioTechnology#RADIO_TECHNOLOGY_WCDMA} 39 * <li>{@code RadioTechnology#RADIO_TECHNOLOGY_HSPA} 40 * <li>{@code RadioTechnology#RADIO_TECHNOLOGY_HSPAP} 41 * <li>{@code RadioTechnology#RADIO_TECHNOLOGY_TD_SCDMA} 42 * <li>{@code RadioTechnology#RADIO_TECHNOLOGY_EVDO} 43 * <li>{@code RadioTechnology#RADIO_TECHNOLOGY_EHRPD} 44 * <li>{@code RadioTechnology#RADIO_TECHNOLOGY_LTE} 45 * <li>{@code RadioTechnology#RADIO_TECHNOLOGY_LTE_CA} 46 * <li>{@code RadioTechnology#RADIO_TECHNOLOGY_IWLAN} 47 * <li>{@code RadioTechnology#RADIO_TECHNOLOGY_NR} 48 * </ul> 49 * @permission ohos.permission.GET_NETWORK_INFO 50 */ 51 function getRadioTech(slotId: number, 52 callback: AsyncCallback<{psRadioTech: RadioTechnology, csRadioTech: RadioTechnology}>): void; 53 function getRadioTech(slotId: number): Promise<{psRadioTech: RadioTechnology, csRadioTech: RadioTechnology}>; 54 55 /** 56 * Obtains the network state of the registered network. 57 * 58 * @param slotId Indicates the card slot index number, 59 * ranging from 0 to the maximum card slot index number supported by the device. 60 * @param callback Returns a {@code NetworkState} object. 61 * @permission ohos.permission.GET_NETWORK_INFO 62 */ 63 function getNetworkState(callback: AsyncCallback<NetworkState>): void; 64 function getNetworkState(slotId: number, callback: AsyncCallback<NetworkState>): void; 65 function getNetworkState(slotId?: number): Promise<NetworkState>; 66 67 /** 68 * Proactively requests to update location information. 69 * 70 * @systemapi Hide this for inner system use. 71 * @since 8 72 */ 73 function sendUpdateCellLocationRequest(callback: AsyncCallback<void>): void; 74 function sendUpdateCellLocationRequest(): Promise<void>; 75 76 /** 77 * @permission ohos.permission.LOCATION 78 * @systemapi Hide this for inner system use. 79 * @since 8 80 */ 81 function getCellInformation(callback: AsyncCallback<Array<CellInformation>>): void; 82 function getCellInformation(slotId: number, callback: AsyncCallback<Array<CellInformation>>): void; 83 function getCellInformation(slotId?: number): Promise<Array<CellInformation>>; 84 85 /** 86 * Obtains the network search mode of the SIM card in a specified slot. 87 * 88 * @param slotId Indicates the ID of the SIM card slot. 89 * @param callback Returns the network search mode of the SIM card. Available values are as follows: 90 * <ul> 91 * <li>{@link NetworkSelectionMode#NETWORK_SELECTION_UNKNOWN} 92 * <li>{@link NetworkSelectionMode#NETWORK_SELECTION_AUTOMATIC} 93 * <li>{@link NetworkSelectionMode#NETWORK_SELECTION_MANUAL} 94 * <ul> 95 */ 96 function getNetworkSelectionMode(slotId: number, callback: AsyncCallback<NetworkSelectionMode>): void; 97 function getNetworkSelectionMode(slotId: number): Promise<NetworkSelectionMode>; 98 99 /** 100 * @permission ohos.permission.SET_TELEPHONY_STATE 101 * @systemapi Hide this for inner system use. 102 */ 103 function setNetworkSelectionMode(options: NetworkSelectionModeOptions, callback: AsyncCallback<void>): void; 104 function setNetworkSelectionMode(options: NetworkSelectionModeOptions): Promise<void>; 105 106 /** 107 * @permission ohos.permission.GET_TELEPHONY_STATE 108 * @systemapi Hide this for inner system use. 109 */ 110 function getNetworkSearchInformation(slotId: number, callback: AsyncCallback<NetworkSearchResult>): void; 111 function getNetworkSearchInformation(slotId: number): Promise<NetworkSearchResult>; 112 113 /** 114 * Obtains the ISO-defined country code of the country where the registered network is deployed. 115 * 116 * @param slotId Indicates the card slot index number, 117 * ranging from 0 to the maximum card slot index number supported by the device. 118 * @param callback Returns the country code defined in ISO 3166-2; 119 * returns an empty string if the device is not registered with any network. 120 * @since 7 121 */ 122 function getISOCountryCodeForNetwork(slotId: number, callback: AsyncCallback<string>): void; 123 function getISOCountryCodeForNetwork(slotId: number): Promise<string>; 124 125 /** 126 * @systemapi Hide this for inner system use. 127 * @since 8 128 */ 129 function getNrOptionMode(callback: AsyncCallback<NrOptionMode>): void; 130 function getNrOptionMode(slotId: number, callback: AsyncCallback<NrOptionMode>): void; 131 function getNrOptionMode(slotId?: number): Promise<NrOptionMode>; 132 133 /** 134 * Obtains the IMEI of a specified card slot of the device. 135 * 136 * @param slotId Indicates the card slot index number, ranging from 0 to the maximum card slot index number 137 * supported by the device. 138 * @param callback Returns the IMEI; returns an empty string if the IMEI does not exist. 139 * @permission ohos.permission.GET_TELEPHONY_STATE 140 * @systemapi Hide this for inner system use. 141 * @since 8 142 */ 143 function getIMEI(callback: AsyncCallback<string>): void; 144 function getIMEI(slotId: number, callback: AsyncCallback<string>): void; 145 function getIMEI(slotId?: number): Promise<string>; 146 147 /** 148 * Obtains the MEID of a specified card slot of the device. 149 * 150 * @param slotId Indicates the card slot index number, ranging from 0 to the maximum card slot index number 151 * supported by the device. 152 * @param callback Returns the MEID; returns an empty string if the MEID does not exist. 153 * @permission ohos.permission.GET_TELEPHONY_STATE 154 * @systemapi Hide this for inner system use. 155 * @since 8 156 */ 157 function getMEID(callback: AsyncCallback<string>): void; 158 function getMEID(slotId: number, callback: AsyncCallback<string>): void; 159 function getMEID(slotId?: number): Promise<string>; 160 161 /** 162 * Obtains the unique device ID of a specified card slot of the device. 163 * 164 * <p>If the device is registered with a 3GPP-compliant network, the international mobile equipment identity 165 * (IMEI) is returned. If the device is registered with a 3GPP2-compliant network, the mobile equipment identifier 166 * (MEID) is returned. 167 * 168 * @param slotId Indicates the card slot index number, ranging from 0 to the maximum card slot index number 169 * supported by the device. 170 * @param callback Returns the unique device ID; returns an empty string if the unique device ID does not exist. 171 * @permission ohos.permission.GET_TELEPHONY_STATE 172 * @systemapi Hide this for inner system use. 173 * @since 8 174 */ 175 function getUniqueDeviceId(callback: AsyncCallback<string>): void; 176 function getUniqueDeviceId(slotId: number, callback: AsyncCallback<string>): void; 177 function getUniqueDeviceId(slotId?: number): Promise<string>; 178 179 /** 180 * Obtains the index number of the card slot where the primary card is located if multiple SIM cards are inserted. 181 * 182 * <p>The primary card is the SIM card inserted in the card slot that uses data services by default. 183 * 184 * @param callback Returns the index number of the primary card slot. 185 * @since 7 186 */ 187 function getPrimarySlotId(callback: AsyncCallback<number>): void; 188 function getPrimarySlotId(): Promise<number>; 189 190 /** 191 * @permission ohos.permission.SET_TELEPHONY_STATE 192 * @systemapi Hide this for inner system use. 193 * @since 8 194 */ 195 function setPrimarySlotId(slotId: number, callback: AsyncCallback<void>): void; 196 function setPrimarySlotId(slotId: number): Promise<void>; 197 198 /** 199 * Obtains the list of signal strength information of the registered network corresponding to a specified SIM card. 200 * 201 * @param slotId Indicates the card slot index number, ranging from 0 to the maximum card slot index number 202 * supported by the device. 203 * @param callback Returns the instance list of the child classes derived from {@link SignalInformation}. 204 * @since 7 205 */ 206 function getSignalInformation(slotId: number, callback: AsyncCallback<Array<SignalInformation>>): void; 207 function getSignalInformation(slotId: number): Promise<Array<SignalInformation>>; 208 209 /** 210 * Checks whether the device supports 5G New Radio (NR). 211 * 212 * @return Returns {@code true} if the device supports 5G NR; returns {@code false} otherwise. 213 * @deprecated Advised to use isNrSupported(slotId: number) instead. 214 * @since 7 215 */ 216 function isNrSupported(): boolean; 217 218 /** 219 * Checks whether the device supports 5G New Radio (NR) by according card slot. 220 * 221 * @param slotId Indicates the card slot index number, ranging from 0 to the maximum card slot index number 222 * supported by the device. 223 * @return Returns {@code true} if the device supports 5G NR; returns {@code false} otherwise. 224 * @since 8 225 */ 226 function isNrSupported(slotId: number): boolean; 227 228 /** 229 * Checks whether the radio service is enabled. 230 * 231 * @param slotId Indicates the card slot index number, 232 * ranging from 0 to the maximum card slot index number supported by the device. 233 * @permission ohos.permission.GET_NETWORK_INFO 234 * @since 7 235 */ 236 function isRadioOn(callback: AsyncCallback<boolean>): void; 237 function isRadioOn(slotId: number, callback: AsyncCallback<boolean>): void 238 function isRadioOn(slotId?: number): Promise<boolean>; 239 240 /** 241 * Turn on the radio service. 242 * 243 * @param slotId Indicates the card slot index number, 244 * ranging from 0 to the maximum card slot index number supported by the device. 245 * @permission ohos.permission.SET_TELEPHONY_STATE 246 * @systemapi Hide this for inner system use. 247 * @since 7 248 */ 249 function turnOnRadio(callback: AsyncCallback<void>): void; 250 function turnOnRadio(slotId: number, callback: AsyncCallback<void>): void; 251 function turnOnRadio(slotId?: number): Promise<void>; 252 253 /** 254 * Turn off the radio service. 255 * 256 * @param slotId Indicates the card slot index number, 257 * ranging from 0 to the maximum card slot index number supported by the device. 258 * @permission ohos.permission.SET_TELEPHONY_STATE 259 * @systemapi Hide this for inner system use. 260 * @since 7 261 */ 262 function turnOffRadio(callback: AsyncCallback<void>): void; 263 function turnOffRadio(slotId: number, callback: AsyncCallback<void>): void; 264 function turnOffRadio(slotId?: number): Promise<void>; 265 266 /** 267 * @since 7 268 */ 269 function getOperatorName(slotId: number, callback: AsyncCallback<string>): void; 270 function getOperatorName(slotId: number): Promise<string>; 271 272 /** 273 * @permission ohos.permission.SET_TELEPHONY_STATE 274 * @systemapi Hide this for inner system use. 275 * @since 8 276 */ 277 function setPreferredNetwork(slotId: number, networkMode: PreferredNetworkMode, callback: AsyncCallback<void>): void; 278 function setPreferredNetwork(slotId: number, networkMode: PreferredNetworkMode): Promise<void>; 279 280 /** 281 * @permission ohos.permission.GET_TELEPHONY_STATE 282 * @systemapi Hide this for inner system use. 283 * @since 8 284 */ 285 function getPreferredNetwork(slotId: number, callback: AsyncCallback<PreferredNetworkMode>): void; 286 function getPreferredNetwork(slotId: number): Promise<PreferredNetworkMode>; 287 288 /** 289 * @systemapi Hide this for inner system use. 290 * @since 8 291 */ 292 export enum PreferredNetworkMode { 293 PREFERRED_NETWORK_MODE_GSM = 1, 294 PREFERRED_NETWORK_MODE_WCDMA = 2, 295 PREFERRED_NETWORK_MODE_LTE = 3, 296 PREFERRED_NETWORK_MODE_LTE_WCDMA = 4, 297 PREFERRED_NETWORK_MODE_LTE_WCDMA_GSM = 5, 298 PREFERRED_NETWORK_MODE_WCDMA_GSM = 6, 299 PREFERRED_NETWORK_MODE_CDMA = 7, 300 PREFERRED_NETWORK_MODE_EVDO = 8, 301 PREFERRED_NETWORK_MODE_EVDO_CDMA = 9, 302 PREFERRED_NETWORK_MODE_WCDMA_GSM_EVDO_CDMA = 10, 303 PREFERRED_NETWORK_MODE_LTE_EVDO_CDMA = 11, 304 PREFERRED_NETWORK_MODE_LTE_WCDMA_GSM_EVDO_CDMA = 12, 305 PREFERRED_NETWORK_MODE_TDSCDMA = 13, 306 PREFERRED_NETWORK_MODE_TDSCDMA_GSM = 14, 307 PREFERRED_NETWORK_MODE_TDSCDMA_WCDMA = 15, 308 PREFERRED_NETWORK_MODE_TDSCDMA_WCDMA_GSM = 16, 309 PREFERRED_NETWORK_MODE_LTE_TDSCDMA = 17, 310 PREFERRED_NETWORK_MODE_LTE_TDSCDMA_GSM = 18, 311 PREFERRED_NETWORK_MODE_LTE_TDSCDMA_WCDMA = 19, 312 PREFERRED_NETWORK_MODE_LTE_TDSCDMA_WCDMA_GSM = 20, 313 PREFERRED_NETWORK_MODE_TDSCDMA_WCDMA_GSM_EVDO_CDMA = 21, 314 PREFERRED_NETWORK_MODE_LTE_TDSCDMA_WCDMA_GSM_EVDO_CDMA = 22, 315 PREFERRED_NETWORK_MODE_NR = 31, 316 PREFERRED_NETWORK_MODE_NR_LTE = 32, 317 PREFERRED_NETWORK_MODE_NR_LTE_WCDMA = 33, 318 PREFERRED_NETWORK_MODE_NR_LTE_WCDMA_GSM = 34, 319 PREFERRED_NETWORK_MODE_NR_LTE_EVDO_CDMA = 35, 320 PREFERRED_NETWORK_MODE_NR_LTE_WCDMA_GSM_EVDO_CDMA = 36, 321 PREFERRED_NETWORK_MODE_NR_LTE_TDSCDMA = 37, 322 PREFERRED_NETWORK_MODE_NR_LTE_TDSCDMA_GSM = 38, 323 PREFERRED_NETWORK_MODE_NR_LTE_TDSCDMA_WCDMA = 39, 324 PREFERRED_NETWORK_MODE_NR_LTE_TDSCDMA_WCDMA_GSM = 40, 325 PREFERRED_NETWORK_MODE_NR_LTE_TDSCDMA_WCDMA_GSM_EVDO_CDMA = 41, 326 PREFERRED_NETWORK_MODE_MAX_VALUE = 99, 327 } 328 329 /** 330 * Describes the radio access technology. 331 */ 332 export enum RadioTechnology { 333 /** 334 * Indicates unknown radio access technology (RAT). 335 */ 336 RADIO_TECHNOLOGY_UNKNOWN = 0, 337 338 /** 339 * Indicates that RAT is global system for mobile communications (GSM), including GSM, general packet 340 * radio system (GPRS), and enhanced data rates for GSM evolution (EDGE). 341 */ 342 RADIO_TECHNOLOGY_GSM = 1, 343 344 /** 345 * Indicates that RAT is code division multiple access (CDMA), including Interim Standard 95 (IS95) and 346 * Single-Carrier Radio Transmission Technology (1xRTT). 347 */ 348 RADIO_TECHNOLOGY_1XRTT = 2, 349 350 /** 351 * Indicates that RAT is wideband code division multiple address (WCDMA). 352 */ 353 RADIO_TECHNOLOGY_WCDMA = 3, 354 355 /** 356 * Indicates that RAT is high-speed packet access (HSPA), including HSPA, high-speed downlink packet 357 * access (HSDPA), and high-speed uplink packet access (HSUPA). 358 */ 359 RADIO_TECHNOLOGY_HSPA = 4, 360 361 /** 362 * Indicates that RAT is evolved high-speed packet access (HSPA+), including HSPA+ and dual-carrier 363 * HSPA+ (DC-HSPA+). 364 */ 365 RADIO_TECHNOLOGY_HSPAP = 5, 366 367 /** 368 * Indicates that RAT is time division-synchronous code division multiple access (TD-SCDMA). 369 */ 370 RADIO_TECHNOLOGY_TD_SCDMA = 6, 371 372 /** 373 * Indicates that RAT is evolution data only (EVDO), including EVDO Rev.0, EVDO Rev.A, and EVDO Rev.B. 374 */ 375 RADIO_TECHNOLOGY_EVDO = 7, 376 377 /** 378 * Indicates that RAT is evolved high rate packet data (EHRPD). 379 */ 380 RADIO_TECHNOLOGY_EHRPD = 8, 381 382 /** 383 * Indicates that RAT is long term evolution (LTE). 384 */ 385 RADIO_TECHNOLOGY_LTE = 9, 386 387 /** 388 * Indicates that RAT is LTE carrier aggregation (LTE-CA). 389 */ 390 RADIO_TECHNOLOGY_LTE_CA = 10, 391 392 /** 393 * Indicates that RAT is interworking WLAN (I-WLAN). 394 */ 395 RADIO_TECHNOLOGY_IWLAN = 11, 396 397 /** 398 * Indicates that RAT is 5G new radio (NR). 399 */ 400 RADIO_TECHNOLOGY_NR = 12 401 } 402 403 export interface SignalInformation { 404 /** 405 * Obtains the network type corresponding to the signal. 406 */ 407 signalType: NetworkType; 408 409 /** 410 * Obtains the signal level of the current network. 411 */ 412 signalLevel: number; 413 } 414 415 /** 416 * Describes the network type. 417 */ 418 export enum NetworkType { 419 /** 420 * Indicates unknown network type. 421 */ 422 NETWORK_TYPE_UNKNOWN, 423 424 /** 425 * Indicates that the network type is GSM. 426 */ 427 NETWORK_TYPE_GSM, 428 429 /** 430 * Indicates that the network type is CDMA. 431 */ 432 NETWORK_TYPE_CDMA, 433 434 /** 435 * Indicates that the network type is WCDMA. 436 */ 437 NETWORK_TYPE_WCDMA, 438 439 /** 440 * Indicates that the network type is TD-SCDMA. 441 */ 442 NETWORK_TYPE_TDSCDMA, 443 444 /** 445 * Indicates that the network type is LTE. 446 */ 447 NETWORK_TYPE_LTE, 448 449 /** 450 * Indicates that the network type is 5G NR. 451 */ 452 NETWORK_TYPE_NR 453 } 454 455 /** 456 * Describes the network registration state. 457 */ 458 export interface NetworkState { 459 /** 460 * Obtains the operator name in the long alphanumeric format of the registered network. 461 * 462 * @return Returns the operator name in the long alphanumeric format as a string; 463 * returns an empty string if no operator name is obtained. 464 */ 465 longOperatorName: string; 466 467 /** 468 * Obtains the operator name in the short alphanumeric format of the registered network. 469 * 470 * @return Returns the operator name in the short alphanumeric format as a string; 471 * returns an empty string if no operator name is obtained. 472 */ 473 shortOperatorName: string; 474 475 /** 476 * Obtains the PLMN code of the registered network. 477 * 478 * @return Returns the PLMN code as a string; returns an empty string if no operator name is obtained. 479 */ 480 plmnNumeric: string; 481 482 /** 483 * Checks whether the device is roaming. 484 * 485 * @return Returns {@code true} if the device is roaming; returns {@code false} otherwise. 486 */ 487 isRoaming: boolean; 488 489 /** 490 * Obtains the network registration status of the device. 491 * 492 * @return Returns the network registration status {@code RegState}. 493 */ 494 regState: RegState; 495 496 /** 497 * Obtains the radio Access technology after config conversion. 498 * 499 * @return Returns the radio Access technology {@code RadioTechnology}. 500 * @since 8 501 */ 502 cfgTech: RadioTechnology; 503 504 /** 505 * Obtains the NSA network registration status of the device. 506 * 507 * @return Returns the NSA network registration status {@code NsaState}. 508 */ 509 nsaState: NsaState; 510 511 /** 512 * Obtains the status of CA. 513 * 514 * @return Returns {@code true} if CA is actived; returns {@code false} otherwise. 515 */ 516 isCaActive: boolean; 517 518 /** 519 * Checks whether this device is allowed to make emergency calls only. 520 * 521 * @return Returns {@code true} if this device is allowed to make emergency calls only; 522 * returns {@code false} otherwise. 523 */ 524 isEmergency: boolean; 525 } 526 527 /** 528 * Describes the network registration state. 529 */ 530 export enum RegState { 531 /** 532 * Indicates a state in which a device cannot use any service. 533 */ 534 REG_STATE_NO_SERVICE = 0, 535 536 /** 537 * Indicates a state in which a device can use services properly. 538 */ 539 REG_STATE_IN_SERVICE = 1, 540 541 /** 542 * Indicates a state in which a device can use only the emergency call service. 543 */ 544 REG_STATE_EMERGENCY_CALL_ONLY = 2, 545 546 /** 547 * Indicates that the cellular radio is powered off. 548 */ 549 REG_STATE_POWER_OFF = 3 550 } 551 552 /** 553 * Describes the nsa state. 554 */ 555 export enum NsaState { 556 /** 557 * Indicates that a device is idle under or is connected to an LTE cell that does not support NSA. 558 */ 559 NSA_STATE_NOT_SUPPORT = 1, 560 561 /** 562 * Indicates that a device is idle under an LTE cell supporting NSA but not NR coverage detection. 563 */ 564 NSA_STATE_NO_DETECT = 2, 565 566 /** 567 * Indicates that a device is connected to an LTE network under an LTE cell 568 * that supports NSA and NR coverage detection. 569 */ 570 NSA_STATE_CONNECTED_DETECT = 3, 571 572 /** 573 * Indicates that a device is idle under an LTE cell supporting NSA and NR coverage detection. 574 */ 575 NSA_STATE_IDLE_DETECT = 4, 576 577 /** 578 * Indicates that a device is connected to an LTE + NR network under an LTE cell that supports NSA. 579 */ 580 NSA_STATE_DUAL_CONNECTED = 5, 581 582 /** 583 * Indicates that a device is idle under or is connected to an NG-RAN cell while being attached to 5GC. 584 */ 585 NSA_STATE_SA_ATTACHED = 6 586 } 587 588 /** 589 * @systemapi Hide this for inner system use. 590 * @since 8 591 */ 592 export interface CellInformation { 593 /** 594 * Obtains the network type of the serving cell. 595 * 596 * <p>An application can call this method to determine the network type that the child class uses. 597 * 598 * @return Returns the the network type of the serving cell. 599 */ 600 networkType: NetworkType; 601 602 /** 603 * Obtains the camp-on status of the serving cell. 604 * 605 * @return Returns {@code true} if the user equipment (UE) is camped on the cell; returns 606 * {@code false} otherwise. 607 */ 608 isCamped: boolean; 609 610 /** 611 * Obtains the timestamp when the cell information is obtained. 612 * 613 * @return Returns a timestamp since boot, in nanoseconds. 614 */ 615 timeStamp: number; 616 617 /** 618 * An abstract method of the parent class whose implementation depends on the child classes. 619 * Returned child class objects vary according to the network type. 620 * 621 * @return Returns child class objects specific to the network type. 622 */ 623 signalInformation: SignalInformation; 624 625 data: CdmaCellInformation | GsmCellInformation | LteCellInformation | NrCellInformation | TdscdmaCellInformation 626 | WcdmaCellInformation; 627 } 628 629 /** 630 * @systemapi Hide this for inner system use. 631 * @since 8 632 */ 633 export interface CdmaCellInformation { 634 baseId: number; 635 latitude: number; 636 longitude: number; 637 nid: number; 638 sid: number; 639 } 640 641 /** 642 * @systemapi Hide this for inner system use. 643 * @since 8 644 */ 645 export interface GsmCellInformation { 646 lac: number; 647 cellId: number; 648 arfcn: number; 649 bsic: number; 650 mcc: string; 651 mnc: string; 652 } 653 654 /** 655 * @systemapi Hide this for inner system use. 656 * @since 8 657 */ 658 export interface LteCellInformation { 659 cgi: number; 660 pci: number; 661 tac: number; 662 earfcn: number; 663 bandwidth: number; 664 mcc: string; 665 mnc: string; 666 isSupportEndc: boolean; 667 } 668 669 /** 670 * @systemapi Hide this for inner system use. 671 * @since 8 672 */ 673 export interface NrCellInformation { 674 nrArfcn: number; 675 pci: number; 676 tac: number; 677 nci: number; 678 mcc: string; 679 mnc: string; 680 } 681 682 /** 683 * @systemapi Hide this for inner system use. 684 * @since 8 685 */ 686 export interface TdscdmaCellInformation { 687 lac: number; 688 cellId: number; 689 cpid: number; 690 uarfcn: number; 691 mcc: string; 692 mnc: string; 693 } 694 695 /** 696 * @systemapi Hide this for inner system use. 697 * @since 8 698 */ 699 export interface WcdmaCellInformation { 700 lac: number; 701 cellId: number; 702 psc: number; 703 uarfcn: number; 704 mcc: string; 705 mnc: string; 706 } 707 708 /** 709 * @systemapi Hide this for inner system use. 710 * @since 8 711 */ 712 export enum NrOptionMode { 713 /** Indicates unknown NR networking mode. */ 714 NR_OPTION_UNKNOWN, 715 716 /** Indicates that the NR networking mode is NSA only. */ 717 NR_OPTION_NSA_ONLY, 718 719 /** Indicates that the NR networking mode is SA only. */ 720 NR_OPTION_SA_ONLY, 721 722 /** Indicates that the NR networking mode is NSA and SA. */ 723 NR_OPTION_NSA_AND_SA, 724 } 725 726 /** 727 * @systemapi Hide this for inner system use. 728 */ 729 export interface NetworkSearchResult { 730 isNetworkSearchSuccess: boolean; 731 networkSearchResult: Array<NetworkInformation>; 732 } 733 734 /** 735 * @systemapi Hide this for inner system use. 736 */ 737 export interface NetworkInformation { 738 operatorName: string; 739 operatorNumeric: string; 740 state: NetworkInformationState; 741 radioTech: string; 742 } 743 744 /** 745 * @systemapi Hide this for inner system use. 746 */ 747 export enum NetworkInformationState { 748 /** Indicates that the network state is unknown. */ 749 NETWORK_UNKNOWN, 750 751 /** Indicates that the network is available for registration. */ 752 NETWORK_AVAILABLE, 753 754 /** Indicates that you have already registered with the network. */ 755 NETWORK_CURRENT, 756 757 /** Indicates that the network is unavailable for registration. */ 758 NETWORK_FORBIDDEN 759 } 760 761 /** 762 * @systemapi Hide this for inner system use. 763 */ 764 export interface NetworkSelectionModeOptions { 765 slotId: number; 766 selectMode: NetworkSelectionMode; 767 networkInformation: NetworkInformation; 768 resumeSelection: boolean; 769 } 770 771 export enum NetworkSelectionMode { 772 /** Unknown network selection modes. */ 773 NETWORK_SELECTION_UNKNOWN, 774 775 /** Automatic network selection modes. */ 776 NETWORK_SELECTION_AUTOMATIC, 777 778 /** Manual network selection modes. */ 779 NETWORK_SELECTION_MANUAL 780 } 781} 782 783export default radio;