Hello,
Using nRF5 SDK v15.3.0 Peer Manager drops Service Changed indications if an ATT MTU exchange is in progress, this hapens because function service_changed_cccd() in gatt_cache_manager.c allways returns NRF_ERROR_NOT_FOUND.
static ret_code_t service_changed_cccd(uint16_t conn_handle, uint16_t * p_cccd) { bool sc_found = false; uint16_t end_handle; ret_code_t err_code = sd_ble_gatts_initial_user_handle_get(&end_handle); ASSERT(err_code == NRF_SUCCESS); for (uint16_t handle = 1; handle < end_handle; handle++) { uint16_t uuid; ble_gatts_value_t value = {.p_value = (uint8_t *)&uuid, .len = 2, .offset = 0}; err_code = sd_ble_gatts_value_get(conn_handle, handle, &value); if (err_code != NRF_SUCCESS) { return err_code; } else if (!sc_found && (uuid == BLE_UUID_GATT_CHARACTERISTIC_SERVICE_CHANGED)) { sc_found = true; } else if (sc_found && (uuid == BLE_UUID_DESCRIPTOR_CLIENT_CHAR_CONFIG)) { value.p_value = (uint8_t *)p_cccd; return sd_ble_gatts_value_get(conn_handle, ++handle, &value); } } return NRF_ERROR_NOT_FOUND; }
After some digging I found, as far as I understand, that sd_ble_gatts_value_get used in service_changed_cccd() returns handle value which is UUID only for service handles, but for characteristic handles UUID not stored as value.
Is there an other way how to find service changed cccd?
Maybe it is allways last handle before user handles?
Or handle associated with service changed cccd is allways the same and we can simply check if it exists?
Thank You!