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 16 #ifndef OHOS_RIL_NETWORK_PARCEL_H 17 #define OHOS_RIL_NETWORK_PARCEL_H 18 19 #include "hril_base_parcel.h" 20 21 namespace OHOS { 22 namespace Telephony { 23 /** 24 * @brief Defines the carrier information. 25 */ 26 struct OperatorInfoResult { 27 /** Long carrier name of the registered network. */ 28 std::string longName = ""; 29 30 /** Short carrier name of the registered network. */ 31 std::string shortName = ""; 32 33 /** MCC+MNC of the registered network. */ 34 std::string numeric = ""; 35 }; 36 37 /** 38 * @brief Defines the available network information. 39 */ 40 struct AvailableNetworkInfo { 41 /** Long name of the registered network in alphanumeric format. */ 42 std::string longName = ""; 43 44 /** Short name of the registered network in alphanumeric format. */ 45 std::string shortName = ""; 46 47 /** Available network ID(MCC+MNC). */ 48 std::string numeric = ""; 49 50 /** Network status. For details, see {@link RilRegStatus}. */ 51 int32_t status = 0; 52 53 /** Radio access technology type. For details, see {@link RilRadioTech}. */ 54 int32_t rat = 0; 55 }; 56 57 /** 58 * @brief Defines the available network list. 59 */ 60 struct AvailableNetworkList { 61 /** The size of available network list. */ 62 int32_t itemNum = 0; 63 64 /** Available network list. */ 65 std::vector<AvailableNetworkInfo> availableNetworkInfo {}; 66 67 /** Network list flag */ 68 int64_t flag = 0; 69 }; 70 71 /** 72 * @brief Defines the network mode information. 73 */ 74 struct SetNetworkModeInfo { 75 /** Network mode. For details, see {@link PreferredNetworkTypeInfo}. */ 76 int32_t selectMode = 0; 77 78 /** Operator information */ 79 std::string oper = ""; 80 81 /** flag, Used by search network manager in response. */ 82 int64_t flag = 0; 83 }; 84 85 /** 86 * @brief Voice registration status results 87 */ 88 struct CsRegStatusInfo { 89 /** The notifyType,Indicate the content of the notification. */ 90 int32_t notifyType = 0; 91 92 /** 93 * The corresponding valid registration states are 94 * NOT_REG_MT_NOT_SEARCHING_OP, "REG_MT_HOME, NOT_REG_MT_SEARCHING_OP, 95 * REG_DENIED, UNKNOWN, REG_ROAMING". 96 */ 97 HRilRegStatus regStatus = 98 HRilRegStatus::NO_REG_MT_NO_SEARCH; 99 100 /** Location area code. */ 101 int32_t lacCode = 0; 102 103 /** Cell ID. */ 104 int32_t cellId = 0; 105 106 /** Available voice radio technology, RMS defined by radio technology. */ 107 HRilRadioTech radioTechnology = 108 HRilRadioTech::RADIO_TECHNOLOGY_UNKNOWN; 109 110 /** flag, Used by search network manager in response. */ 111 int64_t flag = 0; 112 }; 113 114 /** 115 * @brief Defines the registration status information of the PS domain. 116 */ 117 struct PsRegStatusResultInfo { 118 /** The notifyType,Indicate the content of the notification. */ 119 int32_t notifyType = 0; 120 121 /** 122 * Valid when are is ITE UNKNOWN REG = REG, otherwise it defined in 123 * RegStatus. 124 */ 125 HRilRegStatus regStatus = HRilRegStatus::NO_REG_MT_NO_SEARCH; 126 127 /** Location area code. */ 128 int32_t lacCode = 0; 129 130 /** Cell ID. */ 131 int32_t cellId = 0; 132 133 /** Radio access technology type. For details, see {@link RilRadioTech}. */ 134 HRilRadioTech radioTechnology = HRilRadioTech::RADIO_TECHNOLOGY_UNKNOWN; 135 136 /** Whether the NR mode is available.*/ 137 bool isNrAvailable = false; 138 139 /** Whether ENDC is available. */ 140 bool isEnDcAvailable = false; 141 142 /** Whether DCNR is restricted. */ 143 bool isDcNrRestricted = false; 144 145 /** flag, Used by search network manager in response. */ 146 int64_t flag = 0; 147 }; 148 149 /** 150 * @brief Defines the physical channel configuration. 151 */ 152 struct PhysicalChannelConfig { 153 /** Connection status. */ 154 HRilCellConnectionStatus cellConnStatus = HRilCellConnectionStatus::HRIL_SERVING_CELL_UNKNOWN; 155 156 /** Radio access technology type. For details, see {@link RilRadioTech}. */ 157 HRilRadioTech ratType = HRilRadioTech::RADIO_TECHNOLOGY_UNKNOWN; 158 159 /** Downlink bandwidth in kHz. */ 160 int32_t cellBandwidthDownlinkKhz = 0; 161 162 /** Uplink bandwidth in kHz. */ 163 int32_t cellBandwidthUplinkKhz = 0; 164 165 /** Frequency range. */ 166 int32_t freqRange = 0; 167 168 /** Downlink channel ID. */ 169 int32_t downlinkChannelNum = 0; 170 171 /** Uplink channel ID. */ 172 int32_t uplinkChannelNum = 0; 173 174 /** Physical cell ID. */ 175 int32_t physicalCellId = 0; 176 177 /** Logical device ID. */ 178 int32_t contextIdNum = 0; 179 180 /** 181 * A list of data calls mapped to this physical channel. An empty list 182 * means the physical channel has no data call mapped to it. 183 */ 184 std::vector<int32_t> contextIds {}; 185 }; 186 187 /** 188 * @brief Defines the channel configuration information list. 189 */ 190 struct ChannelConfigInfoList { 191 /** The size of ChannelConfigInfoList. */ 192 int32_t itemNum = 0; 193 194 /** Physical channel configuration list. */ 195 std::vector<PhysicalChannelConfig> channelConfigInfos {}; 196 197 /** flag, Used by search network manager in response */ 198 int64_t flag = 0; 199 }; 200 201 /** 202 * @brief Defines the GSM cellular information. 203 */ 204 typedef struct { 205 /** value:0~3 0:GSM850 1:GSM900 0:GSM1800 0:GSM1900 */ 206 int32_t band; 207 208 /** Absolute Radio Frequency Channel Number of the BCCH carrier 0~1023 */ 209 int32_t arfcn; 210 211 /** cell sit code 0~63 */ 212 int32_t bsic; 213 214 /** Cell ID. */ 215 int32_t cellId; 216 217 /** Location area code, which ranges from 0 to 0xFFFF. */ 218 int32_t lac; 219 220 /** Signal received strength, which ranges from -120 to 37. */ 221 int32_t rxlev; 222 223 /** Signal received quality, which ranges from 0 to 7. */ 224 int32_t rxQuality; 225 226 /** Timing advance, which ranges from 0 to 63. */ 227 int32_t ta; 228 } CellRatGsm; 229 230 /** 231 * @brief Defines the LTE cellular information. 232 */ 233 typedef struct { 234 /** Absolute Radio Frequency Channel Number of the BCCH carrier 0~1023 */ 235 int32_t arfcn; 236 237 /** Cell ID. */ 238 int32_t cellId; 239 240 /** Physical cell ID. */ 241 int32_t pci; 242 243 /** Tracking Area Code 0~FFFF */ 244 int32_t tac; 245 246 /** Reference Signal Received Power -140~-44, dBm */ 247 int32_t rsrp; 248 249 /** Reference Signal Received Quality -19.5~-3 */ 250 int32_t rsrq; 251 252 /** Receiving signal strength in dbm 90~-25 */ 253 int32_t rssi; 254 } CellRatLte; 255 256 /** 257 * @brief Defines the WCDMA cellular information. 258 */ 259 typedef struct { 260 /** Absolute Radio Frequency Channel Number of the BCCH carrier 0~1023 */ 261 int32_t arfcn; 262 263 /** Primary Scrambling Code. 0~511 */ 264 int32_t psc; 265 266 /** Cell ID. */ 267 int32_t cellId; 268 269 /** Tracking Area Code 0~FFFF. */ 270 int32_t lac; 271 272 /** Reference Signal Received Power -140~-44, dBm */ 273 int32_t rscp; 274 275 /** Reference Signal Received Quality -19.5~-3 */ 276 int32_t rxlev; 277 278 /** Receiving signal strength in dbm 90~-25 */ 279 int32_t ecno; 280 281 /** Discontinuous reception cycle length. 6~9 */ 282 int32_t drx; 283 284 /** UTRAN Registration Area Identity. 0~65535 */ 285 int32_t ura; 286 } CellRatWcdma; 287 288 /** 289 * @brief Defines the CDMA cellular information. 290 */ 291 typedef struct { 292 /** integer type and range is 0-65535 */ 293 int32_t systemId; 294 295 /** integer type and range is 0-65535 */ 296 int32_t networkId; 297 298 /** integer type and range is 0-65535 */ 299 int32_t baseId; 300 301 /** integer type and range is 0-65535 */ 302 int32_t zoneId; 303 304 /** integer type and range is 0-65535 */ 305 int32_t pilotPn; 306 307 /** integer type and range is 0-65535 */ 308 int32_t pilotStrength; 309 310 /** integer type and range is 0-65535 */ 311 int32_t channel; 312 313 /** integer type and range is -648000 -- 648000, unit: second */ 314 int32_t longitude; 315 316 /** integer type and range is -648000 -- 648000, unit: second */ 317 int32_t latitude; 318 } CellRatCdma; 319 320 /** 321 * @brief Defines the TD-SCDMA cellular information. 322 */ 323 typedef struct { 324 /** Absolute RF channel number of the BCCH carrier. */ 325 int32_t arfcn; 326 327 /** Synchronization flag. */ 328 int32_t syncId; 329 330 /** Super cell. */ 331 int32_t sc; 332 333 /** Cell ID. */ 334 int32_t cellId; 335 336 /** Location area code. */ 337 int32_t lac; 338 339 /** Received signal code power. */ 340 int32_t rscp; 341 342 /** Discontinuous reception cycle. */ 343 int32_t drx; 344 345 /** Routing area code. */ 346 int32_t rac; 347 348 /** Super cell ID. */ 349 int32_t cpid; 350 } CellRatTdscdma; 351 352 /** 353 * @brief Defines the NR cellular information. 354 */ 355 typedef struct { 356 /** Absolute RF channel number of the BCCH carrier. */ 357 int32_t nrArfcn; 358 359 /** Physical cell ID. */ 360 int32_t pci; 361 362 /** Tracking Area Code, which ranges from 0 to FFFF. */ 363 int32_t tac; 364 365 /** NR cell ID. */ 366 int64_t nci; 367 } CellRatNr; 368 369 /** 370 * @brief Defines the current cell information. 371 */ 372 struct CurrentCellInfo { 373 /** Radio access technology type. */ 374 int32_t ratType = 0; 375 376 /** Mobile country code (MCC). */ 377 int32_t mcc = 0; 378 379 /** Mobile network code (MNC). */ 380 int32_t mnc = 0; 381 382 /** Cell information parameters. */ 383 union { 384 CellRatGsm gsm; 385 CellRatLte lte; 386 CellRatWcdma wcdma; 387 CellRatCdma cdma; 388 CellRatTdscdma tdscdma; 389 CellRatNr nr; 390 } ServiceCellParas; 391 }; 392 393 /** 394 * @brief Defines the current cell information list. 395 */ 396 struct CellListCurrentInfo { 397 /** The size of current cell information list. */ 398 int32_t itemNum = 0; 399 400 /** Current cell information. */ 401 std::vector<CurrentCellInfo> cellCurrentInfo {}; 402 }; 403 404 /** 405 * @brief Defines the NR cellular information. 406 */ 407 typedef struct { 408 /** Absolute RF channel number of the BCCH carrier. */ 409 int32_t nrArfcn; 410 411 /** Physical cell ID. */ 412 int32_t pci; 413 414 /** Tracking Area Code, which ranges from 0 to FFFF. */ 415 int32_t tac; 416 417 /** NR cell ID. */ 418 int64_t nci; 419 420 /** Reference Signal Received Power. */ 421 int32_t rsrp; 422 423 /** Reference Signal Received Quality. */ 424 int32_t rsrq; 425 } CellRatNrExt; 426 427 /** 428 * @brief Defines the current cell information. 429 */ 430 struct CurrentCellInformation { 431 /** Radio access technology type. */ 432 int32_t ratType = 0; 433 434 /** Mobile country code (MCC). */ 435 int32_t mcc = 0; 436 437 /** Mobile network code (MNC). */ 438 int32_t mnc = 0; 439 440 /** Cell information parameters. */ 441 union { 442 CellRatGsm gsm; 443 CellRatLte lte; 444 CellRatWcdma wcdma; 445 CellRatCdma cdma; 446 CellRatTdscdma tdscdma; 447 CellRatNrExt nr; 448 } ServiceCellParas; 449 }; 450 451 /** 452 * @brief Defines the current cell information list. 453 */ 454 struct CellListCurrentInformation { 455 /** The size of current cell information list. */ 456 int32_t itemNum = 0; 457 458 /** Current cell information. */ 459 std::vector<CurrentCellInformation> cellCurrentInfo {}; 460 }; 461 462 /** 463 * @brief Defines the GSM cell information. 464 */ 465 typedef struct { 466 /** value:0~3 0:GSM850 1:GSM900 0:GSM1800 0:GSM1900 */ 467 int32_t band; 468 469 /** Absolute Radio Frequency Channel Number of the BCCHcarrier 0~1023 */ 470 int32_t arfcn; 471 472 /** cell sit code 0~63 */ 473 int32_t bsic; 474 475 /** Cell information ID */ 476 int32_t cellId; 477 478 /** Location area code 0~FFFF */ 479 int32_t lac; 480 481 /** <RXLEV> dbm -120~37 */ 482 int32_t rxlev; 483 } CellListRatGsm; 484 485 /** 486 * @brief Defines the LTE cell information. 487 */ 488 typedef struct { 489 /** Absolute Radio FreListquency Channel Number of the BCCHcarrier 0~1023 490 */ 491 int32_t arfcn; 492 493 /** Physical cell ID. */ 494 int32_t pci; 495 496 /** Reference Signal Received Power -140~-44, dBm */ 497 int32_t rsrp; 498 499 /** Reference Signal Received Quality -19.5~-3 */ 500 int32_t rsrq; 501 502 /** <RXLEV> dbm -120~37 */ 503 int32_t rxlev; 504 } CellListRatLte; 505 506 /** 507 * @brief Defines the WCDMA cell information. 508 */ 509 typedef struct { 510 /** Absolute Radio Frequency Channel Number of the BCCHcarrier 0~16383 */ 511 int32_t arfcn; 512 513 /** Primary Scrambling Code. 0~511 */ 514 int32_t psc; 515 516 /** Received Signal Code Power in dBm -120~25, dBm */ 517 int32_t rscp; 518 519 /** The ratio of power per modulation bit to noise spectral density. -25~0 520 */ 521 int32_t ecno; 522 } CellListRatWcdma; 523 524 /** 525 * @brief Defines the CDMA cell information. 526 */ 527 typedef struct { 528 /** integer type and range is 0-65535 */ 529 int32_t systemId; 530 531 /** integer type and range is 0-65535 */ 532 int32_t networkId; 533 534 /** integer type and range is 0-65535 */ 535 int32_t baseId; 536 537 /** integer type and range is 0-65535 */ 538 int32_t zoneId; 539 540 /** integer type and range is 0-65535 */ 541 int32_t pilotPn; 542 543 /** integer type and range is 0-65535 */ 544 int32_t pilotStrength; 545 546 /** integer type and range is 0-65535 */ 547 int32_t channel; 548 549 /** integer type and range is -648000 -- 648000, unit: second */ 550 int32_t longitude; 551 552 /** integer type and range is -648000 -- 648000, unit: second */ 553 int32_t latitude; 554 } CellListRatCdma; 555 556 /** 557 * @brief Defines the TD-SCDMA cell information. 558 */ 559 typedef struct { 560 /** Absolute RF channel number of the BCCH carrier. */ 561 int32_t arfcn; 562 563 /** Synchronization flag. */ 564 int32_t syncId; 565 566 /** Super cell. */ 567 int32_t sc; 568 569 /** Cell ID. */ 570 int32_t cellId; 571 572 /** Location area code, which ranges from 0 to 0xFFFF. */ 573 int32_t lac; 574 575 /** Received signal code power. */ 576 int32_t rscp; 577 578 /** Discontinuous reception cycle. */ 579 int32_t drx; 580 581 /** Routing area code. */ 582 int32_t rac; 583 584 /** 8-bit Cell Parameters ID described in TS 25.331, 0..127, INT_MAX if 585 * unknown */ 586 int32_t cpid; 587 } CellListRatTdscdma; 588 589 /** 590 * @brief Defines the NR cell information. 591 */ 592 typedef struct { 593 /** Absolute RF channel number of the BCCH carrier. */ 594 int32_t nrArfcn; 595 596 /** Physical cell ID. */ 597 int32_t pci; 598 599 /** Tracking Area Code, which ranges from 0 to FFFF. */ 600 int32_t tac; 601 602 /** NR cell ID. */ 603 int64_t nci; 604 } CellListRatNr; 605 606 /** 607 * @brief Defines the neighboring cell information. 608 */ 609 struct CellNearbyInfo { 610 /** 611 * Access technology type: 612 * 0: unknown 613 * 1: GSM 614 * 2: CDMA 615 * 3: WCDMA 616 * 4: TD-SCDMA 617 * 5: LTE 618 * 6: NR 619 */ 620 int32_t ratType = 0; 621 622 /** Cell information for different network modes. */ 623 union { 624 CellListRatGsm gsm; 625 CellListRatLte lte; 626 CellListRatWcdma wcdma; 627 CellListRatCdma cdma; 628 CellListRatTdscdma tdscdma; 629 CellListRatNr nr; 630 } ServiceCellParas; 631 }; 632 633 /** 634 * @brief Defines the neighboring cell list. 635 */ 636 struct CellListNearbyInfo { 637 /** The size of nearby info of cell list. */ 638 int32_t itemNum = 0; 639 640 /** Neighboring cell list. */ 641 std::vector<CellNearbyInfo> cellNearbyInfo {}; 642 }; 643 644 /** 645 * @brief Defines the preferred network type. 646 */ 647 struct PreferredNetworkTypeInfo { 648 /** 649 * Network type 650 * 0: automatic 651 * 1: GSM 652 * 2: WCDMA. 653 * 3: LTE. 654 * 4: LTE and WCDMA 655 * 5: LTE, WCDMA, and GSM 656 * 6: WCDMA and GSM 657 * 7: CDMA 658 * 8: EV-DO 659 * 9: EV-DO and CDMA 660 * 10: WCDMA, GSM, EV-DO, and CDMA 661 * 11: LTE, EV-DO, and CDMA 662 * 12: LTE, WCDMA, GSM, EV-DO, and CDMA 663 * 13: TD-SCDMA 664 * 14: TD-SCDMA and GSM 665 * 15: TD-SCDMA and WCDMA 666 * 16: TD-SCDMA, WCDMA, and GSM 667 * 17: LTE and TD-SCDMA 668 * 18: LTE, TDSCDMA, and GSM 669 * 19: LTE, TD-SCDMA, and WCDMA 670 * 20: LTE, TDSCDMA, WCDMA, and GSM 671 * 21: TD-SCDMA, WCDMA, GSM, EV-DO, and CDMA 672 * 22: LTE, TD-SCDMA, WCDMA, GSM, EV-DO, and CDMA 673 * 31: NR 674 * 32: NR and LTE 675 * 33: NR, LTE, and WCDMA 676 * 34: NR, LTE, WCDMA, and GSM 677 * 35: NR, LTE, EV-DO, and CDMA 678 * 36: NR, LTE, WCDMA, GSM, EV-DO, and CDMA 679 * 37: NR, LTE, and TD-SCDMA. 680 * 38: NR, LTE, TDSCDMA, and GSM 681 * 39: NR, LTE, TD-SCDMA, and WCDMA 682 * 40: NR, LTE, TD-SCDMA, WCDMA, and GSM 683 * 41: NR, LTE, TD-SCDMA, WCDMA, GSM, EV-DO, and CDMA 684 */ 685 int32_t preferredNetworkType = 0; 686 687 /** Network ID */ 688 int64_t flag = 0; 689 }; 690 691 struct NrModeInfo { 692 int32_t nrMode = 0; 693 int64_t flag = 0; 694 }; 695 696 struct SsbIdInfo { 697 /** SSB index. */ 698 int32_t ssbId; 699 700 /** Reference Signal Received Power -140~-44, dBm */ 701 int32_t rsrp; 702 }; 703 704 struct NeighboringCellSsbInfo { 705 /** Physical cell ID. */ 706 int32_t pci; 707 708 /** Absolute Radio Frequency Channel Number of the BCCH carrier 0~1023 */ 709 int32_t arfcn; 710 711 /** Reference Signal Received Power -140~-44, dBm */ 712 int32_t rsrp; 713 714 /** Signal To Interference Plus Noise Ratio. */ 715 int32_t sinr; 716 717 /** Neighboring cell ssbId list, always size is 4 */ 718 std::vector<SsbIdInfo> ssbIdList; 719 }; 720 721 struct NrCellSsbIds { 722 /** Absolute Radio Frequency Channel Number of the BCCH carrier 0~1023 */ 723 int32_t arfcn; 724 725 /** cid */ 726 int64_t cid; 727 728 /** pic */ 729 int32_t pic; 730 731 /** Reference Signal Received Power -140~-44, dBm */ 732 int32_t rsrp; 733 734 /** Signal To Interference Plus Noise Ratio. */ 735 int32_t sinr; 736 737 /** Time advance. */ 738 int32_t timeAdvance; 739 740 /** Service cell ssbId list, always size is 8 */ 741 std::vector<SsbIdInfo> sCellSsbList; 742 743 /** Neighboring cell ssb list count, mas size is 4 */ 744 int32_t nbCellCount; 745 746 /** Neighboring cell ssb info list, mas size is 4 */ 747 std::vector<NeighboringCellSsbInfo> nbCellSsbList; 748 }; 749 } // namespace Telephony 750 } // namespace OHOS 751 #endif // OHOS_RIL_NETWORK_PARCEL_H 752