Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding support to PAPPL for converting non-eSCL scanners to eSCL Servers #249

Closed
wants to merge 52 commits into from

Conversation

Kappuccino111
Copy link

@tillkamppeter @michaelrsweet This is an update on the documentation aspect of scanning in PAPPL. The document generation was done using code-doc. Also additional changes have been made in pappl-body.md to update the scanning implementation. With this now we have a clear insight on the issue #130 and the changes that are to be implemented.

@@ -6,7 +6,7 @@
// Licensed under Apache License v2.0. See the file "LICENSE" for more
// information.
//

extern char **environ;
#ifndef _PAPPL_BASE_PRIVATE_H_
Copy link
Contributor

@tillkamppeter tillkamppeter Feb 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why that? (move extern char **environ;)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tillkamppeter I have now moved it to the correct place.

# define O_BINARY 0 // I hate Windows...
# endif // _WIN32


//
// @private@
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why that?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tillkamppeter the @ private @ is a feature in code-doc to preventing comment logging of specific functions which are not required in the docs. This prevents functions from being logged in the documentation.



pappl_sc_options_t * // O - Job options data or `NULL` on error
papplJobCreatescanOptions(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

papplJobCreateScanOptions(
              ^ Upper Case!

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tillkamppeter fixed it.

unsigned num_pages, // I - Number of pages (`0` for unknown)
bool color) // I - Is the document in color?
{
pappl_sc_options_t *options; // New options data
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please check all options and choices here. Do they really all make sense with a scanner?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please also check the eSCL standard. Which options and choices are available there?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tillkamppeter some eSCL aspects are missing or need re-structuring. At the moment the base implementation is done and this will be updated in the near future as we will be having more dependencies later on.

@Kappuccino111
Copy link
Author

@tillkamppeter, the base line implementation of xml-parser has now been pushed as xml-parser.c

@Kappuccino111
Copy link
Author

@tillkamppeter , I have updated the repository with my current implementation. Could you please check through it.

@Kappuccino111 Kappuccino111 changed the title Updating the scanning implementations using codedoc Converting non-eSCL scanners to eSCL Servers Jul 9, 2023
@Kappuccino111 Kappuccino111 changed the title Converting non-eSCL scanners to eSCL Servers Adding support to PAPPL for converting non-eSCL scanners to eSCL Servers Jul 9, 2023
@Kappuccino111
Copy link
Author

Kappuccino111 commented Jul 9, 2023

@michaelrsweet @tillkamppeter ...
Here is the update on my progress so far:

  1. The client requests the scanner’s ScannerCapabilities document by sending an HTTP GET request to the PAPPL scanner URL.
  2. We respond by sending the scanner capabilities document. Currently, we are using a dummy driver setup that has the Scanner Properties already in the form of an XML document. In the future, these will be acquired from the scanner on server start.
  3. Based on the information in the ScannerCapabilities XML document, the client creates a ScanSettings XML document and uses an HTTP POST request to send it to the Scanner URI, appended with "ScanJobs".
  4. We read the POST request, extract the information, and store them in different variables.

The extraction and storage aspects of the job variables are implemented in escl-ops.c, while the GET-POST handling is handled by the papplClientProcessHTTP() function located in client.c. The dummy files are housed in the "Dummy Driver" folder.

At this juncture, we will transition to the scan job creation phase. Can we discuss my implementation so far, so I can proceed to generate scan job tickets accordingly?

This discussion is crucial, as it establishes the foundation for client-server interaction. It will also necessitate the elimination of some redundant code from previous phases.

pappl/client.c Outdated
// Copyright © 2019-2022 by Michael R Sweet.
// Copyright © 2010-2019 by Apple Inc.
// Copyright \u00a9\u00a02019-2022 by Michael R Sweet.
// Copyright \u00a9 2010-2019 by Apple Inc.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here (and at many other places in your code) seems to be a problem with UTF-8 character encoding. Please check.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tillkamppeter I have updated this in 7f1922c .

@@ -1,7 +1,7 @@
//
// Core client web interface functions for the Printer Application Framework
//
// Copyright © 2019-2022 by Michael R Sweet.
// Copyright © 2019-2022 by Michael R Sweet.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks strange. What happened here?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I had to reformat the file and hence we are getting the above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants