[UWP] [C#] [RS2:1703] Windows 10,版本1703更新使'使用Windows.Devices.Bluetooth.GenericAttributeProfile'无效。 [英] [UWP][C#][RS2:1703]Windows 10, version 1703 update makes 'using Windows.Devices.Bluetooth.GenericAttributeProfile' not work.

查看:250
本文介绍了[UWP] [C#] [RS2:1703] Windows 10,版本1703更新使'使用Windows.Devices.Bluetooth.GenericAttributeProfile'无效。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近我更新了Windows 10版本1703.之后,蓝牙设置界面已经改变 并且

Recently i updated windows 10 version 1703. After that bluetooth setting UI has changed  and

不是错误,在Visual Studio c#中使用'Windows.Devices.Bluetooth .GenericAttributeProfile'不起作用。

not an error, in visual studio c# using 'Windows.Devices.Bluetooth.GenericAttributeProfile' doesn't work.

------------------------------- ----------------------------------

-----------------------------------------------------------------

private async void btnScan_Click(object sender,EventArgs e)

        {

            cboxDevice.Text =" Searching ...";

            var devL = await DeviceInformation.FindAllAsync();

            foreach(dev dev in devL)

            {

                if(dev.Id.Contains(" BTHLEDevice")))
                {

                   试试
                    {

                        var svc = await GattDeviceService.FromIdAsync(dev.Id);

                        string uuid = svc.Uuid.ToString();

                        cboxDevice.Items.Add(" [" + dev.Name +"]:" + uuid);

                    }


                    catch(例外情况)

                    {

                        //MessageBox.Show(ex.Message);

                    }¥b $ b                }¥b $ b            }

private async void btnScan_Click(object sender, EventArgs e)
        {
            cboxDevice.Text = "Searching...";
            var devL = await DeviceInformation.FindAllAsync();
            foreach (var dev in devL)
            {
                if (dev.Id.Contains("BTHLEDevice"))
                {
                    try
                    {
                        var svc = await GattDeviceService.FromIdAsync(dev.Id);
                        string uuid = svc.Uuid.ToString();
                        cboxDevice.Items.Add("[" + dev.Name + "] :" + uuid);
                    }

                    catch (Exception ex)
                    {
                        //MessageBox.Show(ex.Message);
                    }
                }
            }

------------------------- -------------------------------------------------- --------

var svc = await GattDeviceService.FromIdAsync(dev.Id); 

var svc = await GattDeviceService.FromIdAsync(dev.Id); 

此时代码未处理。

任何人都可以告诉我为什么? 

anyone can tell me why? 

请帮帮我。

谢谢。

推荐答案

嗨CokeBear2,

Hi CokeBear2,

此论坛讨论并询问有关C#编程语言的问题,由于您的问题与UWP更相关,我们将向UWP论坛提供合适的支持。

This forum discusses and asks questions about the C# programming language, Since your issue is more related to UWP, we'll move it UWP forum for suitable support.

感谢您的理解。

祝你好运,

Cole Wu


这篇关于[UWP] [C#] [RS2:1703] Windows 10,版本1703更新使'使用Windows.Devices.Bluetooth.GenericAttributeProfile'无效。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆