Python Forum
Read 2 Value with bleak via BLE notify from ESP32
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Read 2 Value with bleak via BLE notify from ESP32
#1
Hello, when I read out 2 characteristics via Bleak and BLE, via the command:

async def notification_handler(sender, data, callback):
     spo2_value = numpy.frombuffer(data, dtype=numpy.uint32)

     print("Red values:")
     print(spo2_value)

     # Update the label text
     callback(spo2_value)
... and

async def notification_handler(sender, data, callback):
     red_value = numpy.frombuffer(data, dtype=numpy.uint32)

     print("Red values:")
     print(red_value)

     # Update the label text
     callback(red_value)
Then only one is displayed to me, since both have the same name: notification_handler. If I rename it to notification_handler2, for example, the function no longer works. What can I do there?

Link to the library bleak: https://github.com/hbldh/bleak
GitHub
Reply


Messages In This Thread
Read 2 Value with bleak via BLE notify from ESP32 - by Nietzsche - May-02-2023, 12:17 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [ESP32 Micropython]Total noob here, I don't understand why this while loop won't run. wh33t 9 1,834 Feb-28-2023, 07:00 PM
Last Post: buran
  How to continuously receive messages until specified to stop using Bleak jacobbreen25 3 2,243 Dec-28-2022, 04:25 PM
Last Post: jacobbreen25
  Help with bleak - how to send test to BLE device? korenron 1 1,789 Aug-28-2022, 11:28 PM
Last Post: Larz60+
  bleak library RuntimeError: This event loop is already running alice93 3 4,181 Sep-30-2021, 08:06 AM
Last Post: alice93
  Notify when a new file lands in a directory fioranosnake 1 1,939 Jul-16-2020, 12:55 PM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020