【发布时间】:2018-08-20 14:17:44
【问题描述】:
我正在使用 flutter blue 连接 adafruit 羽毛板并读入/写入一些值。我将如何设置我希望从中读取的新特征?我已按照示例进行操作,但在阅读我的 arduino 代码中生成的双精度值时遇到了困难。
//Read Uuid
BluetoothCharacteristic readCharacter = new
BluetoothCharacteristic(uuid: null, serviceUuid: 6e400001-b5a3-f393-e0a9-
e50e24dcca9e, descriptors: null,
properties: null);
//Write UUID
我不确定我想要的特定蓝牙特性的声明需要什么参数。文档指示我不确定如何格式化的 uuid?
此外,如果有任何其他简单项目的示例读取和写入值并建立用户界面,那将很高兴查看。
【问题讨论】:
-
更新:解决了这个问题。 (c.uuid == new Guid('blah blah..') 是声明 uuid 的正确方法。必须区分服务 uuid 和特征 uuid。使用特征 uuid 并保存为变量。
-
从那里将 int/byte 数组解析为我希望获得的双精度值。可以在此处找到这些应用程序的有用示例项目:github.com/Sensirion/smart-gadget-flutter
标签: bluetooth flutter flutter-dependencies