集成文档 Integrated documents
导读 Guide
本篇文章展示的是Flutter的集成使用,因为 Flutter插件底层是依赖于 iOS 和 Android平台的原生代码,所以对于不同手机系统的限制条件可以去阅读 iOS使用文档 和 Android使用文档 This article demonstrates the integration usage of Flutter. Since the underlying code of the Flutter plugin is dependent on the native code of iOS and Android platforms, restrictions for different mobile operating systems can be found by reading iOS User Documentation and Android User Documentation
最后如果想更多了解Api内容 可以查阅 Yasee Flutter Plugin Api文档 Finally, if you want to know more about the Api content, you can refer to Yasee Flutter Plugin Api documentation
其次 Flutter中的Api 完全来之不同的平台原生代码,因此 如有定制化的需求可以阅读相关的原生文档! Secondly, the API in Flutter is entirely based on the native code of different platforms. Therefore, if there are any customized requirements, you can refer to the relevant native documentation!
准备工作 Preparation
准备工作的内容完全需要满足iOS 、Android端的要求.具体请查看 iOS使用文档 和 Android使用文档!! The content of the preparation work must fully meet the requirements for both iOS and Android platforms. For details, please refer to [iOS User Guide].(../yasee_ios/used_doc.md) 和 Android User Guide!!
如果想要了解更多的 flutter API 可以查阅 Yasee Flutter Plugin Api文档 If you want to learn more about the Flutter API, you can refer to Yasee Flutter Plugin Api documentation
大纲 Outline
接下来,我们将分为以下几个步骤,带领您集成、以及使用Yasee Flutter 版本插件. Next, we will proceed with the following steps to guide you through the integration and usage of the Yasee Flutter version plugin.
- 初始化 Yasee SDK
Initialize the Yasee SDK
- 蓝牙配置信息 (
BleConfig) Bluetooth configuration information (BleConfig) - 人员配置信息 (
User) Personnel allocation information(User)
- 蓝牙配置信息 (
- 数据通知相关
Data notification related
- 设备连接 通知 Device connection notification
- 设备收发信息通知 Equipment information transmission and reception notification
- 设备 绑定 变更通知 Equipment binding change notification
- 蓝牙相关操作
Bluetooth-related operations
- 搜索 Yasee 设备 Search for Yasee device
- 连接 Yasee 设备 Connect the Yasee device
- 获取 设备 支持 检测项 Obtain device support detection items
- 获取 检测项 支持的 指令 Obtain the instructions supported by the detection items
- 收发 与 外设的 双向指令 Bidirectional instructions between the device and peripheral devices
正式开始 Official start
对于一个SDK而言,👉完整的Api文档👈是必不可少的.
For an SDK,👉Complete API documentation👈It is indispensable.\
在处理异常和参数理解上有重要的意义, It is of great significance in handling exceptions and understanding parameters.
因此, SDK在使用中会有可视化的参数提示,如: Therefore, during the use of the SDK, there will be visual parameter prompts, such as:

以及对每一个参数的具体说明

对于异常处理,在dart中您可以使用try..catch的方式来捕获异常: For exception handling, in Dart, you can use the try..catch structure to catch exceptions:
// 空值判断 Null value check
if (value == null) { return }
// do 异常捕获 Exception catching
try {
// 概率下可存在 奔溃的情况
Under certain probabilities, a collapse situation could exist.
} catch (err) {
// 失败的逻辑处理
Logical processing of failure
}