CH583M Passkey pairing goes wrong

How to properly configure a connection to a device using a passkey? I set the settings when initializing BLE, as indicated in the screenshot. The GAPBOND_PAIRING_MODE_INITIATE mode is set, i.e. at the moment of connection, the device should immediately start bonding proccess and request a connection key on its own, but this does not happen and anyone can just connect, read the characteristics and work with them, for some reason they are not asked for a key and dont start the pairing proccess. 

At the same time, the key that I installed is requested only when trying to manualy establish a bond but only after the connection has been

established, why is that? I tried to connect via smartphone using nrf connect and ble scanner

image.png

When the "GAPBondMgr_SetParameter(GAPBOND_PERI_BONDING_ENABLED, sizeof(uint8), &bonding);" is enabled pairing do not even started and bonding doesnt work.....And its looks like that the pairing proccess starting only after successfull connection when im manualy pressing the bond button in app, how can i fix that?


p.s. 

On some phones everything happens fine and the password is requested immediately at the time of connection, strange




只有登录才能回复,可以选择微信账号登录