void FoundDevice(Object s, Plugin.BLE.Abstractions.EventArgs.DeviceEventArgs a) { Console.WriteLine("FOUND DEVICE: " + a.Device); if (a.Device.Name.Contains("Kijkdoos")) { ConnectDevice(a.Device); } }
private void DeviceWatcher_Added(object sender, Plugin.BLE.Abstractions.EventArgs.DeviceEventArgs args) { int indexer = index++; if (args.Device.Name == string.Empty || mVisibleDevices == null) { return; } MutexBlock(() => { mVisibleDevices.Clear(); var devices = mAdapter.DiscoveredDevices; foreach (var item in devices) { Debug.WriteLine(item.Name + " " + item.Id); AddUniqueItem(new UnPairedDeviceBLE(item)); } }, (indexer.ToString() + " Adding")); }
private void Adapter_DeviceDiscovered(object sender, Plugin.BLE.Abstractions.EventArgs.DeviceEventArgs e) { //if (!String.IsNullOrEmpty(e.Device.Name)) OnMyDeviceDiscovered(e.Device); }
private void Adapter_DeviceDisconnected(object sender, Plugin.BLE.Abstractions.EventArgs.DeviceEventArgs e) { MessagingCenter.Send <BLEService, ToastNotificationEventArgs>(this, string.Empty, new ToastNotificationEventArgs("The Device {0} is disconnected", e.Device.Name)); }