• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2021 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 CELLULAR_CALL_CONNECTION_CS_H
17 #define CELLULAR_CALL_CONNECTION_CS_H
18 
19 #include "tel_ril_call_parcel.h"
20 #include "base_connection.h"
21 #include "call_manager_disconnected_details.h"
22 
23 namespace OHOS {
24 namespace Telephony {
25 class CellularCallConnectionCS : public BaseConnection {
26 public:
27     /**
28      * Constructor
29      */
30     CellularCallConnectionCS() = default;
31 
32     /**
33      * Destructor
34      */
35     ~CellularCallConnectionCS() = default;
36 
37     /**
38      * DialRequest
39      *
40      * @param slotId
41      * @param DialRequestStruct
42      * @return Error Code: Returns TELEPHONY_SUCCESS on success, others on failure.
43      */
44     int32_t DialRequest(int32_t slotId, const DialRequestStruct &dialRequest);
45 
46     /**
47      * HangUpRequest
48      *
49      * @param slotId
50      * @return Error Code: Returns TELEPHONY_SUCCESS on success, others on failure.
51      */
52     int32_t HangUpRequest(int32_t slotId);
53 
54     /**
55      * AnswerRequest
56      *
57      * @param slotId
58      * @return Error Code: Returns TELEPHONY_SUCCESS on success, others on failure.
59      */
60     int32_t AnswerRequest(int32_t slotId);
61 
62     /**
63      * RejectRequest
64      *
65      * @param slotId
66      * @return Error Code: Returns TELEPHONY_SUCCESS on success, others on failure.
67      */
68     int32_t RejectRequest(int32_t slotId);
69 
70     /**
71      * SwitchCallRequest
72      *
73      * @param slotId
74      * @return Error Code: Returns TELEPHONY_SUCCESS on success, others on failure.
75      */
76     int32_t SwitchCallRequest(int32_t slotId);
77 
78     /**
79      * HoldRequest
80      *
81      * @param slotId
82      * @return Error Code: Returns TELEPHONY_SUCCESS on success, others on failure.
83      */
84     int32_t HoldRequest(int32_t slotId);
85 
86     /**
87      * UnHoldCallRequest
88      *
89      * @param slotId
90      * @return Error Code: Returns TELEPHONY_SUCCESS on success, others on failure.
91      */
92     int32_t UnHoldCallRequest(int32_t slotId);
93 
94     /**
95      * CombineConferenceRequest
96      *
97      * @param slotId
98      * @param voiceCall
99      * @return Error Code: Returns TELEPHONY_SUCCESS on success, others on failure.
100      */
101     int32_t CombineConferenceRequest(int32_t slotId, int32_t voiceCall);
102 
103     /**
104      * SeparateConferenceRequest
105      *
106      * @param slotId
107      * @param index
108      * @param voiceCall
109      * @return Error Code: Returns TELEPHONY_SUCCESS on success, others on failure.
110      */
111     int32_t SeparateConferenceRequest(int32_t slotId, int32_t index, int32_t voiceCall);
112 
113     /**
114      * CallSupplement Request
115      *
116      * 22083-400_2001 2 Call hold
117      * 3GPP TS 22.030 [3]
118      *
119      * @param slotId
120      * @param CallSupplementType
121      * @return Error Code: Returns TELEPHONY_SUCCESS on success, others on failure.
122      */
123     int32_t CallSupplementRequest(int32_t slotId, CallSupplementType type);
124 
125     /**
126      * CSControl GetCsCallsDataRequest
127      *
128      * 27007-430_2001 7.18 List current calls +CLCC
129      * 3GPP TS 22.030 [19]
130      *
131      * Returns list of current calls of ME.
132      *
133      * @param slotId
134      * @param lastCallsDataFlag
135      * @return Error Code: Returns TELEPHONY_SUCCESS on success, others on failure.
136      */
137     int32_t GetCsCallsDataRequest(int32_t slotId, int64_t lastCallsDataFlag);
138 
139     /**
140      * SendCDMAThreeWayDialRequest
141      *
142      * @param slotId
143      * @return Error Code: Returns TELEPHONY_SUCCESS on success, others on failure.
144      */
145     int32_t SendCDMAThreeWayDialRequest(int32_t slotId);
146 
147     /**
148      * SendDtmfRequest
149      *
150      * @param slotId
151      * @param char cDtmfCode
152      * @param index
153      * @return Error Code: Returns TELEPHONY_SUCCESS on success, others on failure.
154      */
155     int32_t SendDtmfRequest(int32_t slotId, char cDtmfCode, int32_t index) const;
156 
157     /**
158      * StartDtmfRequest
159      *
160      * @param slotId
161      * @param char cDtmfCode
162      * @param index
163      * @return Error Code: Returns TELEPHONY_SUCCESS on success, others on failure.
164      */
165     int32_t StartDtmfRequest(int32_t slotId, char cDtmfCode, int32_t index) const;
166 
167     /**
168      * StopDtmfRequest
169      *
170      * @param slotId
171      * @param index
172      * @return Error Code: Returns TELEPHONY_SUCCESS on success, others on failure.
173      */
174     int32_t StopDtmfRequest(int32_t slotId, int32_t index) const;
175 
176     /**
177      * GetCallFailReasonRequest
178      *
179      * @param slotId
180      * @return Error Code: Returns TELEPHONY_SUCCESS on success, others on failure.
181      */
182     int32_t GetCallFailReasonRequest(int32_t slotId) const;
183 
184     /**
185      * RegisterHandler
186      */
187     void RegisterHandler();
188 
189     RilDisconnectedReason GetDisconnectReason();
190 
191     void SetDisconnectReason(RilDisconnectedReason reason);
192 
193 private:
194     virtual int32_t ProcessPostDialCallChar(int32_t slotId, char c) override;
195     RilDisconnectedReason disconnectReason_ = RilDisconnectedReason::DISCONNECTED_REASON_INVALID;
196 };
197 } // namespace Telephony
198 } // namespace OHOS
199 
200 #endif // CELLULAR_CALL_CONNECTION_CS_H