Repository navigation
Improve printer discovery and device identification - #496
Open
SinghCod3r wants to merge 5 commits into
Open
SinghCod3r wants to merge 5 commits into
SinghCod3r wants to merge 5 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Improve printer discovery and device identification by:
PhysicalDeviceidentification for driverless IPP/IPP-over-USB devices when CUPS provides empty MFG/MDL fieldsusb_SER-based suppression of legacy USB devices when an IPP-over-USB counterpart is discoveredChanges
1. Separate DNS-SD and Legacy network printers
Network printers can be discovered through different CUPS backends and discovery mechanisms.
DNS-SD/driverless discovery normally provides symbolic service URIs, while SNMP and other legacy discovery mechanisms can provide literal IPv4/IPv6 addresses.
The New Printer GUI now separates automatically discovered network printers into:
The classification is based on the discovered device URI:
bjnp://→ Legacybluetooth://→ Legacydnssd:///mdns://→ DNS-SDSNMP remains enabled in automatic discovery.
This avoids treating the same printer discovery mechanisms as the same device merely because they may resolve to the same IP address.
CUPS backend identifiers such as
ipp,ipps,socket,lpd,http,https,beh, etc. are also filtered out when they are returned without an actual printer URI. This prevents entries such asUnknownfrom appearing in the automatic discovery list.2. Improve driverless IPP device identification
Some driverless IPP and IPP-over-USB devices are returned by CUPS with an
id_dictcontaining empty MFG and MDL fields.Previously this could result in an empty canonical manufacturer/model pair and poor or missing device labels.
PhysicalDevice._canonical_id()now falls back to:device.make_and_modeldevice.infowhen MFG/MDL do not provide usable information.
PhysicalDevice.get_info()also falls back to the original device information when no PPD/IPP translation is available.This keeps the existing behavior for devices that already provide valid MFG/MDL information.
3. Preserve legacy USB / IPP-over-USB suppression
The existing serial-based suppression mechanism is unchanged.
When modern
ipp-usbadvertises:the existing system-config-printer discovery code can match that serial against the legacy
usb://device and suppress the duplicate legacy USB entry.This was verified end-to-end using the Xerox B235 go-mfp simulator.
With:
the New Printer GUI displayed only:
and the legacy:
was suppressed.
The duplicate seen with Ubuntu's
ipp-usb 0.9.24was caused by that version not advertisingusb_SER. No workaround or additional matching logic was added to system-config-printer.Tests
Targeted test suite:
Result:
Additional checks:
Result:
The tests cover:
usb_SERadd_devices()/ipp_usb_serials()/ suppression behaviorScope
The changes intentionally do not:
/var/ipp-usb/dev/*.stateusb_SERsuppression architecturednssdresolve.pyunnecessarilyThe goal is to keep printer discovery predictable and avoid duplicate or misleading entries while making driverless device identification more robust.