Пример #1
0
        public async Task TestDeviceIdIsPersisted()
        {
            var deviceId         = "asd";
            var windowsUsbDevice = new WindowsUsbDevice(deviceId, new DebugLogger(), new DebugTracer(), 80, 80);

            Assert.AreEqual(deviceId, windowsUsbDevice.DeviceId);
        }
Пример #2
0
        private static async Task Go()
        {
            var devices = WindowsDeviceBase.GetConnectedDeviceInformations(WindowsDeviceConstants.GUID_DEVINTERFACE_USB_DEVICE);

            //var device = devices.FirstOrDefault(d => d.DevicePath.ToLower().Contains("2b24"));
            var device = devices.FirstOrDefault(d => d.DevicePath.ToLower().Contains("1209"));

            var windowsUsbDevice = new WindowsUsbDevice(device.DevicePath, 64, 64);

            await windowsUsbDevice.InitializeAsync();

            var buffer = new byte[64];

            buffer[0] = 0x3f;
            buffer[1] = 0x23;
            buffer[2] = 0x23;

            await windowsUsbDevice.WriteAsync(buffer);

            var asdasd = await windowsUsbDevice.ReadAsync();
        }