Go to file
openharmony_ci a6a784faa9
!42 获取usb interface异常
Merge pull request !42 from 包泽伟/master
2024-10-15 06:10:49 +00:00
backport-Also-fix-cupsfilter.patch fix master failed 2022-06-15 17:23:07 +08:00
backport-CVE-2022-26691.patch fix CVE-2022-26691 2022-06-10 16:56:36 +08:00
backport-CVE-2023-4504.patch 增加新的patch Signed-off-by:zhengzhihao3@huawei.com 2024-06-01 12:11:40 +08:00
backport-CVE-2023-32324.patch fix CVE-2023-32324 2023-06-05 16:22:29 +08:00
backport-CVE-2023-34241.patch fix CVE-2023-34241 2023-06-28 14:32:26 +08:00
backport-CVE-2024-35235.patch fix CVE-2024-35235 Signed-off-by:caizihua1@huawei.com 2024-07-11 16:50:34 +08:00
backport-Remove-legacy-code-for-RIP_MAX_CACHE-environment-variable.patch fix master failed 2022-06-15 17:23:07 +08:00
BUILD.gn usbmanager patch Signed-off-by:baozewei@huawei.com 2024-08-15 23:55:46 +08:00
bundle.json usbmanager patch Signed-off-by:baozewei@huawei.com 2024-08-15 23:55:46 +08:00
config.h oh usb print patch Signed-off-by:baozewei@huawei.com 2024-08-16 10:21:21 +08:00
cups-2.4.0-source.tar.gz upgrade to cups-2.4.0 2021-12-09 20:24:57 +08:00
cups-banners.patch Package init 2019-09-30 10:36:23 -04:00
cups-direct-usb.patch Package init 2019-09-30 10:36:23 -04:00
cups-driverd-timeout.patch version update 2020-07-27 18:06:26 +08:00
cups-freebind.patch Package init 2019-09-30 10:36:23 -04:00
cups-ipp-multifile.patch Package init 2019-09-30 10:36:23 -04:00
cups-multilib.patch version update 2020-07-27 18:06:26 +08:00
cups-system-auth.patch Package init 2019-09-30 10:36:23 -04:00
cups-uri-compat.patch version update 2020-07-27 18:06:26 +08:00
cups-usb-paperout.patch Package init 2019-09-30 10:36:23 -04:00
cups-web-devices-timeout.patch version update 2020-07-27 18:06:26 +08:00
cups.gni modify install script -Signed-off-by dongzhengkuan@huawei.com 2023-10-20 17:00:22 +08:00
cups.spec fix CVE-2024-35235 Signed-off-by:caizihua1@huawei.com 2024-07-11 16:50:34 +08:00
cups.yaml add license header Signed-off-by:dongzhengkuan@huawei.com 2023-08-17 17:07:32 +08:00
cupsprinter.png Package init 2019-09-30 10:36:23 -04:00
fix-httpAddrGetList-test-case-fail.patch fix build error 2023-06-09 06:55:30 +00:00
generate_mime_convs.py update readme Signed-off-by:dongzhengkuan@huawei.com 2023-07-19 09:32:44 +08:00
install.py oh usb print patch Signed-off-by:baozewei@huawei.com 2024-08-16 10:21:21 +08:00
LICENSE 增加readme和license文件 Signed-off-by:dongzhengkuan@huawei.com 2023-07-06 11:45:25 +08:00
OAT.xml update OAT.xml. 2023-07-25 13:48:22 +00:00
ohos_ip_conflict.patch Modifying conflicts between WiFi and P2P IP addresses Singed-off-by:dongzhengkuan@huawei.com 2024-02-04 14:06:17 +08:00
ohos-add-openssl.patch add tls protocol Signed-off-by:dongzhengkuan@huawei.com 2023-08-14 15:57:28 +08:00
ohos-modify-pthread.patch add tls protocol Signed-off-by:dongzhengkuan@huawei.com 2023-08-14 15:57:28 +08:00
ohos-multi-file-print.patch add tls protocol Signed-off-by:dongzhengkuan@huawei.com 2023-08-14 15:57:28 +08:00
ohos-usb-manager.patch 获取usb interface异常 Signed-off-by:baozewei@huawei.com 2024-10-14 15:07:33 +08:00
ohos-usb-print.patch printer pipe initialization Signed-off-by:baozewei@huawei.com 2024-08-23 09:43:33 +08:00
README_zh.md modified oat.xml Signed-off-by:dongzhengkuan@huawei.com 2023-07-25 21:00:36 +08:00
README.md 修改readme Signed-off-by:dongzhengkuan@huawei.com 2023-07-20 09:55:22 +08:00
README.OpenSource change name to openEuler:cups 2024-09-27 17:44:09 +08:00

CUPS

Introduction

OpenPrinting CUPS is the most current version of CUPS, a standards-based, open source printing system for Linux® and other Unix®-like operating systems. CUPS supports printing to:

  • AirPrint™ and IPP Everywhere™ printers,
  • Network and local (USB) printers with Printer Applications, and
  • Network and local (USB) printers with (legacy) PPD-based printer drivers.

You can also learn more about the CUPS project through the official website

Background Brief

In the process of OpenHarmony's southward ecological development, it is necessary to be compatible with printers in the stock market. The use of CUPS printing system can directly connect with most printers in the market, which also reduces the difficulty for printer manufacturers to adapt to OpenHarmony.

How to use

1、Header file import

#include <cups/cups-private.h>

2、Add Compilation Dependency

Add in the bundle. json file

"deps": {
  "third_part": [
    "cups"
  ]
}

Add dependencies where needed in BUILD.gn

deps += [ "//third_party/cups:cups" ]

3、Example of interface usage

// Example of using CUPS interface to query printer capabilities
ipp_t *request; /* IPP Request */
ipp_t *response; /* IPP response */
http_t *http = NULL;
char scheme[HTTP_MAX_URI]; // Protocol 
char username[HTTP_MAX_URI];
char host[HTTP_MAX_URI];
int port;
// Declare which printer capabilities need to be queried, here are all
static const char * const pattrs[] = {
    "all"
};

// Connect to printer
http = httpConnect2(host, port, NULL, AF_UNSPEC, HTTP_ENCRYPTION_IF_REQUESTED, 1, TIME_OUT, NULL);
if (http == nullptr) {
    return;
}
request = ippNewRequest(IPP_OP_GET_PRINTER_ATTRIBUTES);
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, printerUri.c_str());
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "requesting-user-name", NULL, cupsUser());
ippAddStrings(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD, "requested-attributes",
(int)(sizeof(pattrs) / sizeof(pattrs[0])), NULL, pattrs);
response = cupsDoRequest(http, request, "/");
// parse response
if (cupsLastError() > IPP_STATUS_OK_CONFLICTING) {
    ippDelete(response);
    return;
}
// close http
httpClose(http);

Repositories Involved

third_party_cups-filters

print_print_fwk

Contribution

How to involve

Commit message spec