Added utility methods to handle winrt::guid and nearby::uuid

PiperOrigin-RevId: 509583159
This commit is contained in:
Guogang Li
2023-02-14 11:10:09 -08:00
committed by Copybara-Service
parent 1e229e31c5
commit 7fd2515b4e
5 changed files with 77 additions and 3 deletions
@@ -23,6 +23,7 @@
#include "absl/strings/string_view.h"
#include "internal/platform/byte_array.h"
#include "internal/platform/uuid.h"
#include "winrt/Windows.Foundation.h"
#include "winrt/base.h"
@@ -46,6 +47,14 @@ ByteArray Sha256(absl::string_view input, size_t size);
std::vector<std::string> GetIpv4Addresses();
std::vector<std::string> Get4BytesIpv4Addresses();
// Help methods to convert between Uuid and winrt::guid
Uuid winrt_guid_to_nearby_uuid(const ::winrt::guid& guid);
winrt::guid nearby_uuid_to_winrt_guid(Uuid uuid);
// Check whether Uuid and guid is the same value.
bool is_nearby_uuid_equal_to_winrt_guid(const Uuid& uuid,
const ::winrt::guid& guid);
namespace Constants {
// The Id of the Service Name SDP attribute
const uint16_t SdpServiceNameAttributeId = 0x100;