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

Unified Diff: third_party/WebKit/Source/modules/bluetooth/BluetoothCharacteristicProperties.cpp

Issue 1403723004: bluetooth: Implement BluetoothCharacteristicProperties (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bluetooth-query-cache
Patch Set: Address scheib's comments Created 5 years, 2 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: third_party/WebKit/Source/modules/bluetooth/BluetoothCharacteristicProperties.cpp
diff --git a/third_party/WebKit/Source/modules/bluetooth/BluetoothCharacteristicProperties.cpp b/third_party/WebKit/Source/modules/bluetooth/BluetoothCharacteristicProperties.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..0a4218847b718dbea89672bae8ea9d0475894a4c
--- /dev/null
+++ b/third_party/WebKit/Source/modules/bluetooth/BluetoothCharacteristicProperties.cpp
@@ -0,0 +1,66 @@
+// Copyright 2015 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 "config.h"
+#include "modules/bluetooth/BluetoothCharacteristicProperties.h"
+
+namespace blink {
+
+BluetoothCharacteristicProperties* BluetoothCharacteristicProperties::create(uint32_t properties)
+{
+ return new BluetoothCharacteristicProperties(properties);
+}
+
+bool BluetoothCharacteristicProperties::broadcast() const
+{
+ return properties & Property::Broadcast;
+}
+
+bool BluetoothCharacteristicProperties::read() const
+{
+ return properties & Property::Read;
+}
+
+bool BluetoothCharacteristicProperties::writeWithoutResponse() const
+{
+ return properties & Property::WriteWithoutResponse;
+}
+
+bool BluetoothCharacteristicProperties::write() const
+{
+ return properties & Property::Write;
+}
+
+bool BluetoothCharacteristicProperties::notify() const
+{
+ return properties & Property::Notify;
+}
+
+bool BluetoothCharacteristicProperties::indicate() const
+{
+ return properties & Property::Indicate;
+}
+
+bool BluetoothCharacteristicProperties::authenticatedSignedWrites() const
+{
+ return properties & Property::AuthenticatedSignedWrites;
+}
+
+bool BluetoothCharacteristicProperties::reliableWrite() const
+{
+ return properties & Property::ReliableWrite;
+}
+
+bool BluetoothCharacteristicProperties::writableAuxiliaries() const
+{
+ return properties & Property::WritableAuxiliaries;
+}
+
+BluetoothCharacteristicProperties::BluetoothCharacteristicProperties(uint32_t device_properties)
+{
+ ASSERT(device_properties != Property::None);
+ properties = device_properties;
+}
+
+} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698