[cups.development] How can i get the printer status such as "media-tray-empty-error" etc

Michael Sweet msweet at apple.com
Tue Apr 7 08:27:13 PDT 2009


This reason needs to be set, either by the driver or the backend. More  
than likely your combination does not set it...

On Apr 6, 2009, at 8:33 PM, Rakesh.vm wrote:

> Hi,
> I wrote a program using CUPS for getting  the "media-tray-empty- 
> error" but it is returning none value.Please help.
>
> Program:
> #include <cups/cups.h>
> int  main()
> {
> 	cups_dest_t *dests;
> 	int i=0,j=0;
> 	const char *value;
> 	int num_dests = cupsGetDests(&dests);
> 	printf ( " The number of Printers available is %d\n", num_dests);
> 	for (j =0;j<num_dests;j++,dests++)
> 	{
> 		cups_dest_t *dest = cupsGetDest(dests->name,
> 			dests->instance,
> 			dests->num_options,
> 			dests);
> 		printf("Printer name is %s\n",dest->name);
> 		for (i = 0; i < dest->num_options; i++)
> 		{
> 			if(NULL!= dest->options)
> 			{
> 				printf("The option name is : %s\n",dest->options[i].name);
> 				printf("The value is : %s\n",dest->options[i].value);
> 			}
> 		}
> 		printf("*********************************************\n");
> 	}
> 	cupsFreeDests((num_dests), dests);
> 	return 0;
> }
>
>
> Output:
> The number of Printers available is 1
> Printer name is printer
> The option name is : printer-info
> The value is : printer
> The option name is : printer-is-accepting-jobs
> The value is : 1
> The option name is : printer-is-shared
> The value is : 1
> The option name is : printer-make-and-model
> The value is : HP LaserJet 4000 Series Postscript (recommended)
> The option name is : printer-state
> The value is : 3
> The option name is : printer-state-change-time
> The value is : 1239031230
>
> *********************************************
> The option name is : printer-state-reasons
> The value is : none
> **********************************************
>
> The option name is : printer-type
> The value is : 168148
>
>
>
>
>
>
> _______________________________________________
> cups-dev mailing list
> cups-dev at easysw.com
> http://lists.easysw.com/mailman/listinfo/cups-dev

________________________________________
Michael R Sweet, Senior Printing System Engineer

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cups.org/pipermail/cups-devel/attachments/20090407/c08702d1/attachment.html>


More information about the cups-devel mailing list