Exemplo n.º 1
0
        public void OnServiceConnected(ProfileType profile, IBluetoothProfile proxy)
        {
            string msg = "Profile Type : {0}".FormatWith(profile.ToString());

            System.Diagnostics.Debug.WriteLine(msg);

            foreach (BluetoothDevice item in proxy.ConnectedDevices)
            {
                msg = "Connected Device Name:{0}".FormatWith(item.Name);
                System.Diagnostics.Debug.WriteLine(msg);

                var args = new Util.XamariN.BLuetoothEventArgs(new BluetoothDeviceInfo(item.Name, item.Address, (int)item.Type, (int)item.BondState)
                {
                    IsConnected = true
                });
                Util.XamariN.BluetoothEvents.OnUpdateInfo(args);
            }
        }
        public void OnServiceConnected(ProfileType profile, IBluetoothProfile proxy)
        {
            BluetoothDevice result      = null;
            StringBuilder   deviceNames = new StringBuilder();
            var             devices     = this.bluetoothAdapter.BondedDevices;

            if (null != devices)
            {
                foreach (var bluetoothDevice in devices)
                {
                    deviceNames.Append(bluetoothDevice.Name + ";");
                }
            }

            var allDevices = deviceNames.ToString();

            this.OnServiceConnectComplete();
        }
Exemplo n.º 3
0
 public void OnServiceConnected([GeneratedEnum] ProfileType profile, IBluetoothProfile proxy)
 => ServiceConnected?.Invoke(this, EventArgs.Empty);