Electronic – How to prevent new pairings on an RN42 bluetooth module

bluetooth

I'm working with an RN42 bluetooth module and trying to change the settings so that it doesn't accept any new device pairings. According to the command sheet, the command SX,1 should enable bonding which the user guide describe as telling the device to only accept connections from already paired devices.

I've tried the following command sequence in order to try to get this to work.

  • Factory reset (SF,1)
  • Reboot (R,1)
  • Clear all remote addresses (SR,Z)
  • Set bonding to enabled (SX,1)
  • Reboot (R,1)
  • Verify settings (D)

At this point, I am still able to pair devices with the module even though there shouldn't be any remote addresses stored and bonding is enabled. I've read through all of the commands and notes and can't seem to figure this out. My assumption is that I'm misunderstanding the bonding functionality. My end goal is to be able to pair a few devices with the module and then prevent connections from devices that weren't previously paired. Answers, ideas, or suggestions? Thanks in advance.

Best Answer

As long as the firmware version is high enough, you can set it into Quiet Mode 2 (command: q,2) so that it becomes connectable but not discoverable. This won't make it impossible for others to pair with, but they need to know the MAC address in order to do so.

Another possibility is to have an attached MCU examine the incoming MAC address and, if it is an undesirable, reject it and drop the connection.