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" |
| 11 |
10 namespace device { | 12 namespace device { |
11 | 13 |
12 // Opaque wrapper around a Bluetooth UUID. Instances of UUID represent the | 14 // Opaque wrapper around a Bluetooth UUID. Instances of UUID represent the |
13 // 128-bit universally unique identifiers (UUIDs) of profiles and attributes | 15 // 128-bit universally unique identifiers (UUIDs) of profiles and attributes |
14 // used in Bluetooth based communication, such as a peripheral's services, | 16 // used in Bluetooth based communication, such as a peripheral's services, |
15 // characteristics, and characteristic descriptors. An instance are | 17 // characteristics, and characteristic descriptors. An instance are |
16 // constructed using a string representing 16, 32, or 128 bit UUID formats. | 18 // constructed using a string representing 16, 32, or 128 bit UUID formats. |
17 class BluetoothUUID { | 19 class DEVICE_BLUETOOTH_EXPORT BluetoothUUID { |
18 public: | 20 public: |
19 // Possible representation formats used during construction. | 21 // Possible representation formats used during construction. |
20 enum Format { | 22 enum Format { |
21 kFormatInvalid, | 23 kFormatInvalid, |
22 kFormat16Bit, | 24 kFormat16Bit, |
23 kFormat32Bit, | 25 kFormat32Bit, |
24 kFormat128Bit | 26 kFormat128Bit |
25 }; | 27 }; |
26 | 28 |
27 // Single argument constructor. |uuid| can be a 16, 32, or 128 bit UUID | 29 // Single argument constructor. |uuid| can be a 16, 32, or 128 bit UUID |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 // - 32 bit: xxxxxxxx | 85 // - 32 bit: xxxxxxxx |
84 // - 128 bit: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx | 86 // - 128 bit: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx |
85 Format format_; | 87 Format format_; |
86 std::string value_; | 88 std::string value_; |
87 | 89 |
88 // The 128-bit string representation of the UUID. | 90 // The 128-bit string representation of the UUID. |
89 std::string canonical_value_; | 91 std::string canonical_value_; |
90 }; | 92 }; |
91 | 93 |
92 // This is required by gtest to print a readable output on test failures. | 94 // This is required by gtest to print a readable output on test failures. |
93 void PrintTo(const BluetoothUUID& uuid, std::ostream* out); | 95 void DEVICE_BLUETOOTH_EXPORT |
| 96 PrintTo(const BluetoothUUID& uuid, std::ostream* out); |
94 | 97 |
95 } // namespace device | 98 } // namespace device |
96 | 99 |
97 #endif // DEVICE_BLUETOOTH_BLUETOOTH_UUID_H_ | 100 #endif // DEVICE_BLUETOOTH_BLUETOOTH_UUID_H_ |
OLD | NEW |