Difference between "disconnect" and "froget this device"

Dear Nordic

I am programming with nrf52833,ncs v2.9.0 base on sample\peripheral_hid_keyboards

Peripheral side(nrf 52833) adverting as Scanner_CE42,and iphone connect to it.

Then for iphone,there are two ways to disconnect from peripheral

The first way is shut down the bluetooth , such as pic1 ,then peripheral side report disconnected from……(reason 19)

The second way is forget this device , such as pic 2 ,but peripheral side report the same reason 19.

But the difference is the first way only disconnect but not clear the piring info,the second way need clear the pairing info.

If iphone trigger the second way, but peripheral side not trigger bt_unpair to clear the pairing info,the pic 4 will happend when next time bond from the same iphon until peripheral side clear the info.

Do there any way to distinguish the two ways to avoid this problem?

Best regard,

Martin

            pic 1                            pic 2                                      pic 3(peripheral side log)

            pic 4

Related