コード例 #1
0
        public override void OnCharacteristicRead(BluetoothGatt gatt, BluetoothGattCharacteristic characteristic, [GeneratedEnum] GattStatus status)
        {
            base.OnCharacteristicRead(gatt, characteristic, status);

            var args = new BLEGATTCharacteristicStatusEventArgs(gatt, characteristic, status);

            _wes.RaiseEvent(nameof(CharacteristicRead), this, args);
        }
コード例 #2
0
        private void OnCharacteristicRead(object sender, BLEGATTCharacteristicStatusEventArgs e)
        {
            if (!ReferenceEquals(e.Characteristic, _characteristic))
            {
                return;
            }

            if (e.Status != GattStatus.Success)
            {
                RaiseReadFailed(e.Status.ToShared());
            }
            else
            {
                RaiseValueChanged();
            }
        }