Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 154050 Details for
Bug 238882
Ink level reporting in the CUPS driver
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
gutenprint-ink-levels.patch
gutenprint-ink-levels.patch (text/plain), 1.88 KB, created by
Tim Waugh
on 2007-05-03 16:46:36 UTC
(
hide
)
Description:
gutenprint-ink-levels.patch
Filename:
MIME Type:
Creator:
Tim Waugh
Created:
2007-05-03 16:46:36 UTC
Size:
1.88 KB
patch
obsolete
>--- gutenprint-5.0.0.99.1/src/cups/commandtoepson.c.ink-levels 2004-07-19 00:26:41.000000000 +0100 >+++ gutenprint-5.0.0.99.1/src/cups/commandtoepson.c 2007-05-03 17:12:28.000000000 +0100 >@@ -60,6 +60,7 @@ > char line[1024], /* Line from file */ > *lineptr; /* Pointer into line */ > int feedpage; /* Feed the page */ >+ int inklevels; > > > /* >@@ -104,6 +105,7 @@ > > pwrite("\033(R\010\000\000REMOTE1", 13); > feedpage = 0; >+ inklevels = 0; > > /* > * Read the commands from the file and send the appropriate commands... >@@ -176,6 +178,7 @@ > */ > > pwrite("IQ\001\000\001", 5); >+ inklevels = 1; > } > else if (strncasecmp(lineptr, "SetAlignment", 12) == 0) > { >@@ -219,6 +222,63 @@ > putchar(12); > } > >+ if (inklevels) >+ { >+ ssize_t got; >+ ssize_t total = 0; >+ char buffer[1024]; >+ char *p; >+ const double timeout = 5.0; >+ double t; >+ int ready = 0; >+ p = buffer; >+ while (!ready) >+ { >+ t = timeout; >+ got = cupsBackChannelRead (p, buffer + sizeof (buffer) - p, t); >+ if (got <= 0) >+ break; >+ >+ total += got; >+ buffer[total] = '\0'; >+ if (strchr (buffer, '\f')) >+ ready = 1; >+ } >+ >+ if (ready) >+ { >+ p = strstr (buffer, "IQ:"); >+ if (p) >+ { >+ const char digits[] = "0123456789abcdef"; >+ int supply_low = 0; >+ int i; >+ p += 3; >+ for (i = 0; i < 4 && p < buffer + total - 1; i++, p += 2) >+ { >+ char *s; >+ int dig1, dig2; >+ int percent; >+ s = strchr (digits, tolower (p[0])); >+ if (!s) >+ break; >+ dig1 = s - digits; >+ s = strchr (digits, tolower (p[1])); >+ if (!s) >+ break; >+ dig2 = s - digits; >+ percent = (dig1 << 4) + dig2; >+ fprintf (stderr, "DEBUG: ink level %d\n", percent); >+ if (percent <= 10) >+ supply_low = 1; >+ } >+ >+ fprintf (stderr, "STATE: %cmarker-supply-low-warning\n", >+ supply_low ? '+' : '-'); >+ } >+ } >+ } >+ > /* > * Reset the printer... > */
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 238882
: 154050