Ejemplo n.º 1
0
        private void _usb_DataReceived(object sender, BeaconInfoEventArgs e)
        {
            if (e.Info == null)
            {
                return;
            }

            var net = NetworkInfo.Where(x => x.Ssid == e.Info.ssid && x.Mac == e.Info.mac).FirstOrDefault();

            if (net == null)
            {
                net = new Data.NetworkInfo(e.Info);
                NetworkInfo.Add(net);
            }
            if (net.AddChannel(e.Info) && net.Ssid == _selectedSsid && net.Mac == _selectedMac)
            {
                Channels.Add(net.Channels.Last());
            }
            if (_selectedChannel == e.Info.wifiChan && net.Ssid == _selectedSsid && net.Mac == _selectedMac)
            {
                if (_calculator.HandleInfo(e.Info))
                {
                    var level = _calculator.GetAvg();
                    _cameraFragment.SetLevel(level);
                }
                //PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(Diff)));
                //PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(Level)));
            }
        }
Ejemplo n.º 2
0
 private async void ViewModel_DataReceived(object sender, BeaconInfoEventArgs e)
 {
     if (_logView != null && _logViewFrame != null)
     {
         await _logView.Dispatcher.RunAsync(CoreDispatcherPriority.Normal,
                                            () => (_logViewFrame.Content as View.LogViewPage).AddLog(e));
     }
 }