Implement the empty weave::Bluetooth interface.
This is preparation for further bluetooth work.
Bug: 24009281
Change-Id: Ia9bafb04abf9e479950ad20aae224f4918861504
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..b25c15b
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+*~
diff --git a/Android.mk b/Android.mk
index f72dabf..6556352 100644
--- a/Android.mk
+++ b/Android.mk
@@ -86,10 +86,12 @@
LOCAL_SRC_FILES += \
buffet/avahi_mdns_client.cc \
buffet/brillo_network_client.cc \
+ buffet/stub_bluetooth_client.cc \
else # BRILLO
LOCAL_SRC_FILES += \
+ buffet/stub_bluetooth_client.cc \
buffet/stub_mdns_client.cc \
buffet/stub_network_client.cc \
diff --git a/buffet/bluetooth_client.h b/buffet/bluetooth_client.h
new file mode 100644
index 0000000..3c2b666
--- /dev/null
+++ b/buffet/bluetooth_client.h
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef BUFFET_BLUETOOTH_CLIENT_H
+#define BUFFET_BLUETOOTH_CLIENT_H
+
+#include <memory>
+
+#include <base/macros.h>
+#include <weave/bluetooth.h>
+
+namespace buffet {
+
+class BluetoothClient : public weave::Bluetooth {
+ public:
+ BluetoothClient() {}
+ ~BluetoothClient() override = default;
+
+ static std::unique_ptr<BluetoothClient> CreateInstance();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(BluetoothClient);
+};
+
+} // namespace buffet
+
+#endif // BUFFET_BLUETOOTH_CLIENT_H
diff --git a/buffet/manager.cc b/buffet/manager.cc
index d5caf0c..ef2fc96 100644
--- a/buffet/manager.cc
+++ b/buffet/manager.cc
@@ -25,6 +25,7 @@
#include <dbus/values_util.h>
#include <weave/enum_to_string.h>
+#include "buffet/bluetooth_client.h"
#include "buffet/buffet_config.h"
#include "buffet/dbus_command_dispatcher.h"
#include "buffet/dbus_conversion.h"
@@ -79,6 +80,7 @@
if (!options.disable_privet) {
mdns_client_ = MdnsClient::CreateInstance(dbus_object_.GetBus());
web_serv_client_.reset(new WebServClient{dbus_object_.GetBus(), sequencer});
+ bluetooth_client_ = BluetoothClient::CreateInstance();
}
#endif // BUFFET_USE_WIFI_BOOTSTRAPPING
@@ -89,7 +91,7 @@
device_->Start(options, config_.get(), task_runner_.get(), http_client_.get(),
network_client_.get(), mdns_client_.get(),
- web_serv_client_.get(), nullptr);
+ web_serv_client_.get(), bluetooth_client_.get());
command_dispatcher_.reset(new DBusCommandDispacher{
dbus_object_.GetObjectManager(), device_->GetCommands()});
diff --git a/buffet/manager.h b/buffet/manager.h
index c4b7bb4..e8eb44d 100644
--- a/buffet/manager.h
+++ b/buffet/manager.h
@@ -30,6 +30,7 @@
namespace buffet {
+class BluetoothClient;
class BuffetConfig;
class DBusCommandDispacher;
class HttpTransportClient;
@@ -124,6 +125,7 @@
class TaskRunner;
std::unique_ptr<TaskRunner> task_runner_;
+ std::unique_ptr<BluetoothClient> bluetooth_client_;
std::unique_ptr<HttpTransportClient> http_client_;
std::unique_ptr<NetworkClient> network_client_;
std::unique_ptr<MdnsClient> mdns_client_;
diff --git a/buffet/stub_bluetooth_client.cc b/buffet/stub_bluetooth_client.cc
new file mode 100644
index 0000000..a10f505
--- /dev/null
+++ b/buffet/stub_bluetooth_client.cc
@@ -0,0 +1,25 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "buffet/bluetooth_client.h"
+
+namespace buffet {
+
+std::unique_ptr<BluetoothClient> BluetoothClient::CreateInstance() {
+ return std::unique_ptr<BluetoothClient>{new BluetoothClient};
+}
+
+} // namespace buffet