Beispiel #1
0
        /// <summary>
        /// Get Paired or Connected devices.
        /// </summary>
        /// <returns></returns>
        public List <GoPlus> GetBondedDevices()
        {
            _devicesFound.Clear();
            List <IDevice> devices = _adapter.GetSystemConnectedOrPairedDevices();
            List <GoPlus>  pgpList = new List <GoPlus>();

            foreach (var device in devices)
            {
                if (device.Name == Constants.GoPlusName)
                {
                    var    androidDev = (Android.Bluetooth.BluetoothDevice)device.NativeDevice;
                    GoPlus pgp        = new GoPlus()
                    {
                        Name      = androidDev.Name,
                        BtAddress = androidDev.Address
                    };

                    _devicesFound.Add(pgp, device);
                    pgpList.Add(pgp);
                }
            }

            if (pgpList.Count == 0)
            {
                _notifyManager.ShowShortToast("No paired Pokemon GO Plus found. Please make sure it's connected via Pokemon GO.");
            }

            return(pgpList);
        }