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

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

Issue 1403723004: bluetooth: Implement BluetoothCharacteristicProperties (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bluetooth-query-cache
Patch Set: Fix web exposed test 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.h
diff --git a/third_party/WebKit/Source/modules/bluetooth/BluetoothCharacteristicProperties.h b/third_party/WebKit/Source/modules/bluetooth/BluetoothCharacteristicProperties.h
new file mode 100644
index 0000000000000000000000000000000000000000..ad704789c27cbd584dee623053676f8c895b4648
--- /dev/null
+++ b/third_party/WebKit/Source/modules/bluetooth/BluetoothCharacteristicProperties.h
@@ -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.
+
+#ifndef BluetoothCharacteristicProperties_h
+#define BluetoothCharacteristicProperties_h
+
+#include "bindings/core/v8/ScriptWrappable.h"
+#include "platform/heap/Handle.h"
+
+namespace blink {
+
+// Each BluetoothGATTCharacteristic exposes its characteristic properties
+// through a BluetoothCharacteristicProperties object. These properties express
+// what operations are valid on the characteristic.
+
scheib 2015/10/20 19:50:35 Remove blank line
ortuno 2015/10/20 23:33:23 Done.
+class BluetoothCharacteristicProperties final
+ : public GarbageCollected<BluetoothCharacteristicProperties>
+ , public ScriptWrappable {
+ DEFINE_WRAPPERTYPEINFO();
+public:
+ static BluetoothCharacteristicProperties* create(uint32_t properties);
+
+ bool broadcast() const { return m_broadcast; }
+ bool read() const { return m_read; }
+ bool writeWithoutResponse() const { return m_writeWithoutResponse; }
+ bool write() const { return m_write; }
+ bool notify() const { return m_notify; }
+ bool indicate() const { return m_indicate; }
+ bool authenticatedSignedWrites() const { return m_authenticatedSignedWrites; }
+ bool reliableWrite() const { return m_reliableWrite; }
+ bool writableAuxiliaries() const { return m_writableAuxiliaries; }
+
+ DEFINE_INLINE_TRACE() { }
+
+private:
+ explicit BluetoothCharacteristicProperties(uint32_t properties);
+
+ enum class Property {
+ NONE = 0,
+ BROADCAST = 1 << 0,
+ READ = 1 << 1,
+ WRITE_WITHOUT_RESPONSE = 1 << 2,
+ WRITE = 1 << 3,
+ NOTIFY = 1 << 4,
+ INDICATE = 1 << 5,
+ AUTHENTICATED_SIGNED_WRITES = 1 << 6,
+ EXTENDED_PROPERTIES = 1 << 7, // Not used in class.
+ RELIABLE_WRITE = 1 << 8,
+ WRITABLE_AUXILIARIES = 1 << 9,
+ };
+
+ bool m_broadcast;
scheib 2015/10/20 19:50:35 Store the single uint32_t 'properties' (4 bytes) a
ortuno 2015/10/20 23:33:24 Done.
+ bool m_read;
+ bool m_writeWithoutResponse;
+ bool m_write;
+ bool m_notify;
+ bool m_indicate;
+ bool m_authenticatedSignedWrites;
+ bool m_reliableWrite;
+ bool m_writableAuxiliaries;
+};
+
+} // namespace blink
+
+#endif // GamepadButton_h

Powered by Google App Engine
This is Rietveld 408576698