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

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..6f74baa5901ef92aefb8ac3cad090b0ad9a71b69
--- /dev/null
+++ b/chromeos/dbus/bluetooth_advertisement_manager_client.h
@@ -0,0 +1,59 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
armansito 2015/04/09 22:08:32 s/2013/2015
rkc 2015/04/13 19:47:46 Done.
+// 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_
armansito 2015/04/09 22:08:32 This is called "LEAdvertisingManager1" in BlueZ, s
rkc 2015/04/13 19:47:46 Done.
+
+#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 BlueZ daemon.
+class CHROMEOS_EXPORT BluetoothAdvertisementManagerClient : public DBusClient {
armansito 2015/04/09 22:08:32 You'll need an observer interface for this class t
rkc 2015/04/13 19:47:46 Done.
+ public:
+ ~BluetoothAdvertisementManagerClient() override;
+
+ // The ErrorCallback is used by adapter methods to indicate failure.
armansito 2015/04/09 22:08:32 s/adapter methods/advertising manager methods/
rkc 2015/04/13 19:47:46 Done.
+ // 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,
armansito 2015/04/09 22:08:32 'using' instead of 'typedef'
rkc 2015/04/13 19:47:46 Done.
+ const std::string& error_message)> ErrorCallback;
+
+ // Registers an advertisement with the DBus object path |obj_path| with
+ // BlueZ's advertisement manager.
armansito 2015/04/09 22:08:32 s/advertisement manager/advertising manager/, to b
rkc 2015/04/13 19:47:46 Done.
+ virtual void RegisterAdvertisement(const dbus::ObjectPath& obj_path,
armansito 2015/04/09 22:08:32 s/obj_path/object_path/
armansito 2015/04/09 22:08:32 You'll need to take in the object path of the adve
rkc 2015/04/13 19:47:46 Done.
rkc 2015/04/13 19:47:46 Done.
+ 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,
armansito 2015/04/09 22:08:32 s/profile_path/object_path/, and add "advertisemen
rkc 2015/04/13 19:47:46 Done.
+ 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