Home | History | Annotate | Download | only in bluetooth

Lines Matching full:uuid

17 #include "service/common/bluetooth/uuid.h"
33 const UUID::UUID128Bit kSigBaseUUID = {
41 UUID UUID::GetRandom() {
44 return UUID(bytes);
48 UUID UUID::GetNil() {
51 return UUID(bytes);
55 UUID UUID::GetMax() {
58 return UUID(bytes);
61 void UUID::InitializeDefault() {
62 // Initialize to Bluetooth SIG base UUID.
67 UUID::UUID() {
71 UUID::UUID(std::string uuid) {
75 if (uuid.empty())
78 if (uuid.size() < 11 && uuid.find("0x") == 0)
79 uuid = uuid.substr(2);
81 if (uuid.size() != 4 && uuid.size() != 8 && uuid.size() != 36)
84 if (uuid.size() == 36) {
85 if (uuid[8] != '-')
87 if (uuid[13] != '-')
89 if (uuid[18] != '-')
91 if (uuid[23] != '-')
95 uuid, "-", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL);
100 uuid = base::JoinString(tokens, "");
103 const int start_index = uuid.size() == 4 ? 2 : 0;
104 const size_t copy_size = std::min(id_.size(), uuid.size() / 2);
106 std::string octet_text(uuid, i * 2, 2);
116 UUID::UUID(const bt_uuid_t& uuid) {
117 std::reverse_copy(uuid.uu, uuid.uu + sizeof(uuid.uu), id_.begin());
121 UUID::UUID(const UUID16Bit& uuid) {
123 std::copy(uuid.begin(), uuid.end(), id_.begin() + kNumBytes16);
126 UUID::UUID(const UUID32Bit& uuid) {
128 std::copy(uuid.begin(), uuid.end(), id_.begin());
131 UUID::UUID(const UUID128Bit& uuid) : id_(uuid), is_valid_(true) {}
133 UUID::UUID128Bit UUID::GetFullBigEndian() const {
137 UUID::UUID128Bit UUID::GetFullLittleEndian() const {
138 UUID::UUID128Bit ret;
143 bt_uuid_t UUID::GetBlueDroid() const {
149 std::string UUID::ToString() const {
158 size_t UUID::GetShortestRepresentationSize() const {
168 bool UUID::operator<(const UUID& rhs) const {
173 bool UUID::operator==(const UUID& rhs) const {