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

Unified Diff: components/proximity_auth/bluetooth_low_energy_advertiser.h

Issue 2900253005: BLE advertiser
Patch Set: Created 3 years, 7 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
« no previous file with comments | « components/proximity_auth/BUILD.gn ('k') | components/proximity_auth/bluetooth_low_energy_advertiser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/proximity_auth/bluetooth_low_energy_advertiser.h
diff --git a/components/proximity_auth/bluetooth_low_energy_advertiser.h b/components/proximity_auth/bluetooth_low_energy_advertiser.h
new file mode 100644
index 0000000000000000000000000000000000000000..3c51385808941c1cc51b9cb55a9a8bf385d9b535
--- /dev/null
+++ b/components/proximity_auth/bluetooth_low_energy_advertiser.h
@@ -0,0 +1,45 @@
+// Copyright 2017 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 COMPONENTS_PROXIMITY_AUTH_BLUETOOTH_LOW_ENERGY_ADVERTISER_H
+#define COMPONENTS_PROXIMITY_AUTH_BLUETOOTH_LOW_ENERGY_ADVERTISER_H
+
+#include <string>
+
+#include "base/macros.h"
+#include "base/memory/ref_counted.h"
+#include "base/memory/weak_ptr.h"
+#include "device/bluetooth/bluetooth_adapter.h"
+#include "device/bluetooth/bluetooth_advertisement.h"
+
+namespace proximity_auth {
+
+class BluetoothLowEnergyAdvertiser {
+ public:
+ BluetoothLowEnergyAdvertiser();
+ ~BluetoothLowEnergyAdvertiser();
+
+ void Advertise();
+
+ private:
+ void OnAdapterInitialized(scoped_refptr<device::BluetoothAdapter> adapter);
+ void OnAdvertisementRegistered(
+ scoped_refptr<device::BluetoothAdvertisement> advertisement);
+ void OnAdvertisementError(
+ device::BluetoothAdvertisement::ErrorCode error_code);
+
+ // The Bluetooth adapter over which this connection is made. Non-null iff
+ // |this| connection is registered as an observer of the |adapter_|.
+ scoped_refptr<device::BluetoothAdapter> adapter_;
+
+ scoped_refptr<device::BluetoothAdvertisement> advertisement_;
+
+ base::WeakPtrFactory<BluetoothLowEnergyAdvertiser> weak_ptr_factory_;
+
+ DISALLOW_COPY_AND_ASSIGN(BluetoothLowEnergyAdvertiser);
+};
+
+} // namespace proximity_auth
+
+#endif // COMPONENTS_PROXIMITY_AUTH_BLUETOOTH_LOW_ENERGY_ADVERTISER_H
« no previous file with comments | « components/proximity_auth/BUILD.gn ('k') | components/proximity_auth/bluetooth_low_energy_advertiser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698