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 #include "config.h" | |
| 6 #include "modules/bluetooth/BluetoothCharacteristicProperties.h" | |
| 7 | |
| 8 namespace blink { | |
| 9 | |
| 10 BluetoothCharacteristicProperties* BluetoothCharacteristicProperties::create(uin t32_t properties) | |
| 11 { | |
| 12 return new BluetoothCharacteristicProperties(properties); | |
| 13 } | |
| 14 | |
| 15 BluetoothCharacteristicProperties::BluetoothCharacteristicProperties(uint32_t pr operties) | |
| 16 : m_broadcast(false) | |
| 17 , m_read(false) | |
| 18 , m_writeWithoutResponse(false) | |
| 19 , m_write(false) | |
| 20 , m_notify(false) | |
| 21 , m_indicate(false) | |
| 22 , m_authenticatedSignedWrites(false) | |
| 23 , m_reliableWrite(false) | |
| 24 , m_writableAuxiliaries(false) | |
| 25 { | |
| 26 ASSERT(properties != static_cast<uint32_t>(Property::NONE)); | |
| 27 | |
| 28 if (properties & static_cast<uint32_t>(Property::BROADCAST)) | |
|
scheib
2015/10/20 19:50:35
The 'enum class' vs 'enum' is requiring you to add
ortuno
2015/10/20 23:33:23
Done.
| |
| 29 m_broadcast = true; | |
| 30 if (properties & static_cast<uint32_t>(Property::READ)) | |
| 31 m_read = true; | |
| 32 if (properties & static_cast<uint32_t>(Property::WRITE_WITHOUT_RESPONSE)) | |
| 33 m_writeWithoutResponse = true; | |
| 34 if (properties & static_cast<uint32_t>(Property::WRITE)) | |
| 35 m_write = true; | |
| 36 if (properties & static_cast<uint32_t>(Property::NOTIFY)) | |
| 37 m_notify = true; | |
| 38 if (properties & static_cast<uint32_t>(Property::INDICATE)) | |
| 39 m_indicate = true; | |
| 40 if (properties & static_cast<uint32_t>(Property::AUTHENTICATED_SIGNED_WRITES )) | |
| 41 m_authenticatedSignedWrites = true; | |
| 42 if (properties & static_cast<uint32_t>(Property::RELIABLE_WRITE)) | |
| 43 m_reliableWrite = true; | |
| 44 if (properties & static_cast<uint32_t>(Property::WRITABLE_AUXILIARIES)) | |
| 45 m_writableAuxiliaries = true; | |
| 46 } | |
| 47 | |
| 48 } // namespace blink | |
| OLD | NEW |