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 OHOS_HRIL_MODEM_H 17 #define OHOS_HRIL_MODEM_H 18 19 #include "hril_base.h" 20 #include "hril_modem_parcel.h" 21 22 namespace OHOS { 23 namespace Telephony { 24 class HRilModem : public HRilBase { 25 public: 26 HRilModem(int32_t slotId, IHRilReporter &hrilReporter); 27 virtual ~HRilModem() = default; 28 29 int32_t SetRadioState(struct HdfSBuf *data); 30 int32_t GetRadioState(struct HdfSBuf *data); 31 int32_t GetImei(struct HdfSBuf *data); 32 int32_t GetMeid(struct HdfSBuf *data); 33 int32_t GetVoiceRadioTechnology(struct HdfSBuf *data); 34 int32_t SetRadioStateResponse( 35 int32_t requestNum, HRilRadioResponseInfo &responseInfo, const void *response, size_t responseLen); 36 int32_t GetRadioStateResponse( 37 int32_t requestNum, HRilRadioResponseInfo &responseInfo, const void *response, size_t responseLen); 38 int32_t GetImeiResponse( 39 int32_t requestNum, HRilRadioResponseInfo &responseInfo, const void *response, size_t responseLen); 40 int32_t GetMeidResponse( 41 int32_t requestNum, HRilRadioResponseInfo &responseInfo, const void *response, size_t responseLen); 42 int32_t GetVoiceRadioTechnologyResponse( 43 int32_t requestNum, HRilRadioResponseInfo &responseInfo, const void *response, size_t responseLen); 44 int32_t RadioStateUpdated(int32_t indType, HRilErrNumber e, const void *response, size_t responseLen); 45 int32_t VoiceRadioTechUpdated(int32_t indType, HRilErrNumber e, const void *response, size_t responseLen); 46 void AddHandlerToMap(); 47 bool IsModemRespOrNotify(uint32_t code); 48 void RegisterModemFuncs(const HRilModemReq *modemFuncs); 49 50 private: 51 bool IsModemResponse(uint32_t code); 52 bool IsModemNotification(uint32_t code); 53 54 const HRilModemReq *modemFuncs_ = nullptr; 55 }; 56 } // namespace Telephony 57 } // namespace OHOS 58 #endif // OHOS_HRIL_COMMON_H 59