Thanks Michael Sweet.<br><br><div class="gmail_quote">On Thu, Jan 27, 2011 at 9:32 PM, Michael Sweet <span dir="ltr"><<a href="mailto:msweet@apple.com">msweet@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">On Jan 27, 2011, at 5:45 AM, Naa Nu wrote:<br>
> Hello,<br>
><br>
> How can i get the Device URI using any CUPS method  or any subscription attribute method.<br>
<br>
</div>The device URI of an existing print queue? Use the IPP_GET_PRINTER_ATTRIBUTES request like so:<br>
<br>
    #include <cups/cups.h><br>
<br>
    const char *printer; /* printer name */<br>
    ipp_t *request, *response;<br>
    ipp_attribute_t *device_uri;<br>
    char printer_uri[1024];<br>
<br>
    httpAssembleURIf(HTTP_URI_CODING_ALL, printer_uri, sizeof(printer_uri), "ipp", NULL, "localhost", 0, "/printers/%s", printer);<br>
<br>
    request = ippNewRequest(IPP_GET_PRINTER_ATTRIBUTES);<br>
    ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, printer_uri);<br>
    ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD, "requested-attributes", NULL, "device-uri");<br>
<br>
    response = cupsDoRequest(CUPS_HTTP_DEFAULT, request, "/");<br>
<br>
    device_uri = ippFindAttribute(response, "device-uri", IPP_TAG_URI);<br>
    /* device-uri string is in device_uri->values[0].string.text */<br>
<br>
________________________________________________________________________<br>
Michael Sweet, Senior Printing System Engineer, PWG Chair<br>
<br>
_______________________________________________<br>
cups-dev mailing list<br>
<a href="mailto:cups-dev@easysw.com">cups-dev@easysw.com</a><br>
<a href="http://lists.easysw.com/mailman/listinfo/cups-dev" target="_blank">http://lists.easysw.com/mailman/listinfo/cups-dev</a><br>
</blockquote></div><br>