111fccf17Sopenharmony_ci/*
211fccf17Sopenharmony_ci * Copyright (C) 2021 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_MODEM_H
1711fccf17Sopenharmony_ci#define OHOS_HRIL_MODEM_H
1811fccf17Sopenharmony_ci
1911fccf17Sopenharmony_ci#include "hril_base.h"
2011fccf17Sopenharmony_ci
2111fccf17Sopenharmony_cinamespace OHOS {
2211fccf17Sopenharmony_cinamespace Telephony {
2311fccf17Sopenharmony_ciclass HRilModem : public HRilBase {
2411fccf17Sopenharmony_cipublic:
2511fccf17Sopenharmony_ci    HRilModem(int32_t slotId);
2611fccf17Sopenharmony_ci    virtual ~HRilModem() = default;
2711fccf17Sopenharmony_ci
2811fccf17Sopenharmony_ci    int32_t ShutDown(int32_t serialId);
2911fccf17Sopenharmony_ci    int32_t SetRadioState(int32_t serialId, int32_t fun, int32_t rst);
3011fccf17Sopenharmony_ci    int32_t GetRadioState(int32_t serialId);
3111fccf17Sopenharmony_ci    int32_t GetImei(int32_t serialId);
3211fccf17Sopenharmony_ci    int32_t GetImeiSv(int32_t serialId);
3311fccf17Sopenharmony_ci    int32_t GetMeid(int32_t serialId);
3411fccf17Sopenharmony_ci    int32_t GetVoiceRadioTechnology(int32_t serialId);
3511fccf17Sopenharmony_ci    int32_t GetBasebandVersion(int32_t serialId);
3611fccf17Sopenharmony_ci    int32_t ShutDownResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo,
3711fccf17Sopenharmony_ci        const void *response, size_t responseLen);
3811fccf17Sopenharmony_ci    int32_t SetRadioStateResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo,
3911fccf17Sopenharmony_ci        const void *response, size_t responseLen);
4011fccf17Sopenharmony_ci    int32_t GetRadioStateResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo,
4111fccf17Sopenharmony_ci        const void *response, size_t responseLen);
4211fccf17Sopenharmony_ci    int32_t GetImeiResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo,
4311fccf17Sopenharmony_ci        const void *response, size_t responseLen);
4411fccf17Sopenharmony_ci    int32_t GetImeiSvResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo,
4511fccf17Sopenharmony_ci        const void *response, size_t responseLen);
4611fccf17Sopenharmony_ci    int32_t GetMeidResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo,
4711fccf17Sopenharmony_ci        const void *response, size_t responseLen);
4811fccf17Sopenharmony_ci    int32_t GetVoiceRadioTechnologyResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo,
4911fccf17Sopenharmony_ci        const void *response, size_t responseLen);
5011fccf17Sopenharmony_ci    int32_t GetBasebandVersionResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo,
5111fccf17Sopenharmony_ci        const void *response, size_t responseLen);
5211fccf17Sopenharmony_ci    int32_t RadioStateUpdated(int32_t indType, HRilErrNumber error, const void *response, size_t responseLen);
5311fccf17Sopenharmony_ci    int32_t VoiceRadioTechUpdated(int32_t indType, HRilErrNumber error, const void *response, size_t responseLen);
5411fccf17Sopenharmony_ci    int32_t DsdsModeUpdated(int32_t indType, HRilErrNumber error, const void *response, size_t responseLen);
5511fccf17Sopenharmony_ci    int32_t NcfgFinishedResult(int32_t indType, HRilErrNumber error, const void *response, size_t responseLen);
5611fccf17Sopenharmony_ci    int32_t RestartRildNvMatch(int32_t indType, HRilErrNumber error, const void *response, size_t responseLen);
5711fccf17Sopenharmony_ci    void AddHandlerToMap();
5811fccf17Sopenharmony_ci    bool IsModemRespOrNotify(uint32_t code);
5911fccf17Sopenharmony_ci    void RegisterModemFuncs(const HRilModemReq *modemFuncs);
6011fccf17Sopenharmony_ci    int32_t GetLastRadioState();
6111fccf17Sopenharmony_ci
6211fccf17Sopenharmony_ciprivate:
6311fccf17Sopenharmony_ci    bool IsModemResponse(uint32_t code);
6411fccf17Sopenharmony_ci    bool IsModemNotification(uint32_t code);
6511fccf17Sopenharmony_ci    int32_t SetActiveSimResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo,
6611fccf17Sopenharmony_ci        const void *response, size_t responseLen);
6711fccf17Sopenharmony_ci    void BuildIVoiceRadioTechnology(
6811fccf17Sopenharmony_ci        HDI::Ril::V1_1::VoiceRadioTechnology &voiceRadioTech, const HRilVoiceRadioInfo &hRiadioInfo);
6911fccf17Sopenharmony_ci    const HRilModemReq *modemFuncs_ = nullptr;
7011fccf17Sopenharmony_ci    int32_t radioState_ = -1;
7111fccf17Sopenharmony_ci};
7211fccf17Sopenharmony_ci} // namespace Telephony
7311fccf17Sopenharmony_ci} // namespace OHOS
7411fccf17Sopenharmony_ci#endif // OHOS_HRIL_COMMON_H
75