• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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>  // for shared_ptr, make_...
20 #include <string>  // for string
21 
22 #include "model/controller/dual_mode_controller.h"  // for DualModeController
23 #include "model/hci/hci_transport.h"                // for HciTransport
24 
25 namespace rootcanal {
26 
27 class HciDevice : public DualModeController {
28  public:
29   HciDevice(std::shared_ptr<HciTransport> transport,
30             ControllerProperties const& properties);
31   ~HciDevice() = default;
32 
Create(std::shared_ptr<HciTransport> transport,ControllerProperties const & properties)33   static std::shared_ptr<HciDevice> Create(
34       std::shared_ptr<HciTransport> transport,
35       ControllerProperties const& properties) {
36     return std::make_shared<HciDevice>(transport, properties);
37   }
38 
GetTypeString()39   std::string GetTypeString() const override { return "hci_device"; }
40 
41   void Tick() override;
42 
43   void Close() override;
44 
45  private:
46   std::shared_ptr<HciTransport> transport_;
47 };
48 
49 }  // namespace rootcanal
50