c# - BLE 服务 UUID--System.FormatException:'Guid 应包含 32 位数字和 4 个破折号(xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)。
问题描述
我正在编写一个 UWP 代码来连接附近的 BLE 设备。在这行代码...
GattDeviceServicesResult result = await GetGattServicesForUuidAsync(
new System.Guid("00001809-0000-1000-8000-00805F9B34FB"),
BluetoothCacheMode.Uncached
);
...它给了我错误...
System.FormatException: 'Guid 应包含 32 位数字和 4 个破折号 (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)。'
我已经仔细检查了字符 UUID 是 1809,并且我已将其转换为 128 位 UUID,但它仍然给出错误。
解决方案
推荐阅读
- javascript - 提供给“BootstrapTable”的“字符串”类型的无效道具“selectRow”,预期为“对象”
- python - 如何设置每辆车访问的最小节点数或设置每辆车的最短行驶时间?
- javascript - 来自网站的真实示例的原型(单独)和构造函数(单独)?
- python - Python 语法问题 - TypeError:未找到必需的参数“名称”(位置 1)
- mysql - 预订:我想显示所有记录的条件,包括表号 2 中的记录是否为空
- php - 使用 PHP 解析(第 3 次)嵌套 JSON
- excel - 为什么 POIUtil.cfc 电子表格代码显示一些数字不正确?
- flutter - 如何在flutter项目中实现下拉加载更多数据,而不是下拉刷新数据的效果?
- python - 如何在 django 中通过 unidecode 保存用户名(电话)和密码?
- eclipse-rcp - 在 Eclipse 工具栏中添加分隔符