# RN4020 BLE module authentication without I/O Capabilities and mysterious datasheet

I'm trying to activate authentication for my RN4020 Bluetooth module in a way I dont have to enter PIN or Passcode during this process because my RN4020 wont have any displays or keyboards where to display or enter PIN.

This is what datasheet(table 2-7, page 29) says about it

SR,<hex32>

This command sets the supported features of current RN4020 module. The input parameter is a 32-bit bitmap that indicates features to be supported.

Auto Advertise 0x20000000

Enable Authentication 0x00400000

I/O Capabilities 0x000E0000. I/O capability of the module. Only useful if the Enable Authentication bit is set.

• ‘b000 = Display Only

• ‘b001 = Display Yes/No

• ‘b010 = Keyboard Only

• ‘b011 = No Input, no output

• ‘b100 = Keyboard Display

This is already where the mystery starts because its not said in the datasheet where the (I suppose) binary values for these I/O capabilities are supposed to be in this hex32 number.

First, disable authentication, so that RN4020 won't ask for a Pin code. For the parameter of command "SR", bit 0x00400000 should be cleared.

which is already weird because why would I disable authentication if I'm trying to do it and I/O capabilities are working only if the Enable Authentication bit is set. And next...

On the other hand, declare that RN4020 has no I/O capability, so the peer device won't ask Keyboard I/O authentication. For the parameter of command "SR", the 3 bits 0x000E0000 should be set to 0x00060000 to indicate RN4020 has no I/O capability.

What the number 6 is standing for? And again if authentication is disabled by disabling bits 0x00400000 then these 0x000E0000 I/O capabilities are not supposed to work at all. But mystery is that when I use SR,20060000 it actually works and I can bond devices without using PIN. Can anyone explain this?

• Ohh, tnx a lot man it makes sense - If I want to specify b011 = No Input, no output in place of E I have to use b0110 which is 6 in hex. I have already switched to Bluetooth Classic because of not being able to scan for direct advertisement post Android 6 but this will be very helpful to other people :) – etrusks Jul 26 '18 at 7:29