12namespace Systemic::BluetoothLE::Internal
23 bool isSubset(std::vector<T> subset, std::vector<T> superset)
25 std::sort(subset.begin(), subset.end());
26 std::sort(superset.begin(), superset.end());
27 return std::includes(superset.begin(), superset.end(), subset.begin(), subset.end());
37 std::vector<uint8_t> dataBufferToBytesVector(winrt::Windows::Storage::Streams::IBuffer buffer)
39 using namespace winrt::Windows::Storage::Streams;
41 std::vector<uint8_t> outData;
42 outData.resize(buffer.Length());
43 auto reader = DataReader::FromBuffer(buffer);
44 reader.ReadBytes(outData);
55 winrt::Windows::Storage::Streams::IBuffer bytesVectorToDataBuffer(
const std::vector<std::uint8_t>& data)
57 using namespace winrt::Windows::Storage::Streams;
60 DataWriter dataWriter{};
61 dataWriter.ByteOrder(ByteOrder::LittleEndian);
62 dataWriter.WriteBytes(data);
63 return dataWriter.DetachBuffer();