Click here to Skip to main content
15,123,367 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
Dear Sirs,

​i'm trying to read ​characteristic Blood Pressure Measurement (0x2A35) of the service Blood Pressure (0x1810) but it give me the follow exception: There is no user session key for the specified logon session.

​Please check my code below, that error occurs when i do the follow command:

C#
var t2 = await characteristic.WriteClientCharacteristicConfigurationDescriptorAsync(

GattClientCharacteristicConfigurationDescriptorValue.Indicate);



IReadOnlyList<gattcharacteristic> characteristicList;
characteristicList = gattService.GetCharacteristics(new Guid(UUID_CHARACTERISTIC_BLOOD_PRESSURE_MEASUREMENT));

if (characteristicList == null) return;
if (characteristicList.Count <= 0) return;

GattCharacteristic characteristic = characteristicList[0];

if (!characteristic.CharacteristicProperties.HasFlag(GattCharacteristicProperties.Indicate)) return;

characteristic.ProtectionLevel = GattProtectionLevel.Plain;

arrayCharacteristics[INDEX_BLOOD_PRESSURE] = characteristic;
characteristic.ValueChanged += bloodPressure_ValueChanged;

var t1 = await characteristic.ReadClientCharacteristicConfigurationDescriptorAsync();
var t2 = await characteristic.WriteClientCharacteristicConfigurationDescriptorAsync(GattClientCharacteristicConfigurationDescriptorValue.Indicate);
var t3 = await characteristic.ReadClientCharacteristicConfigurationDescriptorAsync();


What i'm doing wrong? What the message means?

Thank you a lot.​
Posted
Updated 4-Mar-16 9:51am
v2

1 solution

if this service was an API or Web Service, this message is telling that you don't have a key to access the service.

you can try enter in the service website and ask for an API key
   
Comments
Richard MacCutchan 10-Oct-17 17:51pm
   
TWO years too late.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900