Beispiel #1
0
        private void UpdateStatistics(string name, byte id, bool tx, bool rx)
        {
            Statistics nameStat = null;

            foreach (Statistics stat in DetectedDevices)
            {
                if (stat.Name == name)
                {
                    nameStat = stat;
                    break;
                }
            }

            if (nameStat == null)
            {
                nameStat = new Statistics(name, id);
                DetectedDevices.Add(nameStat);
            }

            if (tx)
            {
                nameStat.TxCount++;
            }

            if (rx)
            {
                nameStat.RxCount++;
            }
        }
Beispiel #2
0
 void DeviceDiscovered(object sender, DeviceEventArgs e)
 {
     if (!String.IsNullOrWhiteSpace(e.Device.Name))
     {
         DetectedDevices.Add(e.Device);
     }
 }
Beispiel #3
0
 public void UpdateList()
 {
     DetectedDevices.Clear();
     foreach (IDevice device in _adapter.DiscoveredDevices)
     {
         DetectedDevices.Add(device);
     }
 }
Beispiel #4
0
        private void OnDeviceDetected(object sender, DeviceModel model)
        {
            if (DetectedDevices.Any(d => d.Id == model.Id || d.Name == model.Name))
            {
                return;
            }

            DetectedDevices.Add(model);
        }
Beispiel #5
0
 public async void StartScanning()
 {
     if (IsScanning)
     {
         return;
     }
     DetectedDevices.Clear();
     //_adapter.DiscoveredDevices.Clear();
     foreach (IDevice _connectedDevice in _adapter.ConnectedDevices)
     {
         await _adapter.DisconnectDeviceAsync(_connectedDevice);
     }
     IsScanning = true;
     await _adapter.StartScanningForDevicesAsync();
 }
Beispiel #6
0
        public MirandaViewModel()
        {
            if (this.IsInDesignMode())
            {
                NoDevicesDetected = false;

                DetectedDevices.Add(new DeviceDataViewModel {
                    ActualDescription = new DeviceDescription {
                        DeviceName     = "Pharos",
                        IpAddress      = "192.168.11.251",
                        MacAddress     = "11:22:33:44:55:66",
                        NetworkMode    = "StaticIp",
                        SerialNumber   = "PH123456",
                        SubnetMask     = "255.255.255.0",
                        GatewayAddress = "192.168.1.1"
                    }
                });
            }
        }