BLE服务UUID - System.FormatException:' Guid应该包含32位数字,包括4个破折号(xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)。'

时间:2018-05-24 02:17:44

标签: c# uwp uuid formatexception

我正在编写一个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但仍然会出错。

0 个答案:

没有答案