Skip to content

Use printer-specified UserActionTimeout for walkup scan events instead of hardcoded attempts #1543

Description

@manuc66

Description

Is your feature request related to a problem?
Currently, when the application is waiting for user interaction on the printer's physical panel (e.g., selecting a computer destination or confirming a "scan next page" prompt), it uses a hardcoded limit of 50 attempts (approx. 50 seconds).

Waiting for user input (attempt 1 of 50)
Waiting for user input (attempt 2 of 50)
...

This 50-second window is arbitrary. If a user takes longer than 50 seconds to walk to the printer and interact with the screen, the CLI times out and exits, even if the printer is still waiting.

Technical Context

HP printers using the WalkupScanToComp protocol actually communicate their internal timeout via the WalkupScanToCompCaps XML. The field wus:UserActionTimeout specifies the duration (in seconds) that the printer will keep the session active.

Example XML snippet from printer:

<wus:UserActionTimeout>
    <dd:ValueFloat>60</dd:ValueFloat>
    <dd:Unit>seconds</dd:Unit>
</wus:UserActionTimeout>

Proposed Changes

To make the implementation more robust and user-friendly, the following changes are proposed:

  1. Capability Detection: Update WalkupScanToCompCaps to parse the wus:UserActionTimeout field.
  2. Interface Update: Add userActionTimeout to the DeviceCapabilities interface so it's available throughout the scan lifecycle.
  3. Dynamic Wait Logic:
    • Update waitScanRequest (initial connection) to use the printer-specified timeout.
    • Update waitScanNewPageRequest (multi-page scans) to use the same timeout.
  4. Fallback Mechanism: Continue to use the 50-second default if the printer doesn't provide a specific timeout value.

Expected Outcome

The CLI will remain active as long as the printer is waiting, providing a more reliable experience for users who need more than 50 seconds to interact with their device.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions