1 //
2 //  Copyright 2016 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 "service/adapter.h"
20 
21 #include <base/memory/ref_counted.h>
22 #include <dbus/bus.h>
23 #include <dbus/exported_object.h>
24 #include <dbus/message.h>
25 #include <dbus/object_path.h>
26 #include <dbus/property.h>
27 
28 using ::dbus::Bus;
29 using ::dbus::ExportedObject;
30 using ::dbus::MethodCall;
31 
32 namespace ipc {
33 namespace dbus {
34 
35 class BluetoothAdapter {
36  public:
37   explicit BluetoothAdapter(scoped_refptr<Bus> bus,
38                             bluetooth::Adapter* adapter);
39   virtual ~BluetoothAdapter();
40 
41   void Enable(MethodCall* method_call,
42               ExportedObject::ResponseSender response_sender);
43 
44   void Disable(MethodCall* method_call,
45                ExportedObject::ResponseSender response_sender);
46 
47   void Introspect(MethodCall* method_call,
48                   ExportedObject::ResponseSender response_sender);
49 
50  private:
51   ExportedObject* exported_object_;
52   bluetooth::Adapter* adapter_;
53 };
54 
55 }  // namespace dbus
56 }  // namespace ipc
57