I want to find all the Bluetooth addresses of connected devices using an HC-05/HC-06 Bluetooth module and an Arduino. I can't find any code related to this. Basically I need the addresses to put in an array. Is it possible to do this with an HC-05 or 06?
The HC-05 has an AT command,
AT+BIND?, that will tell you which slave device it is connected with currently. Since you can connect to one device only at the same time, your array is going to be a very short one.
AT+INQ will provide you with a list of nearby devices, to which it can connect.
You just have to send the above Bluetooth command via serial port to your Bluetooth module using print command.
yourserial.print("AT+INQ"); if you are using SoftwareSerial. Otherwise just use
Serial.print("AT+INQ"); when using Rx/Tx pins. That will do the job.