Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(17)

Unified Diff: chromeos/dbus/bluetooth_advertisement_manager_client.h

Issue 1052363005: Add DBus bindings for BLE Advertisement. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chromeos/dbus/bluetooth_advertisement_manager_client.h
diff --git a/chromeos/dbus/bluetooth_advertisement_manager_client.h b/chromeos/dbus/bluetooth_advertisement_manager_client.h
new file mode 100644
index 0000000000000000000000000000000000000000..fba1b69530ff9bad68686ca7200d6596f221db36
--- /dev/null
+++ b/chromeos/dbus/bluetooth_advertisement_manager_client.h
@@ -0,0 +1,59 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROMEOS_DBUS_BLUETOOTH_ADVERTISEMENT_MANAGER_CLIENT_H_
+#define CHROMEOS_DBUS_BLUETOOTH_ADVERTISEMENT_MANAGER_CLIENT_H_
+
+#include <string>
+#include <vector>
+
+#include "base/callback.h"
+#include "base/memory/scoped_ptr.h"
+#include "base/values.h"
+#include "chromeos/chromeos_export.h"
+#include "chromeos/dbus/dbus_client.h"
+#include "dbus/object_path.h"
+
+namespace chromeos {
+
+// BluetoothAdvertisementManagerClient is used to communicate with the profile
+// manager object of the Bluetooth daemon.
+class CHROMEOS_EXPORT BluetoothAdvertisementManagerClient : public DBusClient {
+ public:
+ ~BluetoothAdvertisementManagerClient() override;
+
+ // The ErrorCallback is used by adapter methods to indicate failure.
+ // It receives two arguments: the name of the error in |error_name| and
+ // an optional message in |error_message|.
+ typedef base::Callback<void(const std::string& error_name,
+ const std::string& error_message)> ErrorCallback;
+
+ // Registers an advertisement with the DBus object path |obj_path| with
+ // BlueZ's advertisement manager.
+ virtual void RegisterAdvertisement(const dbus::ObjectPath& obj_path,
+ const base::Closure& callback,
+ const ErrorCallback& error_callback) = 0;
+
+ // Unregisters an advertisement with the DBus object path |obj_path| with
+ // BlueZ's advertisement manager.
+ virtual void UnregisterAdvertisement(const dbus::ObjectPath& profile_path,
+ const base::Closure& callback,
+ const ErrorCallback& error_callback) = 0;
+
+ // Creates the instance.
+ static BluetoothAdvertisementManagerClient* Create();
+
+ // Constants used to indicate exceptional error conditions.
+ static const char kNoResponseError[];
+
+ protected:
+ BluetoothAdvertisementManagerClient();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(BluetoothAdvertisementManagerClient);
+};
+
+} // namespace chromeos
+
+#endif // CHROMEOS_DBUS_BLUETOOTH_ADVERTISEMENT_MANAGER_CLIENT_H_

Powered by Google App Engine
This is Rietveld 408576698