2 // Copyright (C) 2015 Google, Inc.
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at:
8 // http://www.apache.org/licenses/LICENSE-2.0
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
21 #include "hardware/bluetooth.h"
33 typedef std::array<uint8_t, Uuid::kUuid16Octets> Uuid16Bit;
34 typedef std::array<uint8_t, Uuid::kUuid32Octets> Uuid32Bit;
35 typedef std::array<uint8_t, Uuid::kUuid128Octets> Uuid128Bit;
37 // Construct a Bluetooth 'base' UUID.
40 // BlueDroid constructor.
41 explicit Uuid(const bt_uuid_t& uuid);
43 // String constructor. Only hex ASCII accepted.
44 explicit Uuid(const std::string& uuid);
46 // std::array variants constructors.
47 explicit Uuid(const Uuid::Uuid16Bit& uuid);
48 explicit Uuid(const Uuid::Uuid32Bit& uuid);
49 explicit Uuid(const Uuid::Uuid128Bit& uuid);
51 // Provide the full network-byte-ordered blob.
52 const Uuid128Bit GetFullBigEndian() const;
54 // Provide blob in Little endian (BlueDroid expects this).
55 const Uuid128Bit GetFullLittleEndian() const;
57 // Helper for bluedroid LE type.
58 const bt_uuid_t GetBlueDroid() const;
60 bool operator<(const Uuid& rhs) const;
61 bool operator==(const Uuid& rhs) const;
64 void InitializeDefault();
65 // Network-byte-ordered ID.
69 } // namespace bluetooth