service_add();//dynamic add service
sd_ble_gatts_sys_attr_set(conn_handle, NULL, 0, BLE_GATTS_SYS_ATTR_FLAG_SYS_SRVCS | BLE_GATTS_SYS_ATTR_FLAG_USR_SRVCS);
sd_ble_gatts_service_changed(conn_handle, service_start, service_end);
I do these steps in on_write() callback.Then sd_ble_gatts_service_changed return NRF_ERROR_INVALID_STATE.Can you tell me how to modify it correctly.Thanks.
Best regards,
Bruce