DotNet-BlueZ icon indicating copy to clipboard operation
DotNet-BlueZ copied to clipboard

Subscribe to GATT Characteristic Notifications not found

Open esleybonomo opened this issue 2 years ago • 0 comments

Hello guys,

I need make a communication with a fat scale equipment in .Net core, so i need followings:

  • Write in one characterisct with person data (I beleave that its ok for me)
  • And whatch a characterisc with notify.

So, I can't get the notify value. I looked for samples, but I didn't find it. I beleave that I'm doing anything wrong in code.

Look it:

          private async Task GetNotificationBodyFatScaleAsync()
          {
              var characteristic = await LoadCharacteristic(CHARACTERISTIC_MEASURE);
              characteristic.Value += BodyFatScaleDataReceivedAsync;
          }

        private async Task BodyFatScaleDataReceivedAsync(GattCharacteristic sender, GattCharacteristicValueEventArgs eventArgs)
        {
            try
            {
                Console.Out.WriteLine($"Received event from fat scale {eventArgs.Value}");
            }
            catch (Exception ex)
            {
                Console.Error.WriteLine(ex);
            }
        }

I'm following by this one https://github.com/hashtagchris/DotNet-BlueZ#subscribe-to-gatt-characteristic-notifications

Could you help me? Could you send me an example? Or are there any error in lib?

esleybonomo avatar Jul 28 '22 12:07 esleybonomo