{"record":{"id":"ef0b897e5938f7e6","repo":"AprilNEA/OpenLogi","slug":"dpi-write-failed-requested-target-device-reports-after-which","errorCode":null,"errorMessage":"DPI write failed: requested {target}, device reports {after} which is not in its supported list","messagePattern":"DPI write failed: requested (.+?), device reports (.+?) which is not in its supported list","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/openlogi-cli/src/cmd/diag/dpi.rs","lineNumber":82,"sourceCode":"        .context(\"write DPI\")?;\n\n    let after = openlogi_hid::get_dpi(&route)\n        .await\n        .context(\"read DPI after write\")?;\n    println!(\"  read-back DPI: {after}\");\n\n    // `target` is always a device-reported value, so a mismatch means the\n    // device adjusted it — fine if it landed on another supported value, but a\n    // no-op write (`after == before`) or an off-list read-back is a real fault.\n    // (`target != before` is guaranteed by the early return above.)\n    if after == before {\n        anyhow::bail!(\"DPI write failed: requested {target}, device still reports {before}\");\n    }\n    if after != target {\n        if info.capabilities.contains(after) {\n            println!(\"  note: device snapped {target} → {after}\");\n        } else {\n            anyhow::bail!(\n                \"DPI write failed: requested {target}, device reports {after} \\\n                 which is not in its supported list\"\n            );\n        }\n    }\n\n    println!(\"  restoring DPI: {before}\");\n    openlogi_hid::set_dpi(&route, before)\n        .await\n        .context(\"restore DPI\")?;\n\n    println!(\"✓ DPI round-trip OK\");\n    Ok(())\n}\n\nstruct DpiSummaryDisplay<'a>(&'a DpiCapabilities);\n\nimpl fmt::Display for DpiSummaryDisplay<'_> {","sourceCodeStart":64,"sourceCodeEnd":100,"githubUrl":"https://github.com/AprilNEA/OpenLogi/blob/e846e6f4b4405e33bd6a9aaf949a482ce34cb6d8/crates/openlogi-cli/src/cmd/diag/dpi.rs#L64-L100","documentation":"Round-trip verification failure in `openlogi diag dpi`: after the set_dpi write the device reports a DPI value that is neither the requested target nor any value in its own supported list. The write definitely took effect (read-back differs from the pre-write value) but landed on an off-list value, which is a firmware fault — unlike landing on another supported value, which the diagnostic tolerates with a 'device snapped' note. The CLI bails to flag the device as misbehaving.","triggerScenarios":"Thrown at crates/openlogi-cli/src/cmd/diag/dpi.rs:82 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Power-cycle or re-pair the device and re-run the diagnostic to see whether the snapped value lands on a supported step","Try a different supported --target value; if every write produces off-list results, the device's DPI feature is misreporting its capabilities","Capture the device model/firmware version from `openlogi list` and file it with the report — the advertised capability list disagrees with actual behavior"],"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"}