code wiki / (root) / nx_toner_liberate.nx

nx_toner_liberate.nx

buildroot/runtime/nx_toner_liberate.nx

4499 B74 linesdepth 2pulls 3 transitivereach 1 importersview sourcekind librarytopic toner
docsdependenciesstructsconstsfunctions

about

nx_toner_liberate.nx -- S-class "toner liberation": defeat proprietary toner blocking so the operator's OWN aftermarket toner works in their OWN printer. Right-to-repair / interoperability, by construction safe. DOCTRINE (rule #26 NEVER BRICK): liberation uses ONLY non-destructive paths -- (1) the SOVEREIGN PRINT PATH: we drive the printer via open IPP, NOT the vendor driver/app, so the vendor's software-layer "buy genuine" blocking simply does not apply to us. (PROVEN live: the Brother printed job-id 49 to COMPLETION on 3rd-party toner while showing "Replace Toner".) (2) the printer's OWN documented web setting (/general/replacetoner.html) to flip Continue-mode -- a reversible config toggle via the device's validated settings UI, NOT a firmware/EEPROM write. (3) GUIDANCE for the safe physical/front-panel overrides (Continue mode, reset gear, optical window). We NEVER downgrade firmware, NEVER write raw NVRAM/EEPROM, NEVER touch a crypto chip. (The TN-630/660 on the DCP-L2540DW has NO chip anyway -- the block is optical sensor + reset gear + a software counter.) This organ READS a parsed Get-Printer-Attributes response and CLASSIFIES the situation, emitting a sealed verdict + which safe action applies. It performs no I/O itself (pure) -> never-brick. The actual web POST / print is done by the live runners. Sovereign (imports nx_ipp_codec + the audit organs). genealogy_id: project-printer-management-ipp-sclass-2026-06-20 ; license_tier: ORIGINAL

dependencies 3 imports · 1 importers

nx_ipp_codec.nx nx_printer_health.nx nx_printer_waste.nx nx_toner_liberate.nx nx_toner_liberate_test.nx

imports: nx_ipp_codec.nxnx_printer_health.nxnx_printer_waste.nx

imported by: nx_toner_liberate_test.nx

structs

none

consts

24const NX_TL_PRINTS_NOW: i64 = 1 // idle/accepting (maybe toner-warning) -> sovereign IPP prints NOW; vendor block bypassed
25const NX_TL_NEEDS_CONTINUE:i64 = 2 // hard-stopped on toner -> set Continue-mode (web or front panel) then it prints
26const NX_TL_NEEDS_RESET: i64 = 3 // "replace toner" persists on a known-good cart -> reset counter (web/front panel/gear)
27const NX_TL_UNKNOWN: i64 = 4 // can't determine from the response
28const NX_TL_N: i64 = 5

functions

30func nx_tl_verdict_is_valid(v: i64) -> i64
37func nx_toner_liberate(body: *u8, n: i64, scratch: *i64, out_toner_flag: *i64) -> i64