//Event that is called when the value of the characteristic is changed
        private void CharacteristicEvent_ValueChanged(object sender, Plugin.BLE.Abstractions.EventArgs.CharacteristicUpdatedEventArgs args)
        {
            Debug.WriteLine("CharateristicEvent : " + args.ToString());

            if (args == null)
            {
                Debug.WriteLine("Args is null.");
            }
            if (args.Characteristic == null)
            {
                Debug.WriteLine("Args.Characteristic is null.");
            }
            if (args.Characteristic.Value == null)
            {
                Debug.WriteLine("Args.Characteristic.Value is null.");
            }
            if (_ValueChanged == null)
            {
                Debug.WriteLine("ValueChanged is null.");
            }

            var buffer    = args.Characteristic.Value;
            var charEvent = new CharacteristicEvent(buffer);

            _ValueChanged?.Invoke(sender, charEvent);
        }
Ejemplo n.º 2
0
 private void InvokeChange(object o, CharacteristicEvent v)
 {
     Change?.Invoke(o, v);
 }
Ejemplo n.º 3
0
 void TriggerChange(GattCharacteristic sender, CharacteristicEvent ChangeEvent)
 {
     ValueChanged?.Invoke(sender, ChangeEvent);
 }