I'm using SDKv12 S132v3 on nRF52 peripheral device. I have characteristic with following security setup:
char_add_params.read_access=SEC_JUST_WORKS;
char_add_params.write_access=SEC_JUST_WORKS;
char_add_params.cccd_write_access=SEC_JUST_WORKS;
Peer manager is configured to support 'Just works' pairing. Everything works ok as long as central requests encryption before attempting to interact with the characteristic.
If I try to for example write the cccd just after connect automatic pairing procedure is triggered and it completes ok but the event which triggered it (in this case cccd write) isn't passed to application code. If I add something like NRF_LOG_DEBUG("EVT: 0x%X\r\n",p_ble_evt->header.evt_id);
to my main on_ble_evt() handler I see following list of event codes:
btle\btle.c:DEBUG:EVT: 0x10 BLE_GAP_EVT_CONNECTED
btle\btle.c:DEBUG:on_ble_evt() BLE_GAP_EVT_CONNECTED
btle\btle.c:DEBUG:EVT: 0x12 BLE_GAP_EVT_CONN_PARAM_UPDATE
btle\btle.c:DEBUG:EVT: 0x12 BLE_GAP_EVT_CONN_PARAM_UPDATE
btle\btle.c:DEBUG:EVT: 0x13 BLE_GAP_EVT_SEC_PARAMS_REQUEST
btle\btle.c:DEBUG:EVT: 0x12 BLE_GAP_EVT_CONN_PARAM_UPDATE
btle\btle.c:DEBUG:EVT: 0x1A BLE_GAP_EVT_AUTH_STATUS
btle\btle.c:DEBUG:EVT: 0x19 BLE_GAP_EVT_CONN_SEC_UPDATE
btle\peer_manager_handler.c:DEBUG:Link secured. Role: 1. conn_handle: 0, Procedure: 1
btle\btle.c:DEBUG:EVT: 0x12 BLE_GAP_EVT_CONN_PARAM_UPDATE
btle\btle.c:DEBUG:EVT: 0x12 BLE_GAP_EVT_CONN_PARAM_UPDATE
btle\btle.c:DEBUG:EVT: 0x12 BLE_GAP_EVT_CONN_PARAM_UPDATE
As you can see event 0x50 BLE_GATTS_EVT_WRITE which triggered the data exchange is missing
Same is true for characteristic value read/write. Operations following the missing event are processed fine. Please advise me what I'm doing wrong.