Page 1 of 1

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

Posted: Wed Jul 17, 2019 7:40 pm
by prestonjb
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

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

Posted: Sun Aug 11, 2019 12:46 am
by chegewara
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.