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

WIP : PAPPL Scan API Integration #349

Closed
wants to merge 22 commits into from

Conversation

Kappuccino111
Copy link

Actively updating for solving #130, #131 , #133 , #134.

Copy link
Owner

@michaelrsweet michaelrsweet left a comment

Choose a reason for hiding this comment

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

This isn't a complete implementation.

@Kappuccino111 Kappuccino111 changed the title PAPPL Scan API Integration WIP : PAPPL Scan API Integration Mar 23, 2024
@Kappuccino111
Copy link
Author

Kappuccino111 commented Mar 23, 2024

@michaelrsweet, the implementation is still a work in progress. All updates are regularly posted on the comments in #130

I have now pushed the scanner-accessors.c file. One doubt that I have is that papplSystemAddEvent() is pre-configured for printers, and hence passing a scanner object while using papplScannerResume() or papplScannerPause() creates warnings. Any ideas on how to proceed with this? For now, I am simply debugging to the terminal.

@Kappuccino111 Kappuccino111 marked this pull request as draft March 23, 2024 08:50
@michaelrsweet
Copy link
Owner

@michaelrsweet, the implementation is still a work in progress. All updates are regularly posted on the comments in #130

I have now pushed the scanner-accessors.c file. One doubt that I have is that papplSystemAddEvent() is pre-configured for printers, and hence passing a scanner object while using papplScannerResume() or papplScannerPause() creates warnings. Any ideas on how to proceed with this? For now, I am simply debugging to the terminal.

For now I would add a different version of papplSystemAddEvent that accepts the scanner pointer. Longer term we'll need to do something more coherent, of course, but for now a separate function will do just fine for a first implementation.

Kappuccino111 and others added 3 commits May 29, 2024 21:17
This commit introduces a new file scanner-driver.c that contains the
implementation of functions related to the scanner driver.

Signed-off-by: Akarshan Kapoor <[email protected]>
@Kappuccino111
Copy link
Author

@tillkamppeter 4078698 updates the scanner-driver.c code.

This commit updates Scanner.h to closely follow the Mopria Scan
specifications. We should now have a very detailed implementaion of
scanner.h that closely follows the structure of printer.h while also
following the Mopria Scan specifications.

Signed-off-by: Akarshan Kapoor <[email protected]>
This commit adds some basic features to closely follow
the printer-private.h file. The updated scanner-private.h should be
the final version of this file (for now).

Signed-off-by: Akarshan Kapoor <[email protected]>
- Implemented scanner-specific event handling and introduced new events for scanner operations.
- Added `scanner-escl.c` for eSCL-specific scanner state management.
- Modified `job-process.c`, `job.c`, `printer-accessors.c`, and `scanner-accessors.c` to integrate scanner event functions.
- Updated `system-subscription.c` to support scanner events and added `papplSystemAddScannerEvent`.
- Enhanced `system-private.h` and `subscription.h` with new scanner event types and callback definitions.
- Included necessary changes in `Makefile` and other system-related files for compatibility.

Signed-off-by: Akarshan Kapoor <[email protected]>
This commit updates the Readme and Build files to
include libxml2 as a dependency.

Signed-off-by: Akarshan Kapoor <[email protected]>
This commit finalises the scanner-driver.c file. It includes all the
functions as required for working with scanner-drivers and closely in
line with the printer-driver.c file.

Signed-off-by: Akarshan Kapoor <[email protected]>
This commit finalises the scanner-webif.c file.
It closely follows all aspects of the printer-webif.c file, but
also follows the scan specific requirements.

This commit finalizes the implementation of the scanner web interface
functions, including the following features:

- Added `_papplScannerWebConfig()` to show and handle scanner configuration settings.
- Implemented `_papplScannerWebConfigFinalize()` to save changes to the scanner configuration.
- Developed `_papplScannerWebDefaults()` to display and update default scanning settings.

Signed-off-by: Akarshan Kapoor <[email protected]>
This commit finalises the scanner.c file. It is closely in reference to
the printer.c file, while also covering the necessary details of
eSCL Scanning.

Signed-off-by: Akarshan Kapoor <[email protected]>
scanner->config_time = time(NULL);

//TODO
_papplScannerRegisterDNSSDNoLock(scanner);

Check warning

Code scanning / CodeQL

Expression has no effect Warning

This expression has no effect (because
_papplScannerRegisterDNSSDNoLock
has no external side effects).
scanner->config_time = time(NULL);

// TODO
_papplScannerRegisterDNSSDNoLock(scanner);

Check warning

Code scanning / CodeQL

Expression has no effect Warning

This expression has no effect (because
_papplScannerRegisterDNSSDNoLock
has no external side effects).
if (!value)
_papplScannerUnregisterDNSSDNoLock(scanner);
else
_papplScannerRegisterDNSSDNoLock(scanner);

Check warning

Code scanning / CodeQL

Expression has no effect Warning

This expression has no effect (because
_papplScannerRegisterDNSSDNoLock
has no external side effects).
// Register the DNS-SD service...
_papplRWLockRead(scanner->system);
_papplRWLockRead(scanner);
_papplScannerRegisterDNSSDNoLock(scanner);

Check warning

Code scanning / CodeQL

Expression has no effect Warning

This expression has no effect (because
_papplScannerRegisterDNSSDNoLock
has no external side effects).
@michaelrsweet
Copy link
Owner

Closing for now. This needs to be rebased to PAPPL master (2.0).

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.

2 participants