10namespace Systemic::BluetoothLE::Internal
21 bool isSubset(std::vector<T> subset, std::vector<T> superset)
23 std::sort(subset.begin(), subset.end());
24 std::sort(superset.begin(), superset.end());
25 return std::includes(superset.begin(), superset.end(), subset.begin(), subset.end());
29 bool isOverlapping(
const std::vector<T>& v0,
const std::vector<T>& v1)
31 return std::find_first_of(v0.begin(), v0.end(), v1.begin(), v1.end()) != v0.end();
41 std::vector<uint8_t> dataBufferToBytesVector(winrt::Windows::Storage::Streams::IBuffer buffer)
43 using namespace winrt::Windows::Storage::Streams;
45 std::vector<uint8_t> outData;
46 outData.resize(buffer.Length());
47 auto reader = DataReader::FromBuffer(buffer);
48 reader.ReadBytes(outData);
59 winrt::Windows::Storage::Streams::IBuffer bytesVectorToDataBuffer(
const std::vector<std::uint8_t>& data)
61 using namespace winrt::Windows::Storage::Streams;
64 DataWriter dataWriter{};
65 dataWriter.ByteOrder(ByteOrder::LittleEndian);
66 dataWriter.WriteBytes(data);
67 return dataWriter.DetachBuffer();