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

Unified Diff: device/bluetooth/bluetooth_advertisement.cc

Issue 1054743003: Add CPP API for BLE advertisments. (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: device/bluetooth/bluetooth_advertisement.cc
diff --git a/device/bluetooth/bluetooth_advertisement.cc b/device/bluetooth/bluetooth_advertisement.cc
new file mode 100644
index 0000000000000000000000000000000000000000..ba5aa27483de1f5f588decbe9cf9f3bc54dfdc68
--- /dev/null
+++ b/device/bluetooth/bluetooth_advertisement.cc
@@ -0,0 +1,45 @@
+// Copyright (c) 2012 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.
+
+#include "device/bluetooth/bluetooth_advertisement.h"
+
+namespace device {
+
+BluetoothAdvertisement::Data::Data(
+ AdvertisementType type,
+ scoped_ptr<UUIDList> service_uuids,
+ scoped_ptr<ManufacturerData> manufacturer_data,
+ scoped_ptr<UUIDList> solicit_uuids,
+ scoped_ptr<ServiceData> service_data)
+ : type_(type),
+ service_uuids_(service_uuids.Pass()),
+ manufacturer_data_(manufacturer_data.Pass()),
+ solicit_uuids_(solicit_uuids.Pass()),
+ service_data_(service_data.Pass()) {
+}
+
+BluetoothAdvertisement::Data::~Data() {
+}
+
+BluetoothAdvertisement::Data::Data() : type_(ADVERTISEMENT_TYPE_BROADCAST) {
+}
+
+void BluetoothAdvertisement::AddObserver(
+ BluetoothAdvertisement::Observer* observer) {
+ CHECK(observer);
+ observers_.AddObserver(observer);
+}
+
+void BluetoothAdvertisement::RemoveObserver(
+ BluetoothAdvertisement::Observer* observer) {
+ CHECK(observer);
+ observers_.RemoveObserver(observer);
+}
+
+BluetoothAdvertisement::BluetoothAdvertisement() {
+}
+BluetoothAdvertisement::~BluetoothAdvertisement() {
+}
+
+} // namespace device

Powered by Google App Engine
This is Rietveld 408576698