CUPS error states

Bawenang benang at cs.its.ac.id
Tue Dec 5 22:33:40 PST 2006


Hi, I'm planning to make an application that can print a file. Because the application runs in realtime, I needed it to handle the printer error such as:
1. Printer turned off
2. Printer out of paper
3. Printer out of ink
4. Cannot detect printer
5. Paper printed but stuck inside the printer

When I consulted the CUPS Programming, I found these constants:

Job States

The job state values are used to represent the current job state.

* IPP_JOB_PENDING - Job is pending
* IPP_JOB_HELD - Job is held
* IPP_JOB_PROCESSING - Job is processing
* IPP_JOB_STOPPED - Job is stopped
* IPP_JOB_CANCELLED - Job is cancelled
* IPP_JOB_ABORTED - Job is aborted
* IPP_JOB_COMPLETED - Job is completed

Printer States

The printer state values are used to represent the current printer state.

* IPP_PRINTER_IDLE - Printer is idle
* IPP_PRINTER_PROCESSING - Printer is processing
* IPP_PRINTER_STOPPED - Printer is stopped
Status Codes

Status codes are returned by all IPP requests.

* IPP_OK - Request completed with no errors
* IPP_OK_SUBST - Request completed but some attribute values were substituted
* IPP_OK_CONFLICT - Request completed but some attributes conflicted
* IPP_BAD_REQUEST - The request was bad
* IPP_FORBIDDEN - You don't have access to the resource
* IPP_NOT_AUTHENTICATED - You are not authenticated for the resource
* IPP_NOT_AUTHORIZED - You not authorized to access the resource
* IPP_NOT_POSSIBLE - The requested operation cannot be completed
* IPP_TIMEOUT - A timeout occurred
* IPP_NOT_FOUND - The resource was not found
* IPP_GONE - The resource has gone away
* IPP_REQUEST_ENTITY - The request was too large
* IPP_REQUEST_VALUE - The request contained a value that was unknown to the server
* IPP_DOCUMENT_FORMAT - The document format is not supported by the server
* IPP_ATTRIBUTES - Required attributes are missing
* IPP_URI_SCHEME - The URI scheme is not supported
* IPP_CHARSET - The charset is not supported
* IPP_CONFLICT - One or more attributes conflict
* IPP_COMPRESSION_NOT_SUPPORTED - The specified compression is not supported
* IPP_COMPRESSION_ERROR - The compressed data contained an error
* IPP_DOCUMENT_FORMAT_ERROR - The document data contained an error in it
* IPP_DOCUMENT_ACCESS_ERROR - The remote document could not be accessed
* IPP_INTERNAL_ERROR - The server encountered an internal error
* IPP_OPERATION_NOT_SUPPORTED - The requested operation is not supported
* IPP_SERVICE_UNAVAILABLE - The requested service is unavailable
* IPP_VERSION_NOT_SUPPORTED - The IPP request version is not supported
* IPP_DEVICE_ERROR - The output device encountered an error
* IPP_TEMPORARY_ERROR - A temporary error occurred
* IPP_NOT_ACCEPTING - The destination is not accepting jobs
* IPP_PRINTER_BUSY - The destination is busy
* IPP_ERROR_JOB_CANCELLED - The requested job has been cancelled
* IPP_MULTIPLE_JOBS_NOT_SUPPORTED - The server does not support multiple jobs

My question is: how can I handle those 5 errors above with CUPS? As I see it, there's no straightforward way to check whether a printer is out of paper or ink. So I guess I have to make another way.

Thanks in advance.




More information about the cups mailing list