Exemplo n.º 1
0
        public override void OnReliableWriteCompleted(BluetoothGatt gatt, [GeneratedEnum] GattStatus status)
        {
            base.OnReliableWriteCompleted(gatt, status);

            var args = new BLEGATTStatusEventArgs(gatt, status);

            _wes.RaiseEvent(nameof(ReliableWriteCompleted), this, args);
        }
Exemplo n.º 2
0
        public override void OnServicesDiscovered(BluetoothGatt gatt, [GeneratedEnum] GattStatus status)
        {
            base.OnServicesDiscovered(gatt, status);

            var args = new BLEGATTStatusEventArgs(gatt, status);

            _wes.RaiseEvent(nameof(ServicesDiscovered), this, args);
        }
Exemplo n.º 3
0
 private void OnServicesDiscovered(object sender, BLEGATTStatusEventArgs e)
 {
     if (e.Status != GattStatus.Success)
     {
         RaiseDiscoverServicesFailed(e.Status.ToShared());
     }
     else
     {
         var services = _gatt
                        .Services
                        .Select(s => new BLEService(_gatt, _callback, s))
                        .ToList();
         RaiseServicesDiscovered(services);
     }
 }