1 /* 2 * Copyright (C) 2022 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 #ifndef OHOS_BLUETOOTH_IBLUETOOTHOPP_H 16 #define OHOS_BLUETOOTH_IBLUETOOTHOPP_H 17 18 #include <vector> 19 #include <string_ex.h> 20 #include <iremote_broker.h> 21 #include "bluetooth_service_ipc_interface_code.h" 22 #include "i_bluetooth_opp_observer.h" 23 24 using OHOS::Bluetooth::IBluetoothOppObserver; 25 26 namespace OHOS { 27 namespace Bluetooth { 28 using namespace OHOS::bluetooth; 29 30 class IBluetoothOpp : public IRemoteBroker { 31 public: 32 DECLARE_INTERFACE_DESCRIPTOR(u"OHOS.Bluetooth.IBluetoothOpp"); 33 34 virtual int32_t SendFile(const std::string &device, 35 const std::vector<BluetoothIOppTransferFileHolder> &fileHolders, bool& result) = 0; 36 virtual int32_t SetIncomingFileConfirmation(bool accept, int fd) = 0; 37 virtual int32_t GetCurrentTransferInformation(BluetoothIOppTransferInformation &transferInformation) = 0; 38 virtual int32_t CancelTransfer() = 0; 39 virtual int32_t SetLastReceivedFileUri(const std::string &uri) = 0; 40 virtual void RegisterObserver(const sptr<IBluetoothOppObserver> &observer) = 0; 41 virtual void DeregisterObserver(const sptr<IBluetoothOppObserver> &observer) = 0; 42 virtual int32_t GetDeviceState(const BluetoothRawAddress &device, int& result) = 0; 43 virtual int32_t GetDevicesByStates(const std::vector<int32_t> &states, 44 std::vector<BluetoothRawAddress>& result) = 0; 45 }; 46 } // namespace Bluetooth 47 } // namespace OHOS 48 49 #endif // OHOS_BLUETOOTH_IBLUETOOTHOPP_H