• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2019 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 #include "main/shim/entry.h"
18 
19 #include "gd/btaa/activity_attribution.h"
20 #include "gd/hal/snoop_logger.h"
21 #include "gd/hci/controller.h"
22 #include "gd/hci/distance_measurement_manager.h"
23 #include "gd/hci/hci_layer.h"
24 #include "gd/hci/le_advertising_manager.h"
25 #include "gd/hci/le_scanning_manager.h"
26 #include "gd/hci/msft.h"
27 #include "gd/hci/remote_name_request.h"
28 #include "gd/hci/vendor_specific_event_manager.h"
29 #include "gd/metrics/counter_metrics.h"
30 #include "gd/neighbor/connectability.h"
31 #include "gd/neighbor/discoverability.h"
32 #include "gd/neighbor/inquiry.h"
33 #include "gd/neighbor/page.h"
34 #include "gd/os/handler.h"
35 #include "gd/security/security_module.h"
36 #include "gd/shim/dumpsys.h"
37 #include "gd/storage/storage_module.h"
38 #include "hci/acl_manager.h"
39 #include "main/shim/stack.h"
40 
41 namespace bluetooth {
42 namespace shim {
43 
GetGdShimHandler()44 os::Handler* GetGdShimHandler() { return Stack::GetInstance()->GetHandler(); }
45 
GetAdvertising()46 hci::LeAdvertisingManager* GetAdvertising() {
47   return Stack::GetInstance()
48       ->GetStackManager()
49       ->GetInstance<hci::LeAdvertisingManager>();
50 }
51 
GetController()52 hci::Controller* GetController() {
53   return Stack::GetInstance()
54       ->GetStackManager()
55       ->GetInstance<hci::Controller>();
56 }
57 
GetConnectability()58 neighbor::ConnectabilityModule* GetConnectability() {
59   return Stack::GetInstance()
60       ->GetStackManager()
61       ->GetInstance<neighbor::ConnectabilityModule>();
62 }
63 
GetDiscoverability()64 neighbor::DiscoverabilityModule* GetDiscoverability() {
65   return Stack::GetInstance()
66       ->GetStackManager()
67       ->GetInstance<neighbor::DiscoverabilityModule>();
68 }
69 
GetDumpsys()70 Dumpsys* GetDumpsys() {
71   return Stack::GetInstance()->GetStackManager()->GetInstance<Dumpsys>();
72 }
73 
GetInquiry()74 neighbor::InquiryModule* GetInquiry() {
75   return Stack::GetInstance()
76       ->GetStackManager()
77       ->GetInstance<neighbor::InquiryModule>();
78 }
79 
GetHciLayer()80 hci::HciLayer* GetHciLayer() {
81   return Stack::GetInstance()->GetStackManager()->GetInstance<hci::HciLayer>();
82 }
83 
GetL2capClassicModule()84 l2cap::classic::L2capClassicModule* GetL2capClassicModule() {
85   return Stack::GetInstance()
86       ->GetStackManager()
87       ->GetInstance<bluetooth::l2cap::classic::L2capClassicModule>();
88 }
89 
GetL2capLeModule()90 bluetooth::l2cap::le::L2capLeModule* GetL2capLeModule() {
91   return Stack::GetInstance()
92       ->GetStackManager()
93       ->GetInstance<bluetooth::l2cap::le::L2capLeModule>();
94 }
95 
GetPage()96 neighbor::PageModule* GetPage() {
97   return Stack::GetInstance()
98       ->GetStackManager()
99       ->GetInstance<neighbor::PageModule>();
100 }
101 
GetRemoteNameRequest()102 hci::RemoteNameRequestModule* GetRemoteNameRequest() {
103   return Stack::GetInstance()
104       ->GetStackManager()
105       ->GetInstance<hci::RemoteNameRequestModule>();
106 }
107 
GetScanning()108 hci::LeScanningManager* GetScanning() {
109   return Stack::GetInstance()
110       ->GetStackManager()
111       ->GetInstance<hci::LeScanningManager>();
112 }
113 
GetDistanceMeasurementManager()114 hci::DistanceMeasurementManager* GetDistanceMeasurementManager() {
115   return Stack::GetInstance()
116       ->GetStackManager()
117       ->GetInstance<hci::DistanceMeasurementManager>();
118 }
119 
GetSecurityModule()120 security::SecurityModule* GetSecurityModule() {
121   return Stack::GetInstance()
122       ->GetStackManager()
123       ->GetInstance<security::SecurityModule>();
124 }
125 
GetSnoopLogger()126 hal::SnoopLogger* GetSnoopLogger() {
127   return Stack::GetInstance()
128       ->GetStackManager()
129       ->GetInstance<hal::SnoopLogger>();
130 }
131 
GetStorage()132 storage::StorageModule* GetStorage() {
133   return Stack::GetInstance()
134       ->GetStackManager()
135       ->GetInstance<storage::StorageModule>();
136 }
137 
GetAclManager()138 hci::AclManager* GetAclManager() {
139   return Stack::GetInstance()
140       ->GetStackManager()
141       ->GetInstance<hci::AclManager>();
142 }
143 
GetVendorSpecificEventManager()144 hci::VendorSpecificEventManager* GetVendorSpecificEventManager() {
145   return Stack::GetInstance()
146       ->GetStackManager()
147       ->GetInstance<hci::VendorSpecificEventManager>();
148 }
149 
GetActivityAttribution()150 activity_attribution::ActivityAttribution* GetActivityAttribution() {
151   return Stack::GetInstance()
152       ->GetStackManager()
153       ->GetInstance<activity_attribution::ActivityAttribution>();
154 }
155 
GetCounterMetrics()156 metrics::CounterMetrics* GetCounterMetrics() {
157   return Stack::GetInstance()
158       ->GetStackManager()
159       ->GetInstance<metrics::CounterMetrics>();
160 }
161 
GetMsftExtensionManager()162 hci::MsftExtensionManager* GetMsftExtensionManager() {
163   return Stack::GetInstance()
164       ->GetStackManager()
165       ->GetInstance<hci::MsftExtensionManager>();
166 }
167 
168 }  // namespace shim
169 }  // namespace bluetooth
170