CAPS Universe documentation
1.0.4
All you need to know to be successful
|
USB Printer Device Detection. More...
Functions | |
static int | caps_prn_compare_serial_string (const struct usb_printer *pr, const struct caps_prn_printer_description *desc) |
static int | caps_prn_compare_vendor_id (const struct usb_printer *pr, const struct caps_prn_printer_description *desc) |
static int | caps_prn_compare_product_id (const struct usb_printer *pr, const struct caps_prn_printer_description *desc) |
int | caps_prn_usb_printer_identify (const struct usb_printer *pr, const struct caps_inif_table *db, const char **descr_ini, const char **param_dir) |
int | caps_prn_usb_printer_driver_get (const struct usb_printer *pr, const struct caps_inif_table *db, char **descr_ini) |
int | caps_prn_usb_printer_get_info (struct usb_printer *printer, const char *dnode) |
Routines to recognize a USB printer based on data stored in the CAPS Device Database (Printer Device Database)
|
static |
Check the serial string of the printer device and the database entry
[in] | pr | Information about the connected printer device |
[in] | desc | Information about a printer from the database |
0 | The serial strings match |
-ENODEV | No match |
The serial string is the most important key to recognize an already known printer. If its not available, it will be ignored and the only used keys are VID and PID.
|
static |
Check the USB vendor ID (aka "VID") of the printer device and the database entry
[in] | pr | Information about the connected printer device |
[in] | desc | Information about a printer from the database |
0 | VID in pr and desc matches |
-ENODEV | No match |
|
static |
Check the USB product ID (aka "PID") of the printer device and the database entry
[in] | pr | Information about the connected printer device |
[in] | desc | Information about a printer from the database |
0 | PID in pr and desc matches |
-ENODEV | No match |
int caps_prn_usb_printer_identify | ( | const struct usb_printer * | pr, |
const struct caps_inif_table * | db, | ||
const char ** | descr_ini, | ||
const char ** | param_dir | ||
) |
Identify a USB printer device if it is already known
[in] | pr | The USB printer description |
[in] | db | The run-time device database of currently known printer devices |
[out] | descr_ini | Name of the Printing Provider Description INI File |
[out] | param_dir | Name of the Printer Device Parameter Directory |
0 | On success (descr_ini and param_dir are valid) |
-ENODEV | The requested printer isn't known, yet |
negative | Errno else |
On success this function provides valid descr_ini and param_dir pointers.
int caps_prn_usb_printer_driver_get | ( | const struct usb_printer * | pr, |
const struct caps_inif_table * | db, | ||
char ** | descr_ini | ||
) |
Search for a printer driver for the given USB printer device
[in] | pr | The USB printer device to search for its driver |
[in] | db | Printer driver's database |
[out] | descr_ini | Where to store the pointer to the name of the driver's description INI file (must be freed after use) |
0 | on success *descr_ini is valid |
-ENODEV | No printer driver for the requested printer device found |
negative | -errno else |
Walk trough the printer driver database entries and try to identify the corresponding driver for the given printer dervice.
The printer driver database is organized in levels. Each driver has a new level: It's filename (without the '.ini' extension).
int caps_prn_usb_printer_get_info | ( | struct usb_printer * | printer, |
const char * | dnode | ||
) |
Get the info about a printer, based on its device node
[out] | printer | Where to store the printer's information |
[in] | dnode | Device node in question |
0 | On success |
-EINVAL | USB enumeration failed, USB detection failed |
-ENOENT | dnode seems invalid |