CAPS Universe documentation  1.0.4
All you need to know to be successful
Callback printer_monitor()

Called, when the framework retrieves the status of the printer. But not always. See below.

  • parameter you get
    • framework handle
    • your private data hint
  • you can expect as already done
    • the printer is still online and can be accessed
  • what you can do
    • everything what is possible with your printer
  • what you must do
    • nothing
  • values you should return
    • 0 everything is okay, the framework can continue
    • -EBUSY if the printer isn't ready to print somehow
    • -ENODEV if something is really bad with your printer and the framework should terminate.
    • -EINVAL if something is wrong with your printer, but can be recovered. If currently a job is processed it will be canceled

libcapsdriver checks the printer status:

Whenever it checks the printer's status, it calls the callback only if it detects a ready printer device.

Note
This call interferes with some of the flags from caps_drv_prn_tweaks if set in your driver. E.g. it could be limited or fully disabled by these flags. Be warned about this.
This callback is optional.