Beispiel #1
0
        internal RXBluetoothDevice GetBluetoothDeviceFromDeviceInformation(DeviceInformation deviceInformation)
        {
            ulong address = BluetoothUtils.AddressStringToInt64(RXBluetoothUtils.GetAddressStringFromDeviceId(deviceInformation.Id));

            foreach (var device in _BluetoothDeviceList)
            {
                if (device.Address == address)
                {
                    return(device);
                }
            }
            RXBluetoothDevice rxBluetoothDevice = new RXBluetoothDevice(this, deviceInformation);

            _BluetoothDeviceList.Add(rxBluetoothDevice);
            return(rxBluetoothDevice);
        }
Beispiel #2
0
        internal RXBluetoothDevice RemoveBluetoothDeviceFromDeviceInformationUpdate(DeviceInformationUpdate deviceInformationUpdate)
        {
            ulong             address             = BluetoothUtils.AddressStringToInt64(RXBluetoothUtils.GetAddressStringFromDeviceId(deviceInformationUpdate.Id));
            RXBluetoothDevice deviceReadyToDelete = null;

            foreach (var device in _BluetoothDeviceList)
            {
                if (device.Address == address)
                {
                    deviceReadyToDelete = device;
                    break;
                }
            }
            if (deviceReadyToDelete != null)
            {
                _BluetoothDeviceList.Remove(deviceReadyToDelete);
            }
            return(deviceReadyToDelete);
        }