1 /* 2 * Copyright 2022 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 17 #pragma once 18 19 #include <memory> 20 #include <string> 21 22 #include "model/controller/controller_properties.h" 23 #include "model/controller/dual_mode_controller.h" 24 #include "model/hci/hci_transport.h" 25 26 namespace rootcanal { 27 28 class HciDevice : public DualModeController { 29 public: 30 HciDevice(std::shared_ptr<HciTransport> transport, ControllerProperties const& properties); 31 ~HciDevice() = default; 32 Create(std::shared_ptr<HciTransport> transport,ControllerProperties const & properties)33 static std::shared_ptr<HciDevice> Create(std::shared_ptr<HciTransport> transport, 34 ControllerProperties const& properties) { 35 return std::make_shared<HciDevice>(transport, properties); 36 } 37 GetTypeString()38 std::string GetTypeString() const override { return "hci_device"; } 39 40 void Tick() override; 41 42 void Close() override; 43 44 private: 45 std::shared_ptr<HciTransport> transport_; 46 }; 47 48 } // namespace rootcanal 49