view USBLib/Communication/IUsbDevice.cs @ 67:2d16447eff12

Simplified USB communication code, added functions to abort pipe transfers
author Ivo Smits <Ivo@UCIS.nl>
date Wed, 16 Oct 2013 01:11:49 +0200
parents abe0d55a2201
children
line wrap: on
line source

???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; }
	}
	public interface IUsbInterface : IDisposable {
		Byte Configuration { get; }
		void Close();

		int GetDescriptor(byte descriptorType, byte index, short langId, Byte[] buffer, int offset, int length);

		int PipeTransfer(Byte endpoint, Byte[] buffer, int offset, int length);
		void PipeReset(Byte endpoint);
		void PipeAbort(Byte endpoint);
		int ControlTransfer(UsbControlRequestType requestType, byte request, short value, short index, Byte[] buffer, int offset, int length);

		UsbPipeStream GetPipeStream(Byte endpoint);
	}
}