Support for BLE peripheral (server) to support multiple clients (phones) simultaniously

prestonjb
Posts: 1
Joined: Wed Jul 17, 2019 7:30 pm

Support for BLE peripheral (server) to support multiple clients (phones) simultaniously

Postby prestonjb » Wed Jul 17, 2019 7:40 pm

I have some basic knowledge of ESP32 but wanted to ask before I code and find out it cant be done.

What I want to do is to write code so that the ESP32 would advertise (continuously, may have to restart but yea) so that after a phone connects then a second and third phone would be able to find and connect to the module.

If the connection services would allow that then I would hope that I could on the characteristic read callback that I would get information about who just read from me (mac address or handle) so that I would know who just did the read and therefore be able to track them.

Then on writes, I would use a table of who is connected, their status/state, and be able to change the characteristic and do a notify-change only to that mac address so that phone would get the notification and read the changed characteristic.

Do you think ESP-32 can do this? Does the ESP32-IDF code already have support for this?

Thanks,
John

chegewara
Posts: 2364
Joined: Wed Jun 14, 2017 9:00 pm

Re: Support for BLE peripheral (server) to support multiple clients (phones) simultaniously

Postby chegewara » Sun Aug 11, 2019 12:46 am

Yes, you can do it.
You can get information about peer device who is reading characteristic from event:
https://docs.espressif.com/projects/esp ... evt_paramE

Then you can modify characteristic value before you send response.

Who is online

Users browsing this forum: No registered users and 110 guests