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.
5 #ifndef DEVICE_BLUETOOTH_BLUETOOTH_UTILS_H_
6 #define DEVICE_BLUETOOTH_BLUETOOTH_UTILS_H_
10 #if defined(OS_CHROMEOS)
11 #include <bluetooth/bluetooth.h>
15 namespace bluetooth_utils
{
17 #if defined(OS_CHROMEOS)
18 // Converts a bluetooth address in the format "B0:D0:9C:0F:3A:2D" into a
19 // bdaddr_t struct. Returns true on success, false on failure. The contents
20 // of |out_address| are zeroed on failure.
21 // Note that the order is reversed upon conversion. For example,
22 // "B0:D0:9C:0F:3A:2D" -> {"0x2d", "0x3a", "0x0f", "0x9c", "0xd0", "0xb0"}
23 bool str2ba(const std::string
& in_address
, bdaddr_t
* out_address
);
26 // Takes a 4, 8 or 36 character UUID, validates it and returns it in 36
27 // character format with all hex digits lower case. If |uuid| is invalid, the
28 // empty string is returned.
35 // XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
36 std::string
CanonicalUuid(std::string uuid
);
38 } // namespace bluetooth_utils
41 #endif // DEVICE_BLUETOOTH_BLUETOOTH_UTILS_H_