Concrete implmentation of BluetoothLE.Core.IDevice interface
Наследование: IDevice, IDisposable
Пример #1
0
		private void ConnectedPeripheral(object sender, CBPeripheralEventArgs e)
		{
			var deviceId = Device.DeviceIdentifierToGuid(e.Peripheral.Identifier);
			if (ConnectedDevices.All(x => x.Id != deviceId))
			{
				var device = new Device(e.Peripheral);
				ConnectedDevices.Add(device);
				DeviceConnected(this, new DeviceConnectionEventArgs(device));
			}
		}
Пример #2
0
		private void FailedToConnectPeripheral(object sender, CBPeripheralErrorEventArgs e)
		{
			var device = new Device(e.Peripheral);
			var args = new DeviceConnectionEventArgs(device) {
				ErrorMessage = e.Error.Description
			};

			DeviceFailedToConnect(this, args);
		}
Пример #3
0
		private void DiscoveredPeripheral(object sender, CBDiscoveredPeripheralEventArgs e)
		{
			var deviceId = Device.DeviceIdentifierToGuid(e.Peripheral.Identifier);
			if (DiscoveredDevices.All(x => x.Id != deviceId))
			{
				var device = new Device(e.Peripheral);
				DiscoveredDevices.Add(device);
				DeviceDiscovered(this, new DeviceDiscoveredEventArgs(device));
			}
		}