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