| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef DEVICE_BLUETOOTH_BLUETOOTH_UUID_H_ | 5 #ifndef DEVICE_BLUETOOTH_BLUETOOTH_UUID_H_ |
| 6 #define DEVICE_BLUETOOTH_BLUETOOTH_UUID_H_ | 6 #define DEVICE_BLUETOOTH_BLUETOOTH_UUID_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "device/bluetooth/bluetooth_export.h" | 10 #include "device/bluetooth/bluetooth_export.h" |
| 11 #include "ipc/ipc_param_traits.h" |
| 12 |
| 13 namespace base { |
| 14 class PickleIterator; |
| 15 } // namespace base |
| 11 | 16 |
| 12 namespace device { | 17 namespace device { |
| 13 | 18 |
| 14 // Opaque wrapper around a Bluetooth UUID. Instances of UUID represent the | 19 // Opaque wrapper around a Bluetooth UUID. Instances of UUID represent the |
| 15 // 128-bit universally unique identifiers (UUIDs) of profiles and attributes | 20 // 128-bit universally unique identifiers (UUIDs) of profiles and attributes |
| 16 // used in Bluetooth based communication, such as a peripheral's services, | 21 // used in Bluetooth based communication, such as a peripheral's services, |
| 17 // characteristics, and characteristic descriptors. An instance are | 22 // characteristics, and characteristic descriptors. An instance are |
| 18 // constructed using a string representing 16, 32, or 128 bit UUID formats. | 23 // constructed using a string representing 16, 32, or 128 bit UUID formats. |
| 19 class DEVICE_BLUETOOTH_EXPORT BluetoothUUID { | 24 class DEVICE_BLUETOOTH_EXPORT BluetoothUUID { |
| 20 public: | 25 public: |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 // The 128-bit string representation of the UUID. | 95 // The 128-bit string representation of the UUID. |
| 91 std::string canonical_value_; | 96 std::string canonical_value_; |
| 92 }; | 97 }; |
| 93 | 98 |
| 94 // This is required by gtest to print a readable output on test failures. | 99 // This is required by gtest to print a readable output on test failures. |
| 95 void DEVICE_BLUETOOTH_EXPORT | 100 void DEVICE_BLUETOOTH_EXPORT |
| 96 PrintTo(const BluetoothUUID& uuid, std::ostream* out); | 101 PrintTo(const BluetoothUUID& uuid, std::ostream* out); |
| 97 | 102 |
| 98 } // namespace device | 103 } // namespace device |
| 99 | 104 |
| 105 namespace IPC { |
| 106 |
| 107 class Message; |
| 108 |
| 109 // Tell the IPC system how to serialize and deserialize a BluetoothUUID. |
| 110 template <> |
| 111 struct DEVICE_BLUETOOTH_EXPORT ParamTraits<device::BluetoothUUID> { |
| 112 typedef device::BluetoothUUID param_type; |
| 113 static void Write(Message* m, const param_type& p); |
| 114 static bool Read(const Message* m, base::PickleIterator* iter, param_type* r); |
| 115 static void Log(const param_type& p, std::string* l); |
| 116 }; |
| 117 |
| 118 } // namespace IPC |
| 119 |
| 100 #endif // DEVICE_BLUETOOTH_BLUETOOTH_UUID_H_ | 120 #endif // DEVICE_BLUETOOTH_BLUETOOTH_UUID_H_ |
| OLD | NEW |