1 /* 2 * Copyright (C) 2021 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 #pragma once 17 18 #include "RadioCompatBase.h" 19 20 #include <aidl/android/hardware/radio/modem/BnRadioModem.h> 21 22 namespace android::hardware::radio::compat { 23 24 class RadioModem : public RadioCompatBase, 25 public aidl::android::hardware::radio::modem::BnRadioModem { 26 ::ndk::ScopedAStatus enableModem(int32_t serial, bool on) override; 27 ::ndk::ScopedAStatus getBasebandVersion(int32_t serial) override; 28 ::ndk::ScopedAStatus getDeviceIdentity(int32_t serial) override; 29 ::ndk::ScopedAStatus getImei(int32_t serial) override; 30 ::ndk::ScopedAStatus getHardwareConfig(int32_t serial) override; 31 ::ndk::ScopedAStatus getModemActivityInfo(int32_t serial) override; 32 ::ndk::ScopedAStatus getModemStackStatus(int32_t serial) override; 33 ::ndk::ScopedAStatus getRadioCapability(int32_t serial) override; 34 ::ndk::ScopedAStatus nvReadItem( 35 int32_t serial, ::aidl::android::hardware::radio::modem::NvItem itemId) override; 36 ::ndk::ScopedAStatus nvResetConfig( 37 int32_t serial, ::aidl::android::hardware::radio::modem::ResetNvType type) override; 38 ::ndk::ScopedAStatus nvWriteCdmaPrl(int32_t serial, const std::vector<uint8_t>& prl) override; 39 ::ndk::ScopedAStatus nvWriteItem( 40 int32_t serial, const ::aidl::android::hardware::radio::modem::NvWriteItem& i) override; 41 ::ndk::ScopedAStatus requestShutdown(int32_t serial) override; 42 ::ndk::ScopedAStatus responseAcknowledgement() override; 43 ::ndk::ScopedAStatus sendDeviceState( 44 int32_t serial, ::aidl::android::hardware::radio::modem::DeviceStateType stateType, 45 bool state) override; 46 ::ndk::ScopedAStatus setRadioCapability( 47 int32_t s, const ::aidl::android::hardware::radio::modem::RadioCapability& rc) override; 48 ::ndk::ScopedAStatus setRadioPower(int32_t serial, bool powerOn, bool forEmergencyCall, 49 bool preferredForEmergencyCall) override; 50 ::ndk::ScopedAStatus setResponseFunctions( 51 const std::shared_ptr<::aidl::android::hardware::radio::modem::IRadioModemResponse>& 52 radioModemResponse, 53 const std::shared_ptr<::aidl::android::hardware::radio::modem::IRadioModemIndication>& 54 radioModemIndication) override; 55 56 protected: 57 std::shared_ptr<::aidl::android::hardware::radio::modem::IRadioModemResponse> respond(); 58 59 public: 60 using RadioCompatBase::RadioCompatBase; 61 }; 62 63 } // namespace android::hardware::radio::compat 64