Ejemplo n.º 1
0
            public override void DiscoveredPeripheral(CBCentralManager central, CBPeripheral peripheral, NSDictionary advertisementData, NSNumber RSSI)
            {
                foreach (var item in advertisementData)
                {
                    if (item.Key.ToString() == CBAdvertisement.DataLocalNameKey)
                    {
                        System.Diagnostics.Debug.WriteLine($"{item.Key}  {item.Value}");
                    }
                }

                //if (!string.IsNullOrEmpty(peripheral.Name))
                //{
                System.Diagnostics.Debug.WriteLine(peripheral.Name + " " + peripheral.Identifier.ToString());
                if (!_owner._devices.Contains(peripheral))
                {
                    _owner._devices.Add(peripheral);
                }



                UIDevice.CurrentDevice.BeginInvokeOnMainThread(() =>
                {
                    _owner.OnReloadData();
                });
                //}
            }
Ejemplo n.º 2
0
            public override void DiscoveredPeripheral(CBCentralManager central, CBPeripheral peripheral, NSDictionary advertisementData, NSNumber RSSI)
            {
                if (!string.IsNullOrEmpty(peripheral.Name))
                {
                    System.Diagnostics.Debug.WriteLine(peripheral.Name + " " + peripheral.Identifier.ToString());
                    _owner._devices.Add(peripheral);

                    UIDevice.CurrentDevice.BeginInvokeOnMainThread(() =>
                    {
                        _owner.OnReloadData();
                    });
                }
            }