mirror of
https://github.com/openharmony/third_party_backends.git
synced 2026-06-29 21:03:30 -04:00
master
修改load函数加载条件,未找到驱动返回不支持
Created-by: Q-haosu
Commit-by: 刘昊苏
Merged-by: openharmony_ci
Description: ### 一、内容说明(相关的Issue)
### 二、建议测试周期和提测地址
建议测试完成时间:xxxx.xx.xx
投产上线时间:xxxx.xx.xx
提测地址:CI环境/压测环境
测试账号:
### 三、变更内容
* 3.1 关联PR列表
* 3.2 数据库和部署说明
1. 常规更新
2. 重启unicorn
3. 重启sidekiq
4. 迁移任务:是否有迁移任务,没有写 "无"
5. rake脚本:`bundle exec xxx RAILS_ENV = production`;没有写 "无"
* 3.4 其他技术优化内容(做了什么,变更了什么)
- 重构了 xxxx 代码
- xxxx 算法优化
* 3.5 废弃通知(什么字段、方法弃用?)
* 3.6 后向不兼容变更(是否有无法向后兼容的变更?)
### 四、研发自测点(自测哪些?冒烟用例全部自测?)
自测测试结论:
### 五、测试关注点(需要提醒QA重点关注的、可能会忽略的地方)
检查点:
| 需求名称 | 是否影响xx公共模块 | 是否需要xx功能 | 需求升级是否依赖其他子产品 |
|------|------------|----------|---------------|
| xxx | 否 | 需要 | 不需要 |
| | | | |
接口测试:
性能测试:
并发测试:
其他:
See merge request: openharmony/third_party_backends!60
SANE
Introduction
SANE is an application programming interface (API) that provides standardized access to any raster image scanner hardware (flatbed scanner, hand-held scanner, video- and still-cameras, frame-grabbers, etc.).
You can also learn more about the SANE 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.
Directory structure
- LICENSE Copyright File
- OAT.xml OAT.XML filtering configuration file
- README.OpenSource Project README OpenSource files
- README.md English Description
- README_zh.md Chinese Description
- backend scanning device backend source code
- include SANE API interface
- lib SANE library source code
- sanei SANE internal utility functions and tools
- doc documents and instruction files
How to use
1、Header file import
#include <sane/sane.h>
2、Add Compilation Dependency
Add in the bundle. json file
"deps": {
"third_party": [
"backends"
]
}
Add dependencies where needed in BUILD.gn
deps += [ "//third_party/backends:third_sane" ]
3、Example of interface usage
SANE_Status status;
SANE_Handle handle;
// Initialize SANE
status = sane_init(NULL, NULL);
if (status != SANE_STATUS_GOOD) {
fprintf(stderr, "Failed to initialize SANE: %s\n", sane_strstatus(status));
return 1;
}
// Open the first scanner device
status = sane_open("your_scanner_device_name", &handle);
if (status != SANE_STATUS_GOOD) {
fprintf(stderr, "Failed to open scanner: %s\n", sane_strstatus(status));
return 1;
}
// Get scanner device information
const SANE_Device *device_info;
status = sane_get_devices(&device_info, SANE_FALSE);
if (status != SANE_STATUS_GOOD) {
fprintf(stderr, "Failed to get scanner device information: %s\n", sane_strstatus(status));
return 1;
}
// Set scan parameters
SANE_Parameters parameters;
status = sane_get_parameters(handle, ¶meters);
if (status != SANE_STATUS_GOOD) {
fprintf(stderr, "Failed to get scan parameters: %s\n", sane_strstatus(status));
return 1;
}
// Start scanning
SANE_Image image;
status = sane_start(handle);
if (status != SANE_STATUS_GOOD) {
fprintf(stderr, "Failed to start scanning: %s\n", sane_strstatus(status));
return 1;
}
// Read scan data
do {
status = sane_read(handle, &image);
if (status != SANE_STATUS_GOOD) {
fprintf(stderr, "Failed to read scan data: %s\n", sane_strstatus(status));
break;
}
} while (status == SANE_STATUS_GOOD);
// Finish scanning
status = sane_cancel(handle);
if (status != SANE_STATUS_GOOD) {
fprintf(stderr, "Failed to cancel scanning: %s\n", sane_strstatus(status));
return 1;
}
// Close the scanner device
status = sane_close(handle);
if (status != SANE_STATUS_GOOD) {
fprintf(stderr, "Failed to close scanner: %s\n", sane_strstatus(status));
return 1;
}
// Exit SANE
sane_exit();
相关仓
参与贡献
Description
Languages
C
90.1%
C++
8.4%
Makefile
0.5%
Java
0.4%
M4
0.4%
Other
0.1%