111fccf17Sopenharmony_ci/* 211fccf17Sopenharmony_ci * Copyright (C) 2021-2022 Huawei Device Co., Ltd. 311fccf17Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 411fccf17Sopenharmony_ci * you may not use this file except in compliance with the License. 511fccf17Sopenharmony_ci * You may obtain a copy of the License at 611fccf17Sopenharmony_ci * 711fccf17Sopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 811fccf17Sopenharmony_ci * 911fccf17Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software 1011fccf17Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 1111fccf17Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1211fccf17Sopenharmony_ci * See the License for the specific language governing permissions and 1311fccf17Sopenharmony_ci * limitations under the License. 1411fccf17Sopenharmony_ci */ 1511fccf17Sopenharmony_ci 1611fccf17Sopenharmony_ci#ifndef OHOS_HRIL_CALL_H 1711fccf17Sopenharmony_ci#define OHOS_HRIL_CALL_H 1811fccf17Sopenharmony_ci 1911fccf17Sopenharmony_ci#include "hril_base.h" 2011fccf17Sopenharmony_ci 2111fccf17Sopenharmony_cinamespace OHOS { 2211fccf17Sopenharmony_cinamespace Telephony { 2311fccf17Sopenharmony_ciclass HRilCall : public HRilBase { 2411fccf17Sopenharmony_cipublic: 2511fccf17Sopenharmony_ci HRilCall(int32_t slotId); 2611fccf17Sopenharmony_ci virtual ~HRilCall(); 2711fccf17Sopenharmony_ci 2811fccf17Sopenharmony_ci bool IsCallRespOrNotify(uint32_t code); 2911fccf17Sopenharmony_ci 3011fccf17Sopenharmony_ci void RegisterCallFuncs(const HRilCallReq *callFuncs); 3111fccf17Sopenharmony_ci 3211fccf17Sopenharmony_ci int32_t GetCallList(int32_t serialId); 3311fccf17Sopenharmony_ci int32_t Dial(int32_t serialId, const OHOS::HDI::Ril::V1_1::DialInfo &dialInfo); 3411fccf17Sopenharmony_ci int32_t Reject(int32_t serialId); 3511fccf17Sopenharmony_ci int32_t Hangup(int32_t serialId, int32_t gsmIndex); 3611fccf17Sopenharmony_ci int32_t Answer(int32_t serialId); 3711fccf17Sopenharmony_ci int32_t HoldCall(int32_t serialId); 3811fccf17Sopenharmony_ci int32_t UnHoldCall(int32_t serialId); 3911fccf17Sopenharmony_ci int32_t SwitchCall(int32_t serialId); 4011fccf17Sopenharmony_ci int32_t CombineConference(int32_t serialId, int32_t callType); 4111fccf17Sopenharmony_ci int32_t SeparateConference(int32_t serialId, int32_t callIndex, int32_t callType); 4211fccf17Sopenharmony_ci int32_t GetCallWaiting(int32_t serialId); 4311fccf17Sopenharmony_ci int32_t SetCallWaiting(int32_t serialId, int32_t activate); 4411fccf17Sopenharmony_ci int32_t GetCallTransferInfo(int32_t serialId, int32_t reason); 4511fccf17Sopenharmony_ci int32_t SetCallTransferInfo(int32_t serialId, const OHOS::HDI::Ril::V1_1::CallForwardSetInfo &callForwardSetInfo); 4611fccf17Sopenharmony_ci int32_t GetCallRestriction(int32_t serialId, const std::string &fac); 4711fccf17Sopenharmony_ci int32_t SetCallRestriction(int32_t serialId, const OHOS::HDI::Ril::V1_1::CallRestrictionInfo &callRestrictionInfo); 4811fccf17Sopenharmony_ci int32_t GetClip(int32_t serialId); 4911fccf17Sopenharmony_ci int32_t SetClip(int32_t serialId, int32_t action); 5011fccf17Sopenharmony_ci int32_t GetClir(int32_t serialId); 5111fccf17Sopenharmony_ci int32_t SetClir(int32_t serialId, int32_t action); 5211fccf17Sopenharmony_ci int32_t GetCallPreferenceMode(int32_t serialId); 5311fccf17Sopenharmony_ci int32_t SetCallPreferenceMode(int32_t serialId, int32_t mode); 5411fccf17Sopenharmony_ci int32_t SetUssd(int32_t serialId, const std::string &str); 5511fccf17Sopenharmony_ci int32_t GetUssd(int32_t serialId); 5611fccf17Sopenharmony_ci int32_t SetMute(int32_t serialId, int32_t mute); 5711fccf17Sopenharmony_ci int32_t GetMute(int32_t serialId); 5811fccf17Sopenharmony_ci int32_t GetCallFailReason(int32_t serialId); 5911fccf17Sopenharmony_ci int32_t CallSupplement(int32_t serialId, int32_t type); 6011fccf17Sopenharmony_ci int32_t SetBarringPassword(int32_t serialId, const OHOS::HDI::Ril::V1_1::SetBarringInfo &setBarringInfo); 6111fccf17Sopenharmony_ci int32_t StartDtmf(int32_t serialId, const OHOS::HDI::Ril::V1_1::DtmfInfo &dtmfInfo); 6211fccf17Sopenharmony_ci int32_t SendDtmf(int32_t serialId, const OHOS::HDI::Ril::V1_1::DtmfInfo &dtmfInfo); 6311fccf17Sopenharmony_ci int32_t StopDtmf(int32_t serialId, const OHOS::HDI::Ril::V1_1::DtmfInfo &dtmfInfo); 6411fccf17Sopenharmony_ci int32_t GetEmergencyCallList(int32_t serialId); 6511fccf17Sopenharmony_ci int32_t SetEmergencyCallList(int32_t serialId, const OHOS::HDI::Ril::V1_1::EmergencyInfoList &emergencyInfoList); 6611fccf17Sopenharmony_ci int32_t CloseUnFinishedUssd(int32_t serialId); 6711fccf17Sopenharmony_ci bool IsCallResponse(uint32_t code); 6811fccf17Sopenharmony_ci bool IsCallNotification(uint32_t code); 6911fccf17Sopenharmony_ci int32_t SetVonrSwitch(int32_t serialId, int32_t status); 7011fccf17Sopenharmony_ci 7111fccf17Sopenharmony_ci int32_t GetCallListResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, 7211fccf17Sopenharmony_ci const void *response, size_t responseLen); 7311fccf17Sopenharmony_ci int32_t DialResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, 7411fccf17Sopenharmony_ci size_t responseLen); 7511fccf17Sopenharmony_ci int32_t HangupResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, 7611fccf17Sopenharmony_ci const void *response, size_t responseLen); 7711fccf17Sopenharmony_ci int32_t RejectResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, 7811fccf17Sopenharmony_ci const void *response, size_t responseLen); 7911fccf17Sopenharmony_ci int32_t HoldCallResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, 8011fccf17Sopenharmony_ci const void *response, size_t responseLen); 8111fccf17Sopenharmony_ci int32_t UnHoldCallResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, 8211fccf17Sopenharmony_ci const void *response, size_t responseLen); 8311fccf17Sopenharmony_ci int32_t SwitchCallResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, 8411fccf17Sopenharmony_ci const void *response, size_t responseLen); 8511fccf17Sopenharmony_ci int32_t GetLastCallErrorCodeResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, 8611fccf17Sopenharmony_ci const void *response, size_t responseLen); 8711fccf17Sopenharmony_ci int32_t AnswerResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, 8811fccf17Sopenharmony_ci const void *response, size_t responseLen); 8911fccf17Sopenharmony_ci int32_t GetClipResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, 9011fccf17Sopenharmony_ci const void *response, size_t responseLen); 9111fccf17Sopenharmony_ci int32_t SetClipResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, 9211fccf17Sopenharmony_ci const void *response, size_t responseLen); 9311fccf17Sopenharmony_ci int32_t CombineConferenceResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, 9411fccf17Sopenharmony_ci const void *response, size_t responseLen); 9511fccf17Sopenharmony_ci int32_t SeparateConferenceResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, 9611fccf17Sopenharmony_ci const void *response, size_t responseLen); 9711fccf17Sopenharmony_ci int32_t CallSupplementResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, 9811fccf17Sopenharmony_ci const void *response, size_t responseLen); 9911fccf17Sopenharmony_ci int32_t GetCallWaitingResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, 10011fccf17Sopenharmony_ci const void *response, size_t responseLen); 10111fccf17Sopenharmony_ci int32_t SetCallWaitingResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, 10211fccf17Sopenharmony_ci const void *response, size_t responseLen); 10311fccf17Sopenharmony_ci int32_t GetCallTransferInfoResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, 10411fccf17Sopenharmony_ci const void *response, size_t responseLen); 10511fccf17Sopenharmony_ci int32_t SetCallTransferInfoResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, 10611fccf17Sopenharmony_ci const void *response, size_t responseLen); 10711fccf17Sopenharmony_ci int32_t GetCallRestrictionResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, 10811fccf17Sopenharmony_ci const void *response, size_t responseLen); 10911fccf17Sopenharmony_ci int32_t SetCallRestrictionResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, 11011fccf17Sopenharmony_ci const void *response, size_t responseLen); 11111fccf17Sopenharmony_ci int32_t GetClirResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, 11211fccf17Sopenharmony_ci const void *response, size_t responseLen); 11311fccf17Sopenharmony_ci int32_t SetClirResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, 11411fccf17Sopenharmony_ci const void *response, size_t responseLen); 11511fccf17Sopenharmony_ci int32_t StartDtmfResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, 11611fccf17Sopenharmony_ci const void *response, size_t responseLen); 11711fccf17Sopenharmony_ci int32_t SendDtmfResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, 11811fccf17Sopenharmony_ci const void *response, size_t responseLen); 11911fccf17Sopenharmony_ci int32_t StopDtmfResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, 12011fccf17Sopenharmony_ci const void *response, size_t responseLen); 12111fccf17Sopenharmony_ci int32_t GetCallPreferenceModeResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, 12211fccf17Sopenharmony_ci const void *response, size_t responseLen); 12311fccf17Sopenharmony_ci int32_t SetCallPreferenceModeResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, 12411fccf17Sopenharmony_ci const void *response, size_t responseLen); 12511fccf17Sopenharmony_ci int32_t SetUssdResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, 12611fccf17Sopenharmony_ci const void *response, size_t responseLen); 12711fccf17Sopenharmony_ci int32_t GetUssdResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, 12811fccf17Sopenharmony_ci const void *response, size_t responseLen); 12911fccf17Sopenharmony_ci int32_t SetMuteResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, 13011fccf17Sopenharmony_ci const void *response, size_t responseLen); 13111fccf17Sopenharmony_ci int32_t GetMuteResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, 13211fccf17Sopenharmony_ci const void *response, size_t responseLen); 13311fccf17Sopenharmony_ci int32_t GetEmergencyCallListResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, 13411fccf17Sopenharmony_ci const void *response, size_t responseLen); 13511fccf17Sopenharmony_ci int32_t GetCallFailReasonResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, 13611fccf17Sopenharmony_ci const void *response, size_t responseLen); 13711fccf17Sopenharmony_ci int32_t SetEmergencyCallListResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, 13811fccf17Sopenharmony_ci const void *response, size_t responseLen); 13911fccf17Sopenharmony_ci int32_t SetBarringPasswordResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, 14011fccf17Sopenharmony_ci const void *response, size_t responseLen); 14111fccf17Sopenharmony_ci int32_t CloseUnFinishedUssdResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, 14211fccf17Sopenharmony_ci const void *response, size_t responseLen); 14311fccf17Sopenharmony_ci int32_t SetVonrSwitchResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, 14411fccf17Sopenharmony_ci const void *response, size_t responseLen); 14511fccf17Sopenharmony_ci 14611fccf17Sopenharmony_ci int32_t CallStateUpdated(int32_t notifyType, HRilErrNumber error, const void *response, size_t responseLen); 14711fccf17Sopenharmony_ci int32_t CallUssdNotice(int32_t notifyType, HRilErrNumber error, const void *response, size_t responseLen); 14811fccf17Sopenharmony_ci int32_t CallRingbackVoiceNotice(int32_t notifyType, HRilErrNumber error, const void *response, size_t responseLen); 14911fccf17Sopenharmony_ci int32_t CallSrvccStatusNotice(int32_t notifyType, HRilErrNumber error, const void *response, size_t responseLen); 15011fccf17Sopenharmony_ci int32_t CallEmergencyNotice(int32_t notifyType, HRilErrNumber error, const void *response, size_t responseLen); 15111fccf17Sopenharmony_ci int32_t CallSsNotice(int32_t notifyType, HRilErrNumber error, const void *response, size_t responseLen); 15211fccf17Sopenharmony_ci int32_t CallRsrvccStatusNotify(int32_t notifyType, HRilErrNumber error, const void *response, size_t responseLen); 15311fccf17Sopenharmony_ci void BuildICallList( 15411fccf17Sopenharmony_ci HDI::Ril::V1_1::CallInfoList &callInfoList, const void *response, size_t responseLen); 15511fccf17Sopenharmony_ci void BuildIEmergencyCallList( 15611fccf17Sopenharmony_ci HDI::Ril::V1_1::EmergencyInfoList &emergencyCallInfoList, const void *response, size_t responseLen); 15711fccf17Sopenharmony_ci void BuildICallForwardQueryInfoList(HDI::Ril::V1_1::CallForwardQueryInfoList &cFQueryList, 15811fccf17Sopenharmony_ci HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen); 15911fccf17Sopenharmony_ci 16011fccf17Sopenharmony_ciprivate: 16111fccf17Sopenharmony_ci void CopyToHRilEmergencyInfoArray( 16211fccf17Sopenharmony_ci HRilEmergencyInfo *emergencyInfoCalls, std::vector<HDI::Ril::V1_1::EmergencyCall> calls); 16311fccf17Sopenharmony_ci void AddCallNotificationToMap(); 16411fccf17Sopenharmony_ci void AddCallBasicResponseToMap(); 16511fccf17Sopenharmony_ci void AddCallSupplementResponseToMap(); 16611fccf17Sopenharmony_ci void AddCallAdditionalResponseToMap(); 16711fccf17Sopenharmony_ci 16811fccf17Sopenharmony_ciprivate: 16911fccf17Sopenharmony_ci const HRilCallReq *callFuncs_ = nullptr; 17011fccf17Sopenharmony_ci}; 17111fccf17Sopenharmony_ci} // namespace Telephony 17211fccf17Sopenharmony_ci} // namespace OHOS 17311fccf17Sopenharmony_ci#endif // OHOS_HRIL_CALL_H 174