tree: 64aeaa568cb6507c46d7cc68c50489bf37f7808a [path history] [tgz]
  1. cli/
  2. client/
  3. dbus_bindings/
  4. dbus_permissions/
  5. dbus_service/
  6. hwtests/
  7. image_readers/
  8. init/
  9. minijail/
  10. test_images/
  11. tmpfiles.d/
  12. udev/
  13. usb/
  14. BUILD.gn
  15. constants.cc
  16. constants.h
  17. daemon.cc
  18. daemon.h
  19. dbus_service_adaptor.cc
  20. dbus_service_adaptor.h
  21. dbus_service_adaptor_test.cc
  22. debug_log.cc
  23. debug_log.h
  24. debug_log_test.cc
  25. device_tracker.cc
  26. device_tracker.h
  27. device_tracker_test.cc
  28. DIR_METADATA
  29. dlc_client.cc
  30. dlc_client.h
  31. dlc_client_fake.cc
  32. dlc_client_fake.h
  33. dlc_client_test.cc
  34. enums.cc
  35. enums.h
  36. epson_probe.cc
  37. epson_probe.h
  38. firewall_manager.cc
  39. firewall_manager.h
  40. firewall_manager_test.cc
  41. guess_source.cc
  42. guess_source.h
  43. ippusb_device.cc
  44. ippusb_device.h
  45. ippusb_device_test.cc
  46. libsane_wrapper.h
  47. libsane_wrapper_fake.cc
  48. libsane_wrapper_fake.h
  49. libsane_wrapper_impl.cc
  50. libsane_wrapper_impl.h
  51. lorgnette_cli.cc
  52. main.cc
  53. manager.cc
  54. manager.h
  55. manager_test.cc
  56. OWNERS
  57. README.md
  58. sane_client.cc
  59. sane_client.h
  60. sane_client_fake.cc
  61. sane_client_fake.h
  62. sane_client_impl.cc
  63. sane_client_impl.h
  64. sane_client_impl_test.cc
  65. sane_constraint.cc
  66. sane_constraint.h
  67. sane_constraint_test.cc
  68. sane_device.cc
  69. sane_device.h
  70. sane_device_fake.cc
  71. sane_device_fake.h
  72. sane_device_impl.cc
  73. sane_device_impl.h
  74. sane_device_impl_test.cc
  75. sane_option.cc
  76. sane_option.h
  77. sane_option_test.cc
  78. scan_parameters.h
  79. scanner_match.cc
  80. scanner_match.h
  81. scanner_match_test.cc
  82. test_util.cc
  83. test_util.h
  84. test_util_test.cc
  85. uuid_util.cc
  86. uuid_util.h
lorgnette/README.md

Lorgnette

lorgnette provides support for document scanners on Chrome OS.

Overview

lorgnette acts as a Scanner Access Now Easy (SANE) frontend. It exposes a D-Bus API for Chrome or other clients to enumerate scanners, request scanner capabilities, and request scanned pages. Other related components include:

  • sane-backends: SANE libraries and backends.
  • sane-airscan: A SANE backend implementing the Mopria eSCL Scan protocol (see below for more info).
  • ippusb_bridge: Allows eSCL to be used over USB on IPP-USB-capable devices.
  • Scanning support in Chrome handles mDNS resolution and provides the Scan app UI.
  • virtual-usb-printer: A virtual USB printer and scanner that allows testing without a physical device.

Protocols

lorgnette is a SANE frontend, so in theory any USB or network scanner supported by an existing backend may work.

However, the primary supported and tested protocol is Mopria eSCL. The code referenced in this documentation implements the Mopria Alliance eSCL Scan Technical Specification. You may obtain a copy of the Mopria Alliance eSCL Scan Technical Specification directly from the Mopria Alliance by visiting https://mopria.org/mopria-escl-specification.

Device Discovery

For devices discovered through SANE, they are described with a string like

backend:Backend_Specific_String

These will mostly be USB-connected scanners, but some Epson and Canon network devices can be detected. lorgnette does minimal parsing on the returned string to de-duplicate entries for devices that also support eSCL.

Network eSCL devices are discovered through mDNS. lorgnette does not do mDNS probing or resolution; it relies on Chrome's zeroconf support for this. The resulting device description string looks like

airscan:escl:Device Name:https://NNN.NNN.NNN.NNN:PPP/eSCL/

Local USB devices that expose an IPP-USB descriptor are probed for eSCL support on the IPP-USB tunnel. If the device responds, lorgnette generates a device string similar to

ippusb:escl:Device Name:<vid>_<pid>/eSCL/

In this case vid and pid refer to the USB vendor ID and product ID of the device. They are used to look up an ippusb_bridge socket in /run/ippusb for further communication with the device.

Command line

Test images include a lorgnette_cli command-line client that can be used to exercise all of lorgnette's functionality. Note that mDNS resolution is normally done in Chrome, so the scanner lists returned by lorgnette do not normally contain networked eSCL devices in the list. lorgnette_cli simulates this by running airscan-discover. It is possible that the scanner lists will be slightly different from what the UI exposes as a result.