예제 #1
0
        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);
        }
예제 #2
0
 private GattValueChangedEventArgs(Windows.Devices.Bluetooth.GenericAttributeProfile.GattValueChangedEventArgs args)
 {
     _args = args;
 }
예제 #3
0
        //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;
            }
        }
예제 #4
0
 private void _characteristic_ValueChanged(Windows.Devices.Bluetooth.GenericAttributeProfile.GattCharacteristic sender, Windows.Devices.Bluetooth.GenericAttributeProfile.GattValueChangedEventArgs args)
 {
     valueChanged?.Invoke(this, args);
 }