# 04-30 Multiple client handling
When IPS servers are discovered, I iterate over their adresses and create a new client instance for each single server object. This object is then stored in a vector.
# Problem:
I cannot read the RSSI of several peer devices using my current code. I can get the RSSI of a single client connection object as often as I want, but it does not work when I try to iterate over more than one object. I got the idea of iterating over client objects from this post by one of the BLEClient developers. He indicates that it should be possible to create a connection object for each server and then use it later for reading values. My code does not work though.
# Solutions
# Task for every client
According to the same dev that wrote the post referenced above, it should be possible to create a task handle for every BLE Client. I do not think it is worth pursuing this though, since chegewara says that the arduino IDE ESP32 core only allows 3 simultaneous connections. If this is the case, then I can just scrap the idea with the BLEClient objects for simultaneous connections. The next solution is based on the implications of this discovery.
# Reconnect every single time.
Since I cannot handle more than three clients at once, I can also just connect, read rssi and disconnect subsequently. Then I do not have to worry about juggling around with BLEClient pointers and it is very likely to work. The reason I didnt go with this was because I thought it wasnt very pretty. But now it seems to be the easiest option.
# Conclusion
I will go ahead with recurrent connect-read-disconnect operations for every server that I have saved. I will be very careful with disconnecting and deallocating memory so that there are no leaks.
# 3D model of case
I also designed a case to hold the battery and esp32 on the stands I constructed yesterday. Here is a screenshot:
