// Copyright © 2006-2010 Travis Robinson. All rights reserved.
//
// website: http://sourceforge.net/projects/libusbdotnet
// e-mail: libusbdotnet@gmail.com
//
// This program is free software; you can redistribute it and/or modify it
// under the terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
// for more details.
//
// You should have received a copy of the GNU General Public License along
// with this program; if not, write to the Free Software Foundation, Inc.,
// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. or
// visit www.gnu.org.
//
//
using LibUsbDotNet.LudnMonoLibUsb;
using LibUsbDotNet.WinUsb;
namespace LibUsbDotNet
{
///
/// The interface contains members needed to configure a USB device for use.
///
///
/// Only "whole" usb devices have a interface such as a
/// or a . This indicates
/// the USB device must be properly configured by the user before it can be used.
/// Partial or interfaces of devices such as a do not have an
/// interface. This indicates that the driver is handling device configuration.
///
///
/// This example uses the interface to select the desired configuration and interface
/// for usb devices that require it.
///
///
public interface IUsbDevice : IUsbInterface
{
///
/// Sets the USB devices active configuration value.
///
/// The active configuration value. A zero value means the device is not configured and a non-zero value indicates the device is configured.
/// True on success.
///
/// A USB device can have several different configurations, but only one active configuration.
///
bool SetConfiguration(byte config);
///
/// Gets the USB devices active configuration value.
///
/// The active configuration value. A zero value means the device is not configured and a non-zero value indicates the device is configured.
/// True on success.
bool GetConfiguration(out byte config);
///
/// Sets an alternate interface for the most recent claimed interface.
///
/// The alternate interface to select for the most recent claimed interface See .
/// True on success.
bool SetAltInterface(int alternateID);
///
/// Gets the selected alternate interface of the specified interface.
///
/// The interface settings number (index) to retrieve the selected alternate interface setting for.
/// The alternate interface setting selected for use with the specified interface.
/// True on success.
bool GetAltInterfaceSetting(byte interfaceID, out byte selectedAltInterfaceID);
///
/// Claims the specified interface of the device.
///
/// The interface to claim.
/// True on success.
bool ClaimInterface(int interfaceID);
///
/// Releases an interface that was previously claimed with .
///
/// The interface to release.
/// True on success.
bool ReleaseInterface(int interfaceID);
///
/// Sends a usb device reset command.
///
///
/// After calling , the instance is disposed and
/// no longer usable. A new instance must be obtained from the device list.
///
/// True on success.
bool ResetDevice();
}
}