title: UWP app can't get data from heart rate monitor, receiving protocol error
body: <p>I'm trying to make a simple UWP app that displays the value read from a heart rate monitor (Wahoo TICKR FIT). I am able to connect to the monitor, but cannot access the value of the HeartRateMeasurement characteristic. The GattReadResult has a Status of ProtocolError and a Value of null. How do I fix the ProtocolError?</p>
  
  <p>This is all in a plain UWP app using the Visual Studio 2017 template. The plan is to then transfer the working code into a HoloLens project.</p>
  
  <p>Here is the code:</p>
  
  <pre><code>            string btAddr = "F013C3B15603";
              System.UInt64 addrInt = Convert.ToUInt64(btAddr, 16);
  
              BluetoothLEDevice device = await BluetoothLEDevice.FromBluetoothAddressAsync(addrInt);
  
              string guidString = "0000180d-0000-1000-8000-00805f9b34fb"; // Armband HeartRate uuid
              Guid guid = new Guid(guidString);
              GattDeviceService gattService = device.GetGattService(guid);
  
              // Try to access the characteristic we want
              DeviceAccessStatus serviceAccessStatus = await gattService.RequestAccessAsync(); // allowed
              GattOpenStatus openStatus = await gattService.OpenAsync(GattSharingMode.SharedReadAndWrite); // success
              GattCharacteristicsResult results = await gattService.GetCharacteristicsAsync();
              IReadOnlyList&lt;GattCharacteristic&gt; charList = results.Characteristics;
              Debug.WriteLine(charList.Count); // should be 2
              GattCharacteristic heartRateChar = charList[0];
              Debug.WriteLine(heartRateChar.AttributeHandle); // should be 15
  
              // Try to pull the heart rate data
              GattCommunicationStatus commStatus = await heartRateChar.WriteClientCharacteristicConfigurationDescriptorAsync(GattClientCharacteristicConfigurationDescriptorValue.Notify); // This works
              GattReadResult heartRateResult = await heartRateChar.ReadValueAsync(BluetoothCacheMode.Uncached); // Status is ProtocolError (2)
  </code></pre>
  
  <p>The issue appears at the very end, at the ReadValueAsync call.</p>