Link between CUPS and HOTPLUG

Michael Sweet mike at easysw.com
Sun Aug 22 04:48:49 PDT 2004


Gustavo Amador wrote:
> Hi there.
> I hope you can help me with this.
> 
> This is the scenario:
> I have a program that is willing to use a printer.
> Somebody plugs a usb-printer and HOTPLUG notifies this event.
> The program receives the event and uses the printer.
> 
> But, what if the printer is not configured?
> How can I know if the printer that has recently plugged is ready for use?
> Is there any way to know if the printer detected by HOTPLUG is configured
> under CUPS?

You need to get the device URI for the printer and then see if any
of the local printers has that URI.  Probably you can run the USB
backend to get the current list of devices and then check them all
against the printer list...

FWIW, we'll have hotplug support in CUPS 1.2 via the new cups-deviced
stuff...

-- 
______________________________________________________________________
Michael Sweet, Easy Software Products           mike at easysw dot com
Printing Software for UNIX                       http://www.easysw.com




More information about the cups-devel mailing list