Error Incorrect function HRESULT: 0x80070001 Bluetooth LE development


  • Hey 

    I am doing a Bluetooth LE development for a WP8.1

    I got this error when I am try to access the descriptor of HeartRateMeasurement.

    Code like this

    var currentDeviceCharacteristic = HeartRateService.Instance.Service.GetCharacteristics(GattCharacteristicUuids.HeartRateMeasurement); if(currentDeviceCharacteristic.Count > 0) { var result = await currentDeviceCharacteristic.FirstOrDefault().ReadClientCharacteristicConfigurationDescriptorAsync(); var clientDesc = result.ClientCharacteristicConfigurationDescriptor.ToString();


    var updateResult = await currentDeviceCharacteristic.FirstOrDefault().WriteClientCharacteristicConfigurationDescriptorAsync(GattClientCharacteristicConfigurationDescriptorValue.Notify);


    It fails when is calling WriteClientCharacteristicConfigurationDescriptorAsync method and I get this error message as title.

    Alternatively, I  tried another way to access the descriptor like

    var vector6 = currentDeviceCharacteristic.FirstOrDefault().GetDescriptors(GattDescriptorUuids.ClientCharacteristicConfiguration); if (vector6.Count > 0) { var readResult = await vector6.FirstOrDefault().ReadValueAsync(); if (readResult.Status == GattCommunicationStatus.Success) { byte[] configData = new byte[readResult.Value.Length]; DataReader.FromBuffer(readResult.Value).ReadBytes(configData); if (configData[0] == 0) { configData[0] = 1; var writer = new Windows.Storage.Streams.DataWriter(); writer.WriteBytes(configData); var Ibuffer = writer.DetachBuffer(); var writeResult = await vector6.FirstOrDefault().WriteValueAsync(Ibuffer); } }


    However, when I am trying to write the value of the "Notification" from 0 to 1. as last step. it didnt actually make the change, though I get a return "success".

    I dont know what is the differences between those two way to access, why there is special method just for ClientCharacteristicConfiguration in GattCharacteristic class?

    How can I fix this error? Do I miss some steps somewhere?

    Those API are quite new, hope I can get some help there, and talk to someone who is also develop Bluettoth Le for WP, W8


    Jiajun Qiu

    • Edited by JIAJUN.QIU Friday, September 12, 2014 4:14 PM
    Friday, September 12, 2014 1:17 PM

All replies

  • Refer to see the code sample on MSDN for Bluetooth development of windows phone. http://code.msdn.microsoft.com/windowsapps/.
    Tuesday, September 16, 2014 2:02 AM
  • Hi! Did you solve this problem? I am also trying to write a value to a characteristic with WriteValueAsync but despite the "success" message it doesn't seem to hit the device.

    Do you have any advice?

    Thursday, March 12, 2015 10:55 PM