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


熱門產(chǎn)品 : USB3.0 HUB控制器:CH634

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




Solved the problem.

At first I tried to manually set read and write protection specifically for each characteristic using GATT_PERMIT_AUTHEN_READ, but in my project with this setting the characteristics stopped being read at all, so I did it differently:

I created a flag that is activated during the successful completion of bonding and allows you to read the characteristic only if this flag is present:

image.pngimage.png


So to read characteristics you need always to start bonding which accompanied by passkey entering



只有登錄才能回復(fù),可以選擇微信賬號登錄

国产91精品新入口,国产成人综合网在线播放,九热这里只有精品,本道在线观看,美女视频a美女视频,韩国美女激情视频,日本美女pvp视频