Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/windows/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Windows 10蓝牙Gatt客户端值更改问题_Windows_Bluetooth_Bluetooth Lowenergy_Win Universal App_Gatt - Fatal编程技术网

Windows 10蓝牙Gatt客户端值更改问题

Windows 10蓝牙Gatt客户端值更改问题,windows,bluetooth,bluetooth-lowenergy,win-universal-app,gatt,Windows,Bluetooth,Bluetooth Lowenergy,Win Universal App,Gatt,目前我对蓝牙Gatt特性读取有问题。我试图用自己的自定义配置文件运行代码 thermometerCharacteristic.ValueChanged += temperatureMeasurementChanged; 它导致了这个例外 mscorlib.ni.dll中发生“System.ArgumentException”类型的异常,但未在用户代码中处理 其他信息:值不在预期范围内 我的函数参数如下所示 void temperatureMeasurementChanged(GattChara

目前我对蓝牙Gatt特性读取有问题。我试图用自己的自定义配置文件运行代码

thermometerCharacteristic.ValueChanged += temperatureMeasurementChanged;
它导致了这个例外

mscorlib.ni.dll中发生“System.ArgumentException”类型的异常,但未在用户代码中处理

其他信息:值不在预期范围内

我的函数参数如下所示

void temperatureMeasurementChanged(GattCharacteristic sender, GattValueChangedEventArgs eventArgs)
此代码类似于在MSDN上检索蓝牙LE数据的示例。你知道是什么引起的吗?非常感谢

Check for thermometerCharacteristic.CharacteristicProperties == (GattCharacteristicProperties.Read | GattCharacteristicProperties.Notify)
订阅前:

     if (characteristic.CharacteristicProperties == (GattCharacteristicProperties.Read | GattCharacteristicProperties.Notify))
        {
            characteristic.ValueChanged += Characteristic_ValueChanged;

            GattCommunicationStatus status =
                       await characteristic.WriteClientCharacteristicConfigurationDescriptorAsync(
                       CHARACTERISTIC_NOTIFICATION_TYPE);
        }

谢谢我试试看。