Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef BluetoothCharacteristicProperties_h | |
| 6 #define BluetoothCharacteristicProperties_h | |
| 7 | |
| 8 #include "bindings/core/v8/ScriptWrappable.h" | |
| 9 #include "platform/heap/Handle.h" | |
| 10 | |
| 11 namespace blink { | |
| 12 | |
| 13 // Each BluetoothGATTCharacteristic exposes its characteristic properties | |
| 14 // through a BluetoothCharacteristicProperties object. These properties express | |
| 15 // what operations are valid on the characteristic. | |
| 16 | |
|
scheib
2015/10/20 19:50:35
Remove blank line
ortuno
2015/10/20 23:33:23
Done.
| |
| 17 class BluetoothCharacteristicProperties final | |
| 18 : public GarbageCollected<BluetoothCharacteristicProperties> | |
| 19 , public ScriptWrappable { | |
| 20 DEFINE_WRAPPERTYPEINFO(); | |
| 21 public: | |
| 22 static BluetoothCharacteristicProperties* create(uint32_t properties); | |
| 23 | |
| 24 bool broadcast() const { return m_broadcast; } | |
| 25 bool read() const { return m_read; } | |
| 26 bool writeWithoutResponse() const { return m_writeWithoutResponse; } | |
| 27 bool write() const { return m_write; } | |
| 28 bool notify() const { return m_notify; } | |
| 29 bool indicate() const { return m_indicate; } | |
| 30 bool authenticatedSignedWrites() const { return m_authenticatedSignedWrites; } | |
| 31 bool reliableWrite() const { return m_reliableWrite; } | |
| 32 bool writableAuxiliaries() const { return m_writableAuxiliaries; } | |
| 33 | |
| 34 DEFINE_INLINE_TRACE() { } | |
| 35 | |
| 36 private: | |
| 37 explicit BluetoothCharacteristicProperties(uint32_t properties); | |
| 38 | |
| 39 enum class Property { | |
| 40 NONE = 0, | |
| 41 BROADCAST = 1 << 0, | |
| 42 READ = 1 << 1, | |
| 43 WRITE_WITHOUT_RESPONSE = 1 << 2, | |
| 44 WRITE = 1 << 3, | |
| 45 NOTIFY = 1 << 4, | |
| 46 INDICATE = 1 << 5, | |
| 47 AUTHENTICATED_SIGNED_WRITES = 1 << 6, | |
| 48 EXTENDED_PROPERTIES = 1 << 7, // Not used in class. | |
| 49 RELIABLE_WRITE = 1 << 8, | |
| 50 WRITABLE_AUXILIARIES = 1 << 9, | |
| 51 }; | |
| 52 | |
| 53 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.
| |
| 54 bool m_read; | |
| 55 bool m_writeWithoutResponse; | |
| 56 bool m_write; | |
| 57 bool m_notify; | |
| 58 bool m_indicate; | |
| 59 bool m_authenticatedSignedWrites; | |
| 60 bool m_reliableWrite; | |
| 61 bool m_writableAuxiliaries; | |
| 62 }; | |
| 63 | |
| 64 } // namespace blink | |
| 65 | |
| 66 #endif // GamepadButton_h | |
| OLD | NEW |