Any way to disable auto-pairing of HC-05 Bluetooth Modules?

Hey all,

I recently was able to program two arduino's and 2 HC-05 devices to turn on and off and enter AT mode so I can send in commands programatically. The issue I'm running in to is that I have a command to to link the two modules (which worked great), and one to disconnect/unpair them. The unpairing command has these lines on the master module:

BTserial.write("AT+RMAAD\r\n"); //To remove authenticated pairs
BTserial.write("AT+DISC\r\n"); //To disconnect
BTserial.write("AT+INQC\r\n"); //To cancel inquiry mode

However, after a couple seconds, the two modules end up re-pairing again.

Is there any way to disable the master modules auto-pairing tendencies?

Thank you in advance!

I don't have any experience with these but you could try periodically sending one of those commands (I don't know which). If the couple seconds is a timeout duration then maybe it will be reset every time the command is reached. If the couple seconds is the amount of time to pair then maybe it will cancel the pairing process and have to start over again.

These are waters none too-well charted. I can understand an unpair command but don't know how there can be an AT command to disconnect since bluetooth surely has to be disconnected in order to act on it.
I would have thought the best option to disconnect would be by disconnecting the power. That has a nice sense of finality about it, but I can see the problem of what happens when power is re-applied, and clearly you need to ensure you do so in AT mode. The two second window you allude to could be to ensure that.,

Thanks for the input, both!

I actually figured it out. I use RMAAD to clear the list of remote devices, then also link and bind with MAC address 0000,00,000000 and it prevents re-pairing!

CMODE is also 1.