feat(android): 添加 CH934X USB 转串口芯片支持

- 在 AndroidManifest.xml 中添加 USB Host 权限声明
- 集成 CH934X Android SDK 并通过反射调用原生功能
- 实现设备查找、串口读写、GPIO 和 Modem 控制功能
- 添加异常回调机制处理设备拔出等情况
- 提供 Stream 数据流支持实时串口数据监听
- 完善单元测试覆盖所有核心功能模块
This commit is contained in:
Developer
2026-07-06 16:06:54 +08:00
parent 6efaf5671f
commit e0d1a1775d
26 changed files with 2055 additions and 184 deletions
+24 -9
View File
@@ -1,15 +1,30 @@
# ch934x_serial
A new Flutter project.
Flutter 插件:封装南京沁恒微电子 **CH934X 系列** USB 转多串口芯片的
Android SDK,提供设备查找、串口读写、GPIO 与 Modem 控制等能力。
## Getting Started
## 文档
This project is a starting point for a Flutter
[plug-in package](https://flutter.dev/to/develop-plugins),
a specialized package that includes platform-specific implementation code for
Android and/or iOS.
- 详细使用说明:[`docs/CH934X_Plugin_使用说明.md`](docs/CH934X_Plugin_使用说明.md)
- 原 Android SDK 接口规范:[`docs/CH934X_Android_开发说明.md`](docs/CH934X_Android_开发说明.md)
For help getting started with Flutter development, view the
[online documentation](https://docs.flutter.dev), which offers tutorials,
samples, guidance on mobile development, and a full API reference.
## 快速上手
```yaml
dependencies:
ch934x_serial: ^1.0.0
```
```dart
import 'package:ch934x_serial/ch934x_serial.dart';
final plugin = Ch934xSerial();
final devices = await plugin.getDeviceList();
```
完整 API 列表与示例请阅读上面的使用说明。
## 平台支持
- ✅ Android(基于 `CH934XLib.jar` 反射桥接)
- ❌ iOS / Web / Desktop(暂未实现)