Ejemplo n.º 1
0
        public SeekThermalPro(WinUSBEnumeratedDevice dev)
        {
            device = new WinUSBDevice(dev);

            // device setup sequence
            try
            {
                device.ControlTransferOut(0x41, 84, 0, 0, new byte[] { 0x01 });
            }
            catch
            {
                // Try deinit device and repeat.
                Deinit();
                device.ControlTransferOut(0x41, 84, 0, 0, new byte[] { 0x01 });
            }

            device.ControlTransferOut(0x41, 60, 0, 0, new byte[] { 0x00, 0x00 });

            byte[] data1 = device.ControlTransferIn(0xC1, 78, 0, 0, 4);

            byte[] data2 = device.ControlTransferIn(0xC1, 54, 0, 0, 12);

            // Analysis of 0x56 payload:
            // First byte seems to be half the size of the output data.
            // It seems like this command may be retriving some sensor data?
            device.ControlTransferOut(0x41, 86, 0, 0, new byte[] { 0x06, 0x00, 0x08, 0x00, 0x00, 0x00 });

            byte[] data3 = device.ControlTransferIn(0xC1, 0x58, 0, 0, 12);

            device.ControlTransferOut(0x41, 85, 0, 0, new byte[] { 0x17, 0x00 });

            byte[] data4 = device.ControlTransferIn(0xC1, 78, 0, 0, 0x40);

            device.ControlTransferOut(0x41, 86, 0, 0, new byte[] { 0x0C, 0x00, 0x70, 0x00, 0x00, 0x00 });

            byte[] data5 = device.ControlTransferIn(0xC1, 0x58, 0, 0, 2);

            device.ControlTransferOut(0x41, 86, 0, 0, new byte[] { 0x01, 0x00, 0x01, 0x06, 0x00, 0x00 });

            byte[] data6 = device.ControlTransferIn(0xC1, 88, 0, 0, 2);


            UInt16 addr;

            for (addr = 0; addr < 2560; addr += 32)
            {
                byte[] addrle_p = BitConverter.GetBytes(addr);
                device.ControlTransferOut(0x41, 86, 0, 0, new byte[] { 0x20, 0x00, addrle_p[0], addrle_p[1], 0x00, 0x00 });

                byte[] data7 = device.ControlTransferIn(0xC1, 88, 0, 0, 64);
            }

            device.ControlTransferOut(0x41, 85, 0, 0, new byte[] { 0x15, 0x00 });

            byte[] data8 = device.ControlTransferIn(0xC1, 78, 0, 0, 64);

            device.ControlTransferOut(0x41, 62, 0, 0, new byte[] { 0x08, 0x00 });

            device.ControlTransferOut(0x41, 60, 0, 0, new byte[] { 0x01, 0x00 });
        }
Ejemplo n.º 2
0
        byte[] VendorRequestIn(DeviceRequest request, ushort value, ushort index, ushort length)
        {
            byte requestType = WinUSBDevice.ControlRecipientDevice | WinUSBDevice.ControlTypeVendor;


            return(Device.ControlTransferIn(requestType, (byte)request, value, index, length));
        }
Ejemplo n.º 3
0
        public SeekThermal(WinUSBEnumeratedDevice dev)
        {
            device = new WinUSBDevice(dev);



            // device setup sequence
            try
            {
                device.ControlTransferOut(0x41, 0x54, 0, 0, new byte[] { 0x01 });
            }
            catch
            {
                // Try deinit device and repeat.
                Deinit();
                device.ControlTransferOut(0x41, 0x54, 0, 0, new byte[] { 0x01 });
            }

            device.ControlTransferOut(0x41, 0x3c, 0, 0, new byte[] { 0x00, 0x00 });

            byte[] data1 = device.ControlTransferIn(0xC1, 0x4e, 0, 0, 4);

            byte[] data2 = device.ControlTransferIn(0xC1, 0x36, 0, 0, 12);

            // Analysis of 0x56 payload:
            // First byte seems to be half the size of the output data.
            // It seems like this command may be retriving some sensor data?
            device.ControlTransferOut(0x41, 0x56, 0, 0, new byte[] { 0x20, 0x00, 0x30, 0x00, 0x00, 0x00 });

            byte[] data3 = device.ControlTransferIn(0xC1, 0x58, 0, 0, 0x40);

            device.ControlTransferOut(0x41, 0x56, 0, 0, new byte[] { 0x20, 0x00, 0x50, 0x00, 0x00, 0x00 });

            byte[] data4 = device.ControlTransferIn(0xC1, 0x58, 0, 0, 0x40);

            device.ControlTransferOut(0x41, 0x56, 0, 0, new byte[] { 0x0C, 0x00, 0x70, 0x00, 0x00, 0x00 });

            byte[] data5 = device.ControlTransferIn(0xC1, 0x58, 0, 0, 0x18);

            device.ControlTransferOut(0x41, 0x56, 0, 0, new byte[] { 0x06, 0x00, 0x08, 0x00, 0x00, 0x00 });

            byte[] data6 = device.ControlTransferIn(0xC1, 0x58, 0, 0, 0x0c);


            device.ControlTransferOut(0x41, 0x3E, 0, 0, new byte[] { 0x08, 0x00 });

            byte[] data7 = device.ControlTransferIn(0xC1, 0x3D, 0, 0, 2);

            device.ControlTransferOut(0x41, 0x3E, 0, 0, new byte[] { 0x08, 0x00 });

            device.ControlTransferOut(0x41, 0x3C, 0, 0, new byte[] { 0x01, 0x00 });

            byte[] data8 = device.ControlTransferIn(0xC1, 0x3D, 0, 0, 2);
        }
Ejemplo n.º 4
0
 byte[] DfuIn(DfuRequest req, UInt16 value, UInt16 length)
 {
     return(BaseDevice.ControlTransferIn(WinUSBDevice.ControlTypeClass | WinUSBDevice.ControlRecipientInterface, (byte)req, value, DfuInterface, length));
 }