/// <summary> /// Initializes a new instance of the<see cref="ObservableBluetoothLEDevice" /> class. /// </summary> /// <param name="deviceInfo">The device info that describes this bluetooth device"/></param> public ObservableBluetoothLEDevice(DeviceInformation deviceInfo) { DeviceInfo = deviceInfo; Name = DeviceInfo.Name; string ret = String.Empty; if (DeviceInfo.Properties.ContainsKey("System.Devices.Aep.DeviceAddress")) { BluetoothAddressAsString = ret = DeviceInfo.Properties["System.Devices.Aep.DeviceAddress"].ToString(); BluetoothAddressAsUlong = Convert.ToUInt64(BluetoothAddressAsString.Replace(":", String.Empty), 16); } IsPaired = DeviceInfo.Pairing.IsPaired; LoadGlyph(); this.PropertyChanged += ObservableBluetoothLEDevice_PropertyChanged; }
/// <summary> /// Initializes a new instance of the<see cref="ObservableBluetoothLEDevice" /> class. /// </summary> /// <param name="deviceInfo">The device info that describes this bluetooth device"/></param> public ObservableBluetoothLEDevice(DeviceInformation deviceInfo) { DeviceInfo = deviceInfo; Name = DeviceInfo.Name; string ret = String.Empty; if (DeviceInfo.Properties.ContainsKey("System.Devices.Aep.DeviceAddress")) { BluetoothAddressAsString = ret = DeviceInfo.Properties["System.Devices.Aep.DeviceAddress"].ToString(); BluetoothAddressAsUlong = Convert.ToUInt64(BluetoothAddressAsString.Replace(":", String.Empty), 16); } IsPaired = DeviceInfo.Pairing.IsPaired; //update RSSI if (DeviceInfo.Properties.ContainsKey("System.Devices.Aep.SignalStrength") && DeviceInfo.Properties["System.Devices.Aep.SignalStrength"] != null) { RSSI = (int)DeviceInfo.Properties["System.Devices.Aep.SignalStrength"]; } //this.PropertyChanged += ObservableBluetoothLEDevice_PropertyChanged; }