private void Win10Characteristic_ValueChanged(Windows.Devices.Bluetooth.GenericAttributeProfile.GattCharacteristic sender, Windows.Devices.Bluetooth.GenericAttributeProfile.GattValueChangedEventArgs args) { var reader = DataReader.FromBuffer(args.CharacteristicValue); byte[] valueBytes = new byte[reader.UnconsumedBufferLength]; reader.ReadBytes(valueBytes); OnNotified?.Invoke(this, valueBytes); }
private GattValueChangedEventArgs(Windows.Devices.Bluetooth.GenericAttributeProfile.GattValueChangedEventArgs args) { _args = args; }
//Play Animation Finished 0x76 //Miposour Status 0x79 internal override void CharacteristicsNotify_ValueChanged(Windows.Devices.Bluetooth.GenericAttributeProfile.GattCharacteristic sender, Windows.Devices.Bluetooth.GenericAttributeProfile.GattValueChangedEventArgs args) { var data = args.CharacteristicValue.ToArray(); var hexstring = UTF8Encoding.UTF8.GetString(data, 0, data.Count()); var bytes = StringToByteArray(hexstring); switch (bytes[0]) { case 0x76: //GetCurrentMIPGameMode OnAnimationFinishedRecieved(bytes[1]); break; } }
private void _characteristic_ValueChanged(Windows.Devices.Bluetooth.GenericAttributeProfile.GattCharacteristic sender, Windows.Devices.Bluetooth.GenericAttributeProfile.GattValueChangedEventArgs args) { valueChanged?.Invoke(this, args); }