• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 TELEPHONY_TELEPHONY_TYPES_H
17 #define TELEPHONY_TELEPHONY_TYPES_H
18 
19 #include <string>
20 #include <vector>
21 
22 #include "network_search_types.h"
23 #include "operator_config_types.h"
24 #include "parameter.h"
25 #include "parameters.h"
26 
27 namespace OHOS {
28 namespace Telephony {
29 #define SIM_SLOT_COUNT GetMaxSlotCount<int32_t>()
30 #define SIM_SLOT_COUNT_REAL GetRealMaxSlotCount<int32_t>()
31 #define PREFERRED_NETWORK_TYPE GetPreferredNetworkType<int32_t>()
32 #define VSIM_MODEM_COUNT GetVSimModemCount<int32_t>()
33 #define IS_SUPPORT_VSIM (VSIM_MODEM_COUNT > 0)
34 #define DEFAULT_ESIM_ID GetDefaultEsimSlotId<int32_t>()
35 namespace {
36 const int32_t SYSPARA_SIZE = 128;
37 constexpr size_t ARRAY_SIZE = 1024;
38 const int32_t DEFAULT_SIM_SLOT_ID = 0;
39 const int32_t DEFAULT_OPERATOR_STATE = 0;
40 const int32_t DEFAULT_SIM_SLOT_ID_REMOVE = -1;
41 const int32_t INVALID_MAIN_CARD_SLOTID = -2;
42 const int32_t ERROR_SLOT_OPKEY = -2;
43 const int32_t DSDS_MODE_V2 = 0;
44 const int32_t DSDS_MODE_V3 = 1;
45 const size_t MAX_PARAMETER_LENGTH = 100;
46 const int32_t DUAL_SLOT_COUNT = 2;
47 const int32_t MAX_SLOT_COUNT = 3;
48 const int32_t VSIM_DEFAULT_VALUE = -1;
49 const int32_t ESIM_DEFAULT_SLOTID = -1;
50 std::atomic<int32_t> maxRealSlotCount_ = 0;
51 int32_t maxSlotCount_ = 0;
52 int32_t esimDefaultSlotId_ = ESIM_DEFAULT_SLOTID;
53 int32_t vSimModemCount_ = VSIM_DEFAULT_VALUE;
54 constexpr const char *SATELLITE_DEFAULT_VALUE = "0";
55 constexpr const char *DEFAULT_SLOT_COUNT = "1";
56 constexpr const char *DEFAULT_ESIM_SLOT_ID = "0";
57 constexpr const char *TEL_SIM_SLOT_COUNT = "const.telephony.slotCount";
58 constexpr const char *VIRTUAL_MODEM_SWITCH = "const.booster.virtual_modem_switch";
59 constexpr const char *VIRTUAL_MODEM_DEFAULT_SWITCH = "false";
60 constexpr const char *DEFAULT_PREFERRED_NETWORK_TYPE = "5"; // CORE_NETWORK_MODE_LTE_WCDMA_GSM
61 constexpr const char *TEL_PREFERRED_NETWORK_TYPE = "const.telephony.preferredNetworkType";
62 constexpr const char *DEFAULT_OPERATOR_KEY = "";
63 constexpr const char *INITIAL_OPKEY = "-1";
64 constexpr const char *DEFAULT_OPERATOR_CONFIG = "default_operator_config.json";
65 constexpr const char *OPKEY_PROP_PREFIX = "telephony.sim.opkey";
66 constexpr const char *COUNTRY_CODE_KEY = "telephony.sim.countryCode";
67 constexpr const char *TEL_SATELLITE_SUPPORTED = "const.telephony.satellite.supported";
68 constexpr const char *DEFAULT_VSIM_MODEM_COUNT = "0";
69 constexpr const char *VSIM_MODEM_COUNT_STR = "const.telephony.vsimModemCount";
70 constexpr const char *TEL_ESIM_SUPPORT = "persist.telephony.esim.supported";
71 constexpr const char *TEL_DEFAULT_ESIM_SLOT_ID = "const.telephony.esim.slotID";
72 constexpr const char *DYNAMIC_POWEROFF_MODEM = "telephony.dynamic_poweroff_modem";
73 constexpr const char *DYNAMIC_POWEROFF_MODEM_WITH_STR = "telephony.dynamic_poweroff_modem_with_str";
74 }
75 
76 template<typename T>
GetVirtualModemSwitch()77 inline T GetVirtualModemSwitch()
78 {
79     char virtualModemSwitch[SYSPARA_SIZE] = {0};
80     GetParameter(VIRTUAL_MODEM_SWITCH, VIRTUAL_MODEM_DEFAULT_SWITCH, virtualModemSwitch, SYSPARA_SIZE);
81     if (strcmp(virtualModemSwitch, "true") == 0) {
82         return true;
83     }
84     return false;
85 }
86 
87 template<typename T>
GetMaxSlotCount()88 inline T GetMaxSlotCount()
89 {
90     if (maxSlotCount_ == 0) {
91         char simSlotCount[SYSPARA_SIZE] = { 0 };
92         GetParameter(TEL_SIM_SLOT_COUNT, DEFAULT_SLOT_COUNT, simSlotCount, SYSPARA_SIZE);
93         maxSlotCount_ = std::atoi(simSlotCount);
94         if (GetVirtualModemSwitch<bool>() && maxSlotCount_ == 0) {
95             maxSlotCount_ = 1;
96         }
97     }
98     return maxSlotCount_;
99 }
100 
101 template<typename T>
GetRealMaxSlotCount()102 inline T GetRealMaxSlotCount()
103 {
104     if (maxRealSlotCount_ == 0) {
105         char realSimSlotCount[SYSPARA_SIZE] = { 0 };
106         GetParameter(TEL_SIM_SLOT_COUNT, DEFAULT_SLOT_COUNT, realSimSlotCount, SYSPARA_SIZE);
107         maxRealSlotCount_ = std::atoi(realSimSlotCount);
108     }
109     return maxRealSlotCount_;
110 }
111 
112 template<typename T>
GetDefaultEsimSlotId()113 inline T GetDefaultEsimSlotId()
114 {
115     if (esimDefaultSlotId_ == ESIM_DEFAULT_SLOTID) {
116         char esimDefaultSlotId[SYSPARA_SIZE] = { 0 };
117         GetParameter(TEL_DEFAULT_ESIM_SLOT_ID, DEFAULT_ESIM_SLOT_ID, esimDefaultSlotId, SYSPARA_SIZE);
118         esimDefaultSlotId_ = std::stoi(esimDefaultSlotId);
119     }
120     return esimDefaultSlotId_;
121 }
122 
123 template<typename T>
GetVSimModemCount()124 inline T GetVSimModemCount()
125 {
126     if (vSimModemCount_ == VSIM_DEFAULT_VALUE) {
127         char vSimModemCount[SYSPARA_SIZE] = { 0 };
128         GetParameter(VSIM_MODEM_COUNT_STR, DEFAULT_VSIM_MODEM_COUNT, vSimModemCount, SYSPARA_SIZE);
129         vSimModemCount_ = std::atoi(vSimModemCount);
130     }
131     return vSimModemCount_;
132 }
133 
134 template<typename T>
GetPreferredNetworkType()135 inline T GetPreferredNetworkType()
136 {
137     char preferredNetworkType[SYSPARA_SIZE] = { 0 };
138     GetParameter(TEL_PREFERRED_NETWORK_TYPE, DEFAULT_PREFERRED_NETWORK_TYPE, preferredNetworkType, SYSPARA_SIZE);
139     T networkType = std::atoi(preferredNetworkType);
140     return networkType;
141 }
142 
GetDynamicPowerOffModeSwitch()143 inline bool GetDynamicPowerOffModeSwitch()
144 {
145     return system::GetBoolParameter(DYNAMIC_POWEROFF_MODEM, false);
146 }
147 
GetDynamicPowerOffModeSwitchWithStr()148 inline bool GetDynamicPowerOffModeSwitchWithStr()
149 {
150     return system::GetBoolParameter(DYNAMIC_POWEROFF_MODEM_WITH_STR, false);
151 }
152 
153 enum SatelliteValue {
154     SATELLITE_NOT_SUPPORTED = 0,
155     SATELLITE_SUPPORTED = 1,
156 };
157 
158 enum SimSlotId {
159     SIM_SLOT_0 = 0,
160     SIM_SLOT_1,
161     SIM_SLOT_2,
162     SIM_SLOT_3,
163 };
164 
165 /**
166  * @brief The modem power status.
167  */
168 enum ModemPowerState {
169     /**
170      * Power Not Available
171      */
172     CORE_SERVICE_POWER_NOT_AVAILABLE = -1,
173     /**
174      * Power OFF
175      */
176     CORE_SERVICE_POWER_OFF = 0,
177     /**
178      * Power ON
179      */
180     CORE_SERVICE_POWER_ON = 1
181 };
182 
183 template<typename T>
184 struct TelRilResponseInfo {
185     int32_t slotId = DEFAULT_SIM_SLOT_ID;
186     int32_t flag = 0;
187     int32_t errorNo = 0;
188     T object;
189 };
190 
191 /**
192  * @brief Defines the network bandwidth reporting rule.
193  */
194 struct LinkBandwidthRule {
195     /**
196      * Radio access technology
197      */
198     int32_t rat = 0;
199     /**
200      * Delay time
201      */
202     int32_t delayMs = 0;
203     /**
204      * Uplink delay
205      */
206     int32_t delayUplinkKbps = 0;
207     /**
208      * Downlink delay
209      */
210     int32_t delayDownlinkKbps = 0;
211     /**
212      * Maximum uplink parameter list
213      */
214     std::vector<int32_t> maximumUplinkKbps {};
215     /**
216      * Maximum downlink parameter list
217      */
218     std::vector<int32_t> maximumDownlinkKbps {};
219 };
220 
221 /**
222  * @brief Defines PDP context information.
223  */
224 struct DataProfile {
225     /**
226      * Profile Id
227      */
228     int profileId = 0;
229     /**
230      * (Access Point Name) a string parameter which is a logical name that is used to select the
231      * GGSN or the external packet data network. from 3GPP TS 27.007 10.1 V4.3.0 (2001-12)
232      */
233     std::string apn = "";
234     /**
235      * (Packet Data Protocol type) a string parameter which specifies the type of packet
236      * data protocol from 3GPP TS 27.007 10.1 V4.3.0 (2001-12)
237      */
238     std::string protocol = "";
239     /**
240      * Authentication Type
241      */
242     int32_t verType = 0;
243     /**
244      * Username
245      */
246     std::string userName = "";
247     /**
248      * Password
249      */
250     std::string password = "";
251     /**
252      * Roaming protocol version
253      */
254     std::string roamingProtocol = "";
255     /**
256      * Supported apn types bitmap
257      */
258     int32_t supportedApnTypesBitmap = 0;
259 };
260 
261 /**
262  * @brief Defines activate data information.
263  */
264 struct ActivateDataParam {
265     /**
266      * eg:AppExecFwk::InnerEvent::Get(eventId, activateData.param);
267      */
268     int32_t param = 0;
269     /**
270      * Radio access technology
271      */
272     int32_t radioTechnology = 0;
273     /**
274      * DataProfile
275      */
276     struct DataProfile dataProfile;
277     /**
278      * Whether the user is roaming. The value true indicates that the user is roaming,
279      * and the value false indicates the opposite.
280      */
281     bool isRoaming = false;
282     /**
283      * Whether allow roaming
284      */
285     bool allowRoaming = false;
286 };
287 
288 /**
289  * @brief Defines deactivate data information.
290  */
291 struct DeactivateDataParam {
292     /**
293      * eg:AppExecFwk::InnerEvent::Get(eventId, deactivateData.param);
294      */
295     int32_t param = 0;
296     /**
297      * Packet Data Protocol (PDP) context ID
298      */
299     int32_t cid = 0;
300     /**
301      * Reason code of the data service activation failure. For details, see 3GPP TS 24.008.
302      */
303     int32_t reason = 0;
304 };
305 
306 /**
307  * @brief Defines the call forwarding information.
308  */
309 struct CallTransferParam {
310     /**
311      * Call forwarding operation mode:
312      *- 0: deactivation
313      *- 1: activation
314      *- 2: status query
315      *- 3: registration
316      *- 4: deletion
317      */
318     int32_t mode = 0;
319     /**
320      * Call forwarding type:
321      *- 0: call forwarding unconditional
322      *- 1: call forwarding on busy
323      *- 2: call forwarding on no reply
324      *- 3: call forwarding not reachable (no network service, or power-off)
325      *- 4: any call forwarding
326      *- 5: any call forwarding conditional
327      */
328     int32_t reason = 0;
329     /**
330      * Service class. For details, see 3GPP TS 27.007.
331      */
332     int32_t classx = 0;
333     /**
334      * Phone number
335      */
336     std::string number = "";
337 };
338 
339 /**
340  * @brief Defines the call restriction information.
341  */
342 struct CallRestrictionParam {
343     /**
344      * Operation mode:
345      *- 0: deactivation
346      *- 1: activation
347      */
348     int32_t mode = 0;
349     /**
350      * Password
351      */
352     char password[MAX_PARAMETER_LENGTH + 1] = { 0 };
353     /**
354      * Operation object
355      */
356     std::string fac = "";
357 };
358 
359 /**
360  * @brief Defines the dual tone multi-frequency (DTMF) information.
361  */
362 struct DtmfParam {
363     /**
364      * Call ID
365      */
366     int32_t index = 0;
367     /**
368      * Duration for playing the DTMF tone
369      */
370     int32_t switchOn = 0;
371     /**
372      * Interval for sending DTMF signals
373      */
374     int32_t switchOff = 0;
375     /**
376      * DTMF keyword
377      */
378     std::string sDTMFCode = "";
379 };
380 
381 /**
382  * @brief Defines the GSM cell broadcast configuration information.
383  */
384 struct CBConfigParam {
385     /**
386      * Mode (activated or not)
387      */
388     int32_t mode = 0;
389     /**
390      * Message IDs
391      */
392     std::string idList = "";
393     /**
394      * Data coding schemes
395      */
396     std::string dcsList = "";
397 };
398 
399 /**
400  * @brief Defines the SMS message information in a SIM card.
401  */
402 struct CdmaSimMessageParam {
403     /**
404      * Message index.
405      */
406     int32_t cdmaIndex = 0;
407     /**
408      * Status
409      */
410     int32_t status = 0;
411     /**
412      * Protocol data unit
413      */
414     std::string pdu = "";
415 };
416 
417 /**
418  * @brief GSM SMS message parameter.
419  */
420 struct GsmSimMessageParam {
421     /**
422      * Reference Id
423      */
424     int64_t refId = 0;
425     /**
426      * Short message service center
427      */
428     std::string smscPdu = "";
429     /**
430      * Protocol data unit
431      */
432     std::string pdu = "";
433 };
434 
435 /**
436  * @brief Defines the SMS message information in a SIM card.
437  */
438 struct SimMessageParam {
439     /**
440      * Message index.
441      */
442     int32_t gsmIndex = 0;
443     /**
444      * Status
445      */
446     int32_t status = 0;
447     /**
448      * Short message service center
449      */
450     std::string smscPdu = "";
451     /**
452      * Protocol data unit
453      */
454     std::string pdu = "";
455 };
456 
457 /**
458  * @brief Defines the SIM card lock information.
459  */
460 struct SimLockParam {
461     /**
462      * SIM lock type:
463      *- AO: barring of all outgoing calls
464      *- OI: barring of all outgoing international calls
465      *- OX: barring of all outgoing international calls except those directed to the home country
466      *- AI: barring of all incoming calls
467      *- IR: barring of all incoming calls when roaming outside the home location
468      *- AB: barring of all services (applicable only when the mode is greater than or equal to 0)
469      *- AG: barring of the outgoing call service (applicable only when the mode is greater than or equal to 0)
470      *- AC: barring of the incoming call service (applicable only when the mode is greater than or equal to 0)
471      *- FD: fixed dialing number (FDN)
472      *- PN: network locking
473      *- PU: subnet locking
474      *- PP: SP locking
475      */
476     std::string fac = "";
477     /**
478      * Mode:
479      *- 0: deactivation (When fac is set to PN, PU, or PP, the operation is equivalent to unlocking.)
480      *- 1: activation (When fac is set to PN, PU, or PP, activation is not supported.)
481      *- 2: query
482      */
483     int32_t mode = 0;
484     /**
485      * Password text
486      */
487     std::string passwd = "";
488 };
489 
490 /**
491  * @brief Defines the SIM card password information.
492  */
493 struct SimPasswordParam {
494     /**
495      * Maximum password length
496      */
497     int32_t passwordLength = 0;
498     /**
499      * SIM lock type:
500      *- AO: barring of all outgoing calls
501      *- OI: barring of all outgoing international calls
502      *- OX: barring of all outgoing international calls except those directed to the home country
503      *- AI: barring of all incoming calls
504      *- IR: barring of all incoming calls when roaming outside the home location
505      *- AB: barring of all services (applicable only when the mode is greater than or equal to 0)
506      *- AG: barring of the outgoing call service (applicable only when the mode is greater than or equal to 0)
507      *- AC: barring of the incoming call service (applicable only when the mode is greater than or equal to 0)
508      *- FD: fixed dialing number (FDN)
509      *- PN: network locking
510      *- PU: subnet locking
511      *- PP: SP locking
512      */
513     std::string fac = "";
514     /**
515      * Old password text
516      */
517     std::string oldPassword = "";
518     /**
519      * New password text
520      */
521     std::string newPassword = "";
522 };
523 
524 /**
525  * @brief Enumerates emergency call types.
526  */
527 enum class EccType : int32_t {
528     /**
529      * Default
530      */
531     TYPE_CATEGORY = 0,
532     /**
533      * Police
534      */
535     TYPE_POLICE = 1,
536     /**
537      * Ambulance
538      */
539     TYPE_AMBULANCE = 2,
540     /**
541      * Fire alarm
542      */
543     TYPE_FIRE = 4,
544     /**
545      * Marine police
546      */
547     TYPE_SEA = 8,
548     /**
549      * Mountain rescue
550      */
551     TYPE_MOUNTAIN = 16,
552 };
553 
554 /**
555  * @brief Specifies whether a number is valid when there is a card or no card.
556  */
557 enum class SimpresentType : int32_t {
558     /**
559      * Valid when there is no card
560      */
561     TYPE_NO_CARD = 0,
562     /**
563      * Valid when there is a card
564      */
565     TYPE_HAS_CARD = 1,
566 };
567 
568 /**
569  * @brief Specifies whether a number is valid for all states or only for the abnormal service state of
570  * the circuit switched (CS) domain.
571  */
572 enum class AbnormalServiceType : int32_t {
573     /**
574      * Vaild for all states
575      */
576     TYPE_ALL = 0,
577     /**
578      * Valid only for the abnormal service state of the CS domain
579      */
580     TYPE_ONLY_CS = 1,
581 };
582 
583 /**
584  * @brief Defines the emergency call number.
585  */
586 struct EmergencyCall {
587     /**
588      * Emergency number
589      */
590     std::string eccNum = "";
591     /**
592      * Mobile country code
593      */
594     std::string mcc = "";
595     /**
596      * Enumerates emergency call types. For details, see EccType.
597      */
598     EccType eccType = EccType::TYPE_CATEGORY;
599     /**
600      * Whether a number is valid when there is a card or no card. For details, see SimpresentType.
601      */
602     SimpresentType simpresent = SimpresentType::TYPE_NO_CARD;
603     /**
604      * Whether a number is valid for all states or only for the abnormal service state of the CS domain.
605      * For details, see AbnormalService.
606      */
607     AbnormalServiceType abnormalService = AbnormalServiceType::TYPE_ALL;
608     bool operator==(const EmergencyCall &call)
609     {
610         return (eccNum == call.eccNum && mcc == call.mcc);
611     }
612 };
613 
614 /**
615  * @brief Defines the response info of SetEmergencyCallList.
616  */
617 struct SetEccListResponse {
618     /**
619      * Response result
620      */
621     int32_t result = 0;
622     /**
623      * Response value
624      */
625     int32_t value = 0;
626 };
627 
628 /**
629  * @brief Defines the Public Land Mobile Network name.
630  */
631 struct PlmnNetworkName {
632     /**
633      * Long name of the registered network
634      */
635     std::string longName = "";
636     /**
637      * Short name of the registered network
638      */
639     std::string shortName = "";
640 };
641 
642 /**
643  * @brief Defines the Operator PLMN information see 3GPP TS 31.102 Section 4.2.59.
644  */
645 struct OperatorPlmnInfo {
646     /**
647      * PLMN numeric
648      */
649     std::string plmnNumeric = "";
650     /**
651      * Start of the LAC range
652      */
653     int32_t lacStart = 0;
654     /**
655      * End of the LAC range
656      */
657     int32_t lacEnd = 0;
658     /**
659      * Identifier of operator name in PNN to be displayed
660      */
661     int32_t pnnRecordId = 0;
662 };
663 
664 /**
665  * @brief Enumerates radio protocol phases.
666  *
667  * @enum RadioProtocolPhase
668  */
669 enum class RadioProtocolPhase {
670     /**
671      * The value of Initial radio protocol phase
672      */
673     RADIO_PROTOCOL_PHASE_INITIAL,
674     /**
675      * The value of execute check communication phase
676      */
677     RADIO_PROTOCOL_PHASE_CHECK,
678     /**
679      * The value of execute update communication phase
680      */
681     RADIO_PROTOCOL_PHASE_UPDATE,
682     /**
683      * The value of unsol radio phase
684      */
685     RADIO_PROTOCOL_PHASE_NOTIFY,
686     /**
687      * The value of execute complete communication phase
688      */
689     RADIO_PROTOCOL_PHASE_COMPLETE,
690 };
691 
692 /**
693  * @brief Enumerates radio protocol states.
694  */
695 enum class RadioProtocolStatus {
696     /**
697      * Unknow radio protocol state
698      */
699     RADIO_PROTOCOL_STATUS_NONE,
700     /**
701      * Set radio protocol successed
702      */
703     RADIO_PROTOCOL_STATUS_SUCCESS,
704     /**
705      * Set radio protocol failed
706      */
707     RADIO_PROTOCOL_STATUS_FAIL,
708 };
709 
710 /**
711  * @brief Defines the protocol stack information of the primary and secondary SIM cards.
712  */
713 struct RadioProtocol {
714     /**
715      * Card slot ID
716      */
717     int32_t slotId = DEFAULT_SIM_SLOT_ID;
718     /**
719      * Session ID
720      */
721     int32_t sessionId = 0;
722     /**
723      * Radio protocol parameters. For details, see RadioProtocolPhase.
724      */
725     RadioProtocolPhase phase = RadioProtocolPhase::RADIO_PROTOCOL_PHASE_INITIAL;
726     /**
727      * Radio protocol technology:
728      *- 1: GSM
729      *- 2: 1XRTT
730      *- 4: WCDMA
731      *- 8: HSPA
732      *- 16: HSPAP
733      *- 32: TDSCDMA
734      *- 64: EV-DO
735      *- 128: EHRPD
736      *- 256: LTE
737      *- 512: LTE_CA
738      *- 1024: IWLAN
739      *- 2048: NR
740      */
741     int32_t technology = 0;
742     /**
743      * Modem ID, corresponding to slotId at the bottom layer
744      */
745     int32_t modemId = 0;
746     /**
747      * Radio protocol status. For details, see RadioProtocolStatus.
748      */
749     RadioProtocolStatus status = RadioProtocolStatus::RADIO_PROTOCOL_STATUS_NONE;
750 };
751 
752 /**
753  * @brief Defines the result info of ss command.
754  */
755 struct SsBaseResult {
756     /**
757      * Command index, use for find the ss command to retry
758      */
759     int32_t index = 0;
760     /**
761      * The result of execute command
762      */
763     int32_t result = 0;
764     /**
765      * This use for remaind message code
766      */
767     int32_t reason = 0;
768     /**
769      * This use for remaind message
770      */
771     std::string message = "";
772 };
773 
774 /**
775  * @brief Defines the result info of GetClip.
776  */
777 struct GetClipResult {
778     /**
779      * Query results
780      */
781     SsBaseResult result;
782     /**
783      * Parameter sets/shows the result code presentation status in the TA
784      */
785     int32_t action = 0;
786     /**
787      * Parameter shows the subscriber CLIP service status in the network, <0-4>
788      */
789     int32_t clipStat = 0;
790 };
791 
792 /**
793  * @brief Defines the result info of GetClir.
794  */
795 struct GetClirResult {
796     /**
797      * Query results
798      */
799     SsBaseResult result;
800     /**
801      * Parameter sets/shows the result code presentation status in the TA
802      */
803     int32_t action = 0;
804     /**
805      * Parameter shows the subscriber CLIP service status in the network, <0-4>
806      */
807     int32_t clirStat = 0;
808 };
809 
810 /**
811  * @brief Defines the result info of GetColr.
812  */
813 struct GetColrResult {
814     /**
815      * Query results
816      */
817     SsBaseResult result;
818     /**
819      * Parameter sets/shows the result code presentation status in the TA
820      */
821     int32_t action = 0;
822     /**
823      * Parameter shows the subscriber COLR service status in the network, <0-4>
824      */
825     int32_t colrStat = 0;
826 };
827 
828 /**
829  * @brief Defines the result info of GetColp.
830  */
831 struct GetColpResult {
832     /**
833      * Query results
834      */
835     SsBaseResult result;
836     /**
837      * Parameter sets/shows the result code presentation status in the TA
838      */
839     int32_t action = 0;
840     /**
841      * Parameter shows the subscriber COLP service status in the network, <0-4>
842      */
843     int32_t colpStat = 0;
844 };
845 
846 /**
847  * @brief Defines the result info of CallWait.
848  */
849 struct CallWaitResult {
850     /**
851      * Query results
852      */
853     SsBaseResult result;
854     /**
855      * Parameter sets/shows the result code presentation status in the TA
856      */
857     int32_t status = 0;
858     /**
859      * Parameter shows the subscriber CLIP service status in the network, <0-4>
860      */
861     int32_t classCw = 0;
862 };
863 
864 /**
865  * @brief Defines the result info of CallRestriction.
866  */
867 struct CallRestrictionResult {
868     /**
869      * Query results
870      */
871     SsBaseResult result;
872     /**
873      * Parameter sets/shows the result code presentation status in the TA
874      */
875     int32_t status = 0;
876     /**
877      * Parameter shows the subscriber CLIP service status in the network, <0-4>
878      */
879     int32_t classCw = 0;
880 };
881 
882 /**
883  * @brief Defines the call forwarding query result.
884  */
885 struct CallForwardQueryResult {
886     /**
887      * Request SN
888      */
889     int32_t serial = 0;
890     /**
891      * Query result
892      */
893     int32_t result = 0;
894     /**
895      * Status:
896      *- 0: not activated
897      *- 1: activated
898      */
899     int32_t status = 0;
900     /**
901      * Service class. For details, see 3GPP TS 27.007.
902      */
903     int32_t classx = 0;
904     /**
905      * Phone number
906      */
907     std::string number = "";
908     /**
909      * Number type:
910      *-129: common number
911      *- 145: international number
912      */
913     int32_t type = 0;
914     /**
915      * Call forwarding type:
916      *- 0: call forwarding unconditional
917      *- 1: call forwarding on busy
918      *- 2: call forwarding on no reply
919      *- 3: call forwarding not reachable (no network service or power-off)
920      *- 4: any call forwarding
921      *- 5: any call forwarding conditional
922      */
923     int32_t reason = 0;
924     /**
925      * Waiting time
926      */
927     int32_t time = 0;
928     /**
929      * Start hour
930      */
931     int32_t startHour = 0;
932     /**
933      * Start minute
934      */
935     int32_t startMinute = 0;
936     /**
937      * End hour
938      */
939     int32_t endHour = 0;
940     /**
941      * End minute
942      */
943     int32_t endMinute = 0;
944 };
945 
946 /**
947  * @brief Defines the list of call forwarding information.
948  */
949 struct CallForwardQueryInfoList {
950     /**
951      * Query results
952      */
953     SsBaseResult result;
954     /**
955      * Total number
956      */
957     int32_t callSize = 0;
958     /**
959      * ID of the call forwarding query result
960      */
961     int32_t flag = 0;
962     /**
963      * Call forwarding query result
964      */
965     std::vector<CallForwardQueryResult> calls {};
966 };
967 } // namespace Telephony
968 } // namespace OHOS
969 #endif // TELEPHONY_TELEPHONY_TYPES_H
970