--- /dev/null
+# Make the printer display a message
+{
+ # The name of the test...
+ NAME "Identify Printer with Message"
+
+ # The operation to use
+ OPERATION Identify-Printer
+
+ # Attributes, starting in the operation group...
+ GROUP operation-attributes-tag
+ ATTR charset attributes-charset utf-8
+ ATTR language attributes-natural-language en
+ ATTR uri printer-uri $uri
+ ATTR name requesting-user-name $user
+ ATTR keyword identify-actions display
+ ATTR text message "Hello\, World!"
+
+ # What statuses are OK?
+ STATUS successful-ok
+ STATUS successful-ok-ignored-or-substituted-attributes
+}
--- /dev/null
+# Make the printer display a message and beep
+{
+ # The name of the test...
+ NAME "Identify Printer with Message and Beep"
+
+ # The operation to use
+ OPERATION Identify-Printer
+
+ # Attributes, starting in the operation group...
+ GROUP operation-attributes-tag
+ ATTR charset attributes-charset utf-8
+ ATTR language attributes-natural-language en
+ ATTR uri printer-uri $uri
+ ATTR name requesting-user-name $user
+ ATTR keyword identify-actions sound,display
+ ATTR text message "Hello\, World!"
+
+ # What statuses are OK?
+ STATUS successful-ok
+ STATUS successful-ok-ignored-or-substituted-attributes
+}
ipp_identify_printer(
_ipp_client_t *client) /* I - Client */
{
- /* TODO: Do something */
+ ipp_attribute_t *actions, /* identify-actions */
+ *message; /* message */
+
+
+ actions = ippFindAttribute(client->request, "identify-actions", IPP_TAG_KEYWORD);
+ message = ippFindAttribute(client->request, "message", IPP_TAG_TEXT);
+
+ if (!actions || ippContainsString(actions, "sound"))
+ {
+ putchar(0x07);
+ fflush(stdout);
+ }
+
+ if (ippContainsString(actions, "display"))
+ printf("IDENTIFY from %s: %s\n", client->hostname, message ? ippGetString(message, 0, NULL) : "No message supplied");
respond_ipp(client, IPP_STATUS_OK, NULL);
}