示例#1
0
 public static void OnUpdateInfo(BLuetoothEventArgs args)
 {
     if (BluetoothEvents.UpdateInfo != null)
     {
         BluetoothEvents.UpdateInfo.Invoke(null, args);
     }
 }
示例#2
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);
            }
        }