common: custom ATTRs aren't supported by CUPS, use PPD attributes instead.

StpUsbBackend, StpUsbVid, StpUsbPid, StpUsbBus, StpUsbPort

plus

  StpMediaID##, StpMediaName##

We can use STATE: reasons or
 ATTR:printer-alert="code=XXX,severity=YYY"
 ATTR:printer-alert-description="textual explanation"
   code=jam,coverOpen,subunitMissing/Full/etc,and so forth...
   severity=warning,critical,other
This commit is contained in:
Solomon Peachy 2021-09-29 23:30:45 -04:00
parent 3d6ff53559
commit e32c652d64

View file

@ -1578,13 +1578,11 @@ bypass:
goto done_claimed;
}
ATTR("org.gutenprint.usb.backend=%s\n", backend_str ? backend_str : backend->name);
ATTR("org.gutenprint.usb.vid=%04x\n", conn.usb_vid);
ATTR("org.gutenprint.usb.pid=%04x\n", conn.usb_pid);
ATTR("org.gutenprint.usb.bus=%03d\n", conn.bus_num);
ATTR("org.gutenprint.usb.port=%03d\n", conn.port_num);
// STATE("+org.gutenprint.attached-to-device\n");
PPD("StpUsbBackend=\"%s\"\n", backend_str ? backend_str : backend->name);
PPD("StpUsbVid=%04x\n", conn.usb_vid);
PPD("StpUsbPid=%04x\n", conn.usb_pid);
PPD("StpUsbBus=%03d\n", conn.bus_num);
PPD("StpUsbPort=%03d\n", conn.port_num);
if (!uri || !strlen(uri)) {
if (backend->cmdline_arg(backend_ctx, argc, argv))
@ -1613,7 +1611,6 @@ done:
backend->teardown(backend_ctx);
else
generic_teardown(backend_ctx);
// STATE("-org.gutenprint.attached-to-device");
}
if (list)
@ -1720,6 +1717,7 @@ minimal:
if (full && getenv("DEVICE_URI")) {
for (i = 0 ; i < marker_count ; i++) {
PPD("StpMediaID%d=%d\n", i, markers[i].numtype);
PPD("StpMediaName%d=\"%s\"\n", i, markers[i].name);
}
}
}