Instead of searching for the service of interest, I tried the following
auto f = leDev.GetGattServicesForUuidAsync(servUuid).get(); // returns a GattDeviceServicesResult
auto g = f.Services().GetAt(0); // There is only one such service on the device that I am using
auto h = g.GetCharacteristicsAsync().get(); // Use the service to obtain all the characteristics of the service
auto j = h.Characteristics(); // Size of j is 0 despite there are 4 services
The way I constructed servUuid
is to use the string that had the service UUID
guid servGUIDstruct = make_guid(servID);
winrt::guid servUuid = reinterpret_cast<winrt::guid&>(servGUIDstruct);
I also tried other ways to obtain a service Uuid, for e.g., enumerating all services and storing the Uuid of the service of interest and then using it in GetGattServicesForUuidAsync
but to see the same issue.
It would be very useful to know what is that I am not doing right, Thanks
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…