diff USBLib/Communication/IUsbDevice.cs @ 21:dcfec2be27c9

Added USBLib
author Ivo Smits <Ivo@UCIS.nl>
date Mon, 15 Apr 2013 01:04:59 +0200
parents
children 053cc617af54
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/USBLib/Communication/IUsbDevice.cs	Mon Apr 15 01:04:59 2013 +0200
@@ -0,0 +1,32 @@
+using System;
+
+namespace UCIS.USBLib.Communication {
+	public interface IUsbDevice : IUsbInterface, IDisposable {
+		new Byte Configuration { get; set; }
+		void ClaimInterface(int interfaceID);
+		void ReleaseInterface(int interfaceID);
+		void ResetDevice();
+
+		IUsbDeviceRegistry Registry { get; }
+
+		//void Close();
+	}
+	public interface IUsbInterface : IDisposable {
+		Byte Configuration { get; }
+		void Close();
+
+		//int ControlTransfer(byte requestType, byte request, short value, short index, Byte[] buffer, int offset, int length);
+		int GetDescriptor(byte descriptorType, byte index, short langId, Byte[] buffer, int offset, int length);
+		String GetString(short langId, byte stringIndex);
+
+		int BulkWrite(Byte endpoint, Byte[] buffer, int offset, int length);
+		int BulkRead(Byte endpoint, Byte[] buffer, int offset, int length);
+		int InterruptWrite(Byte endpoint, Byte[] buffer, int offset, int length);
+		int InterruptRead(Byte endpoint, Byte[] buffer, int offset, int length);
+		int ControlWrite(UsbControlRequestType requestType, byte request, short value, short index, Byte[] buffer, int offset, int length);
+		int ControlRead(UsbControlRequestType requestType, byte request, short value, short index, Byte[] buffer, int offset, int length);
+
+		UsbPipeStream GetBulkStream(Byte endpoint);
+		UsbPipeStream GetInterruptStream(Byte endpoint);
+	}
+}