none
Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)) when write value to BLE RRS feed

  • Question

  • Hi,

    I am trying to write the value to BLE device using Gatt api in a windows store app. I have BLE device name OLP425. I would like to write value 1 to blink the BLE device, But when I am trying to write value it shows me exception like below


    {"Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))"}

    Here my code

     var devices = await DeviceInformation.FindAllAsync(
                    GattDeviceService.GetDeviceSelectorFromUuid(GattServiceUuids.GenericAccess),
                    new string[] { "System.Devices.ContainerId" });

     if (devices.Count > 0)
                {

     //Connect to the service  
                    var accService = await GattDeviceService.FromIdAsync(devices[0].Id);
                    if (accService == null)
                        return;

     var accData = accService.GetCharacteristics(new Guid("00002a00-0000-1000-8000-00805f9b34fb"))[0];

     //Get the ble sbor tag configuration characteristic  
                    var accConfig = accService.GetCharacteristics(new Guid("00002a00-0000-1000-8000-00805f9b34fb"))[0];
                    //Write 1 to start blink ble device  
                    await accConfig.WriteValueAsync((new byte[] { 1 }).AsBuffer());  


    }


    muke

    Saturday, July 26, 2014 1:31 PM

All replies

  • Hi Muke,

    The GenericAccess service is a reserved service for system use, it is available as read only for everyone.  If you move your proprietary characteristic into its own service, you will be allowed to write to it.

    Thanks

    Wednesday, August 6, 2014 7:31 PM