{"record":{"id":"00c11322de8ea67f","repo":"AprilNEA/OpenLogi","slug":"target-target-is-not-in-the-device-reported-dpi-list","errorCode":null,"errorMessage":"target {target} is not in the device-reported DPI list ({})","messagePattern":"target (.+?) is not in the device-reported DPI list \\((.+?)\\)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/openlogi-cli/src/cmd/diag/dpi.rs","lineNumber":42,"sourceCode":"\npub async fn run(args: DpiArgs) -> Result<()> {\n    // 0x2201 AdjustableDpi / 0x2202 ExtendedAdjustableDpi — auto-skip devices\n    // (keyboards) that expose neither. Newer mice ship only 0x2202.\n    let (route, name) = select_device(args.device.as_deref(), &[0x2201, 0x2202]).await?;\n    println!(\"device: {name} ({route})\");\n\n    let info = openlogi_hid::get_dpi_info(&route)\n        .await\n        .context(\"read DPI capabilities\")?;\n    let before = info.current;\n    println!(\"  current DPI: {before}\");\n    println!(\"  supported DPI: {}\", DpiSummaryDisplay(&info.capabilities));\n\n    let target = match args.target {\n        Some(target) => {\n            let target = target.into();\n            if !info.capabilities.contains(target) {\n                anyhow::bail!(\n                    \"target {target} is not in the device-reported DPI list ({})\",\n                    DpiSummaryDisplay(&info.capabilities)\n                );\n            }\n            target\n        }\n        None => info\n            .capabilities\n            .adjacent_test_target(before)\n            .context(\"device reports fewer than two DPI values; pass --target to choose one\")?,\n    };\n    if target == before {\n        println!(\n            \"  target {target} equals current — pick a different --target to exercise the write\"\n        );\n        return Ok(());\n    }\n","sourceCodeStart":24,"sourceCodeEnd":60,"githubUrl":"https://github.com/AprilNEA/OpenLogi/blob/e846e6f4b4405e33bd6a9aaf949a482ce34cb6d8/crates/openlogi-cli/src/cmd/diag/dpi.rs#L24-L60","documentation":"Input validation in `openlogi diag dpi`: the --target DPI value passed by the user is rejected because it is not among the DPI values the device itself reports through its HID++ AdjustableDpi/ExtendedAdjustableDpi feature. Only device-advertised values are valid write targets, and the message includes the full supported list (or a range summary) so the user can pick a valid one. This is a pre-write guard, not a hardware failure.","triggerScenarios":"Thrown at crates/openlogi-cli/src/cmd/diag/dpi.rs:42 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Re-run with a --target value taken from the printed supported DPI list, e.g. --target 1600","Omit --target entirely and let the diagnostic pick an adjacent supported value automatically","If the intended value seems like it should be supported, confirm the device's actual capability list — some firmware advertises only a sparse set of steps"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e846e6f4b4405e33bd6a9aaf949a482ce34cb6d8","analyzedAt":"2026-09-13T03:07:16.451Z","contentChangedAt":"2026-09-13T03:07:16.451Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}