Beispiel #1
0
 public void DiscoverServices()
 {
     if (Services != null && Services.Count > 0)
     {
         ServicesDiscovered?.Invoke(this, new EventArgs());
     }
 }
Beispiel #2
0
        public override void OnServicesDiscovered(BluetoothGatt gatt, GattStatus status)
        {
            base.OnServicesDiscovered(gatt, status);

            Trace.Message("OnServicesDiscovered: {0}", status.ToString());

            ServicesDiscovered?.Invoke(this, new ServicesDiscoveredCallbackEventArgs());
        }
        public override void OnServicesDiscovered(bt.BluetoothGatt gatt, [GeneratedEnum] bt.GattStatus status)
        {
            base.OnServicesDiscovered(gatt, status);

            ServicesDiscovered?.Invoke(this, new ServicesDiscoveredEventArgs(gatt, status));

            _servicesDiscovered = true;
        }
Beispiel #4
0
 public override void DiscoverServices()
 {
     Windows.Foundation.IAsyncOperation <Windows.Devices.Bluetooth.GenericAttributeProfile.GattDeviceServicesResult> task = nativeDevice.GetGattServicesAsync(BluetoothCacheMode.Uncached);
     while (task.Status == Windows.Foundation.AsyncStatus.Started)
     {
         Thread.Sleep(50);
     }
     Windows.Devices.Bluetooth.GenericAttributeProfile.GattDeviceServicesResult result = task.GetResults();
     this._services.Clear();
     if (result.Status == Windows.Devices.Bluetooth.GenericAttributeProfile.GattCommunicationStatus.Success)
     {
         foreach (var item in result.Services)
         {
             Debug.WriteLine("Device.Discovered Service: " + item.DeviceId);
             this._services.Add(new Service(item));
         }
         ServicesDiscovered?.Invoke(this, new EventArgs());
     }
     else
     {
     }
 }
 public override void OnServicesDiscovered(BluetoothGatt gatt, GattStatus status)
 {
     ServicesDiscovered?.Invoke(gatt, status);
 }
Beispiel #6
0
 private void RaiseServicesDiscovered(IList <BLEService> services)
 => ServicesDiscovered?.Invoke(this, new BLEServicesEventArgs(services));