OLD | NEW |
| (Empty) |
1 // Copyright (c) 2012 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 CHROME_BROWSER_CHROMEOS_BLUETOOTH_BLUETOOTH_UTILS_H_ | |
6 #define CHROME_BROWSER_CHROMEOS_BLUETOOTH_BLUETOOTH_UTILS_H_ | |
7 | |
8 #include <string> | |
9 | |
10 #include <bluetooth/bluetooth.h> | |
11 | |
12 namespace chromeos { | |
13 namespace bluetooth_utils { | |
14 | |
15 // Converts a bluetooth address in the format "B0:D0:9C:0F:3A:2D" into a | |
16 // bdaddr_t struct. Returns true on success, false on failure. The contents | |
17 // of |out_address| are zeroed on failure. | |
18 // Note that the order is reversed upon conversion. For example, | |
19 // "B0:D0:9C:0F:3A:2D" -> {"0x2d", "0x3a", "0x0f", "0x9c", "0xd0", "0xb0"} | |
20 bool str2ba(const std::string& in_address, bdaddr_t* out_address); | |
21 | |
22 // Takes a 4, 8 or 36 character UUID, validates it and returns it in 36 | |
23 // character format with all hex digits lower case. If |uuid| is invalid, the | |
24 // empty string is returned. | |
25 // | |
26 // Valid inputs are: | |
27 // XXXX | |
28 // 0xXXXX | |
29 // XXXXXXXX | |
30 // 0xXXXXXXXX | |
31 // XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX | |
32 std::string CanonicalUuid(std::string uuid); | |
33 | |
34 } // namespace bluetooth_utils | |
35 } // namespace chromeos | |
36 | |
37 #endif // CHROME_BROWSER_CHROMEOS_BLUETOOTH_BLUETOOTH_UTILS_H_ | |
38 | |
OLD | NEW |