I successfully implemented on the NUS example the Pairing with the Passkey with the following Peer Manager configuration without LESC.
#define SEC_PARAM_BOND 1 // ** Perform bonding.
#define SEC_PARAM_MITM 1 // ** Man In The Middle protection required (applicable when display module is detected).
#define SEC_PARAM_LESC 0 // ** LE Secure Connections enabled.
#define SEC_PARAM_KEYPRESS 0 // ** Keypress notifications not enabled.
#define SEC_PARAM_IO_CAPABILITIES BLE_GAP_IO_CAPS_DISPLAY_ONLY // ** Display I/O capabilities.
#define SEC_PARAM_OOB 0 // ** Out Of Band data not available.
#define SEC_PARAM_MIN_KEY_SIZE 7 // ** Minimum encryption key size.
#define SEC_PARAM_MAX_KEY_SIZE 16 // ** Maximum encryption key size.
#define PASSKEY_TXT "Passkey:" // ** Message to be displayed together with the pass-key.
#define PASSKEY_TXT_LENGTH 8 // ** Length of message to be displayed together with the pass-key.
#define PASSKEY_LENGTH 6 // ** Length of pass-key received by the stack for display.
static pm_peer_id_t m_peer_to_be_deleted = PM_PEER_ID_INVALID;
and the BLE EVENT:
uint_8 passkey  = "123456"
// Set Passkey into SoftDevice
ble_opt.gap_opt.passkey.p_passkey = &passkey;
err_code = sd_ble_opt_set(BLE_GAP_OPT_PASSKEY, &ble_opt);
// Print out Passkey
printf ("Static Passkey: %s\r\n", passkey);
Apparently everything works fine as long as in the Mobile APP (BluePunch) the user is NOT fast enough to press on READ characteristic.
What I mean is that if you are fast enough to press "Cancel" while the PIN popup request shows you are still able to get into the Read and Write Characteristic and you can successfully read and change whatever you need.
If you let the APP going without pressing the button and such it will raise the timeout and everything seems to be working as expected.
Does anybody faced this issue before?
I am using a Samsung S10 but I think this critical issue is widely spread on other devices too.
I hope that somebody will come up with some asnwers...
Did you configure the characteristic to require encryption/authentication?
I tested also the Glucose Meter service Sample Application which is a fully features example and the problem is there too.
If you try to use an iOS device the device disconnect from central correctly.
Exactly which characteristics are you trying to read/write when you tested the GLS example?