private void _bluetoothService_NewDateRecieved(object _sender, BLEModel _bleModel)
 {
     Application.Current.Dispatcher?.Invoke(() =>
     {
         Data.Add(_bleModel);
     }, DispatcherPriority.Normal);
 }
Exemplo n.º 2
0
 private void BluetoothService_NewDateRecieved(object _sender, BLEModel _bleModel)
 {
     Data.Add(_bleModel);
     if (!Manufacturers.ToList().Any(x => x.ManufacturerID == _bleModel.Manufacturer.ManufacturerID))
     {
         Manufacturers.Add(_bleModel.Manufacturer);
     }
 }
Exemplo n.º 3
0
        private void Watcher_Received(BluetoothLEAdvertisementWatcher sender, BluetoothLEAdvertisementReceivedEventArgs args)
        {
            var manufacturerDataCollection = args.Advertisement.ManufacturerData.ToList();

            foreach (var item in manufacturerDataCollection)
            {
                var result = new BLEModel();
                result.Manufacturer = new ManufacturerData()
                {
                    ManufacturerID = item.CompanyId
                };
                result.Data = ReadBuffer(item.Data);
                result.ID   = args.BluetoothAddress;
                NewDateRecieved?.Invoke(this, result);
            }
        }
Exemplo n.º 4
0
        private void Watcher_Received(BluetoothLEAdvertisementWatcher sender, BluetoothLEAdvertisementReceivedEventArgs args)
        {
            var manufacturerDataCollection = args.Advertisement.ManufacturerData.ToList();

            foreach (var item in manufacturerDataCollection)
            {
                var result = new BLEModel();
                result.Company = item.CompanyId;
                result.Data    = ReadBuffer(item.Data);
                result.ID      = args.BluetoothAddress;

                Application.Current.Dispatcher.Invoke(() =>
                {
                    bag.Add(result);
                }, DispatcherPriority.Normal);
            }
        }