private UInt16 getRequest(jrkRequest requestId, UInt16 id, Byte length) { UInt16 value = 0; byte[] value_array; if (length == 2) { value_array = new byte[2]; controlTransfer(0xC0, (Byte)requestId, 0, (ushort)id, value_array); value = (ushort)(value_array[0] + 256 * value_array[1]); } else if (length == 1) { value_array = new byte[1]; controlTransfer(0xC0, (Byte)requestId, 0, (ushort)id, value_array); value = value_array[0]; } else { throw new ArgumentException("length must be 1 or 2", "length"); } return(value); }
private void setRequestU8(jrkRequest requestId, Byte id, Byte value) { controlTransfer(0x40, (byte)requestId, value, (UInt16)(id + (1 << 8))); }
private UInt16 getRequest(jrkRequest requestId, UInt16 id, Byte length) { UInt16 value = 0; byte[] value_array; if (length == 2) { value_array = new byte[2]; controlTransfer(0xC0, (Byte)requestId, 0, (ushort)id, value_array); value = (ushort)(value_array[0] + 256 * value_array[1]); } else if (length == 1) { value_array = new byte[1]; controlTransfer(0xC0, (Byte)requestId, 0, (ushort)id, value_array); value = value_array[0]; } else { throw new ArgumentException("length must be 1 or 2", "length"); } return value; }
private void setRequestU16(jrkRequest requestId, Byte id, UInt16 value) { controlTransfer(0x40, (byte)requestId, value, (UInt16)(id + (2 << 8))); }