user46715: Basically, I want to connect the HC-05 to a specific mobile Bluetooth(whose address is known) and when the connection is established I want to turn on a LED on the breadboard. 
I am totally clueless how to write the code. Can you please help me with it as it is a part of my project. 
I know the various AT commands and have scanned the Bluetooth address with AT+INQ command.

user45674: If you are using an Arduino board with HC-05 for AT commands over serial, you can follow the below flow :

Setup HC-05
Check for available nearby devices AT+IRQ
Check the response to check is the desired device is enlisted in the nearby devices
If device is enlisted, use AT+BIND=<Bluetooth address> to connect to the other device
Check the response of the AT+STATE? command until you receive “CONNECTED” (you can go for a while loop here)
Once the connection is successfully established here, you can send a confirmation now as per your requirement.

The above scenario is applicable only when you are sure with the Bluetooth address of the device you want to connect to. If the scenario is something different, comment and let us know with the actual requirement.

46715: <p>Basically, I want to connect the HC-05 to a specific mobile Bluetooth(whose address is known) and when the connection is established I want to turn on a LED on the breadboard. 
I am totally clueless how to write the code. Can you please help me with it as it is a part of my project. </p>

<p>I know the various AT commands and have scanned the Bluetooth address with AT+INQ command.</p>
 45674: <p>If you are using an Arduino board with HC-05 for AT commands over serial, you can follow the below flow :</p>

<ol>
<li>Setup HC-05</li>
<li>Check for available nearby devices <code>AT+IRQ</code></li>
<li>Check the response to check is the desired device is enlisted in the nearby devices</li>
<li>If device is enlisted, use <code>AT+BIND=&lt;Bluetooth address&gt;</code> to connect to the other device</li>
<li>Check the response of the <code>AT+STATE?</code> command until you receive “CONNECTED” (you can go for a while loop here)</li>
<li>Once the connection is successfully established here, you can send a confirmation now as per your requirement.</li>
</ol>

<p>The above scenario is applicable only when you are sure with the Bluetooth address of the device you want to connect to. If the scenario is something different, comment and let us know with the actual requirement.</p>
